Java tutorial
//package com.java2s; public class Main { public static double magic_func(double t) { double bound = 0.04045; double a = 0.055; double gamma = 2.4; double denom = 12.92; if (t > bound) { return Math.pow((t + a) / (1 + a), gamma); } else { return t / denom; } } }