
(FPCore (x) :precision binary64 (/ (+ x 16.0) 116.0))
double code(double x) {
return (x + 16.0) / 116.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x + 16.0d0) / 116.0d0
end function
public static double code(double x) {
return (x + 16.0) / 116.0;
}
def code(x): return (x + 16.0) / 116.0
function code(x) return Float64(Float64(x + 16.0) / 116.0) end
function tmp = code(x) tmp = (x + 16.0) / 116.0; end
code[x_] := N[(N[(x + 16.0), $MachinePrecision] / 116.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + 16}{116}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (/ (+ x 16.0) 116.0))
double code(double x) {
return (x + 16.0) / 116.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x + 16.0d0) / 116.0d0
end function
public static double code(double x) {
return (x + 16.0) / 116.0;
}
def code(x): return (x + 16.0) / 116.0
function code(x) return Float64(Float64(x + 16.0) / 116.0) end
function tmp = code(x) tmp = (x + 16.0) / 116.0; end
code[x_] := N[(N[(x + 16.0), $MachinePrecision] / 116.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + 16}{116}
\end{array}
(FPCore (x) :precision binary64 (- 0.13793103448275862 (/ x -116.0)))
double code(double x) {
return 0.13793103448275862 - (x / -116.0);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.13793103448275862d0 - (x / (-116.0d0))
end function
public static double code(double x) {
return 0.13793103448275862 - (x / -116.0);
}
def code(x): return 0.13793103448275862 - (x / -116.0)
function code(x) return Float64(0.13793103448275862 - Float64(x / -116.0)) end
function tmp = code(x) tmp = 0.13793103448275862 - (x / -116.0); end
code[x_] := N[(0.13793103448275862 - N[(x / -116.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.13793103448275862 - \frac{x}{-116}
\end{array}
Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub100.0%
metadata-eval100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
herbie shell --seed 2023332
(FPCore (x)
:name "Data.Colour.CIE:cieLAB from colour-2.3.3, B"
:precision binary64
(/ (+ x 16.0) 116.0))