
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(+
(* z (+ (* (/ z x) (+ 0.0007936500793651 y)) (/ -0.0027777777777778 x)))
(* (log x) (- x 0.5)))))
x))
double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (log(x) * (x - 0.5))))) - x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + ((z * (((z / x) * (0.0007936500793651d0 + y)) + ((-0.0027777777777778d0) / x))) + (log(x) * (x - 0.5d0))))) - x
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (Math.log(x) * (x - 0.5))))) - x;
}
def code(x, y, z): return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (math.log(x) * (x - 0.5))))) - x
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z * Float64(Float64(Float64(z / x) * Float64(0.0007936500793651 + y)) + Float64(-0.0027777777777778 / x))) + Float64(log(x) * Float64(x - 0.5))))) - x) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (log(x) * (x - 0.5))))) - x; end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right) + \log x \cdot \left(x - 0.5\right)\right)\right)\right) - x
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in z around 0 95.8%
pow195.8%
fmm-def95.8%
*-commutative95.8%
un-div-inv95.8%
*-commutative95.8%
un-div-inv95.8%
Applied egg-rr95.8%
unpow195.8%
metadata-eval95.8%
associate-*r/95.8%
metadata-eval95.8%
associate-*r/95.8%
fmm-def95.8%
sub-neg95.8%
distribute-rgt-in92.7%
associate-*r/92.7%
metadata-eval92.7%
associate-*l/92.7%
associate-*r/92.7%
associate-*l/94.3%
associate-/l*93.0%
distribute-rgt-out98.5%
associate-*r/98.5%
metadata-eval98.5%
distribute-neg-frac98.5%
metadata-eval98.5%
Simplified98.5%
(FPCore (x y z)
:precision binary64
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(+
(* z (+ (* (/ z x) (+ 0.0007936500793651 y)) (/ -0.0027777777777778 x)))
(* x (log x)))))
x))
double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (x * log(x))))) - x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + ((z * (((z / x) * (0.0007936500793651d0 + y)) + ((-0.0027777777777778d0) / x))) + (x * log(x))))) - x
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (x * Math.log(x))))) - x;
}
def code(x, y, z): return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (x * math.log(x))))) - x
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z * Float64(Float64(Float64(z / x) * Float64(0.0007936500793651 + y)) + Float64(-0.0027777777777778 / x))) + Float64(x * log(x))))) - x) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (x * log(x))))) - x; end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right) + x \cdot \log x\right)\right)\right) - x
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in z around 0 95.8%
pow195.8%
fmm-def95.8%
*-commutative95.8%
un-div-inv95.8%
*-commutative95.8%
un-div-inv95.8%
Applied egg-rr95.8%
unpow195.8%
metadata-eval95.8%
associate-*r/95.8%
metadata-eval95.8%
associate-*r/95.8%
fmm-def95.8%
sub-neg95.8%
distribute-rgt-in92.7%
associate-*r/92.7%
metadata-eval92.7%
associate-*l/92.7%
associate-*r/92.7%
associate-*l/94.3%
associate-/l*93.0%
distribute-rgt-out98.5%
associate-*r/98.5%
metadata-eval98.5%
distribute-neg-frac98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in x around inf 98.2%
mul-1-neg98.2%
distribute-rgt-neg-in98.2%
log-rec98.2%
remove-double-neg98.2%
Simplified98.2%
(FPCore (x y z)
:precision binary64
(if (or (<= z -9e-19) (not (<= z 1450000000000.0)))
(*
(* z z)
(/
(+
0.0007936500793651
(- y (/ (+ 0.0027777777777778 (/ -0.083333333333333 z)) z)))
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 1.0 (* x 12.000000000000048)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9e-19) || !(z <= 1450000000000.0)) {
tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-9d-19)) .or. (.not. (z <= 1450000000000.0d0))) then
tmp = (z * z) * ((0.0007936500793651d0 + (y - ((0.0027777777777778d0 + ((-0.083333333333333d0) / z)) / z))) / x)
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (1.0d0 / (x * 12.000000000000048d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9e-19) || !(z <= 1450000000000.0)) {
tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x);
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9e-19) or not (z <= 1450000000000.0): tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9e-19) || !(z <= 1450000000000.0)) tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + Float64(y - Float64(Float64(0.0027777777777778 + Float64(-0.083333333333333 / z)) / z))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(1.0 / Float64(x * 12.000000000000048))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9e-19) || ~((z <= 1450000000000.0))) tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9e-19], N[Not[LessEqual[z, 1450000000000.0]], $MachinePrecision]], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + N[(y - N[(N[(0.0027777777777778 + N[(-0.083333333333333 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-19} \lor \neg \left(z \leq 1450000000000\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + \left(y - \frac{0.0027777777777778 + \frac{-0.083333333333333}{z}}{z}\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -9.00000000000000026e-19 or 1.45e12 < z Initial program 92.2%
remove-double-neg92.2%
distribute-frac-neg292.2%
sub-neg92.2%
associate-+l+92.2%
fma-define92.2%
sub-neg92.2%
metadata-eval92.2%
+-commutative92.2%
unsub-neg92.2%
distribute-frac-neg292.2%
remove-double-neg92.2%
Simplified92.2%
Taylor expanded in z around -inf 95.9%
Taylor expanded in x around 0 80.5%
associate-/l*82.8%
mul-1-neg82.8%
unsub-neg82.8%
sub-neg82.8%
associate-*r/82.8%
metadata-eval82.8%
distribute-neg-frac82.8%
metadata-eval82.8%
Simplified82.8%
unpow282.8%
Applied egg-rr82.8%
if -9.00000000000000026e-19 < z < 1.45e12Initial program 99.4%
clear-num99.4%
inv-pow99.4%
*-commutative99.4%
fma-undefine99.4%
fmm-def99.5%
metadata-eval99.5%
Applied egg-rr99.5%
unpow-199.5%
fma-define99.4%
+-commutative99.4%
*-commutative99.4%
fma-define99.5%
Simplified99.5%
Taylor expanded in z around 0 95.2%
*-commutative95.2%
Simplified95.2%
Final simplification89.4%
(FPCore (x y z)
:precision binary64
(if (or (<= z -2.4e-18) (not (<= z 16000000000000.0)))
(*
(* z z)
(/
(+
0.0007936500793651
(- y (/ (+ 0.0027777777777778 (/ -0.083333333333333 z)) z)))
x))
(-
(+ (+ 0.91893853320467 (/ 0.083333333333333 x)) (* (log x) (+ x -0.5)))
x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.4e-18) || !(z <= 16000000000000.0)) {
tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x);
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + (log(x) * (x + -0.5))) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2.4d-18)) .or. (.not. (z <= 16000000000000.0d0))) then
tmp = (z * z) * ((0.0007936500793651d0 + (y - ((0.0027777777777778d0 + ((-0.083333333333333d0) / z)) / z))) / x)
else
tmp = ((0.91893853320467d0 + (0.083333333333333d0 / x)) + (log(x) * (x + (-0.5d0)))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.4e-18) || !(z <= 16000000000000.0)) {
tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x);
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + (Math.log(x) * (x + -0.5))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.4e-18) or not (z <= 16000000000000.0): tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x) else: tmp = ((0.91893853320467 + (0.083333333333333 / x)) + (math.log(x) * (x + -0.5))) - x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.4e-18) || !(z <= 16000000000000.0)) tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + Float64(y - Float64(Float64(0.0027777777777778 + Float64(-0.083333333333333 / z)) / z))) / x)); else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(log(x) * Float64(x + -0.5))) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.4e-18) || ~((z <= 16000000000000.0))) tmp = (z * z) * ((0.0007936500793651 + (y - ((0.0027777777777778 + (-0.083333333333333 / z)) / z))) / x); else tmp = ((0.91893853320467 + (0.083333333333333 / x)) + (log(x) * (x + -0.5))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.4e-18], N[Not[LessEqual[z, 16000000000000.0]], $MachinePrecision]], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + N[(y - N[(N[(0.0027777777777778 + N[(-0.083333333333333 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-18} \lor \neg \left(z \leq 16000000000000\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + \left(y - \frac{0.0027777777777778 + \frac{-0.083333333333333}{z}}{z}\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \log x \cdot \left(x + -0.5\right)\right) - x\\
\end{array}
\end{array}
if z < -2.39999999999999994e-18 or 1.6e13 < z Initial program 92.2%
remove-double-neg92.2%
distribute-frac-neg292.2%
sub-neg92.2%
associate-+l+92.2%
fma-define92.2%
sub-neg92.2%
metadata-eval92.2%
+-commutative92.2%
unsub-neg92.2%
distribute-frac-neg292.2%
remove-double-neg92.2%
Simplified92.2%
Taylor expanded in z around -inf 95.9%
Taylor expanded in x around 0 80.5%
associate-/l*82.8%
mul-1-neg82.8%
unsub-neg82.8%
sub-neg82.8%
associate-*r/82.8%
metadata-eval82.8%
distribute-neg-frac82.8%
metadata-eval82.8%
Simplified82.8%
unpow282.8%
Applied egg-rr82.8%
if -2.39999999999999994e-18 < z < 1.6e13Initial program 99.4%
remove-double-neg99.4%
distribute-frac-neg299.4%
sub-neg99.4%
associate-+l+99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
unsub-neg99.4%
distribute-frac-neg299.4%
remove-double-neg99.4%
Simplified99.4%
Taylor expanded in z around 0 95.2%
associate-+r+95.2%
associate-*r/95.1%
metadata-eval95.1%
sub-neg95.1%
metadata-eval95.1%
+-commutative95.1%
Simplified95.1%
Final simplification89.4%
(FPCore (x y z)
:precision binary64
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z): return (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 96.0%
Final simplification96.0%
(FPCore (x y z)
:precision binary64
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (- (* x (log x)) x))))
double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * log(x)) - x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((x * log(x)) - x))
end function
public static double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
}
def code(x, y, z): return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * math.log(x)) - x))
function code(x, y, z) return Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))) end
function tmp = code(x, y, z) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * log(x)) - x)); end
code[x_, y_, z_] := N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)
\end{array}
Initial program 96.0%
Taylor expanded in x around inf 95.8%
mul-1-neg95.8%
distribute-rgt-neg-in95.8%
log-rec95.8%
remove-double-neg95.8%
Simplified95.8%
Final simplification95.8%
(FPCore (x y z)
:precision binary64
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 96.0%
add-cube-cbrt95.6%
pow395.6%
Applied egg-rr95.6%
Taylor expanded in x around inf 95.8%
sub-neg95.8%
mul-1-neg95.8%
distribute-neg-in95.8%
+-commutative95.8%
distribute-neg-in95.8%
metadata-eval95.8%
log-rec95.8%
remove-double-neg95.8%
Simplified95.8%
Final simplification95.8%
(FPCore (x y z)
:precision binary64
(if (<= x 5.8e+36)
(/
(+
0.083333333333333
(* z (* z (- (+ 0.0007936500793651 y) (/ 0.0027777777777778 z)))))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+36) {
tmp = (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 5.8d+36) then
tmp = (0.083333333333333d0 + (z * (z * ((0.0007936500793651d0 + y) - (0.0027777777777778d0 / z))))) / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+36) {
tmp = (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.8e+36: tmp = (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.8e+36) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) - Float64(0.0027777777777778 / z))))) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5.8e+36) tmp = (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.8e+36], N[(N[(0.083333333333333 + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] - N[(0.0027777777777778 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.8 \cdot 10^{+36}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(\left(0.0007936500793651 + y\right) - \frac{0.0027777777777778}{z}\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 5.8e36Initial program 99.6%
remove-double-neg99.6%
distribute-frac-neg299.6%
sub-neg99.6%
associate-+l+99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
unsub-neg99.6%
distribute-frac-neg299.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 94.4%
Taylor expanded in z around inf 93.7%
associate-*r/94.4%
metadata-eval94.4%
Simplified94.4%
if 5.8e36 < x Initial program 91.9%
remove-double-neg91.9%
distribute-frac-neg291.9%
sub-neg91.9%
associate-+l+91.9%
fma-define91.9%
sub-neg91.9%
metadata-eval91.9%
+-commutative91.9%
unsub-neg91.9%
distribute-frac-neg291.9%
remove-double-neg91.9%
Simplified91.9%
Taylor expanded in x around inf 75.8%
sub-neg75.8%
mul-1-neg75.8%
log-rec75.8%
remove-double-neg75.8%
metadata-eval75.8%
Simplified75.8%
(FPCore (x y z)
:precision binary64
(if (or (<= y -0.00078) (not (<= y 4.2e-12)))
(/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x)
(/
(+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00078) || !(y <= 4.2e-12)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-0.00078d0)) .or. (.not. (y <= 4.2d-12))) then
tmp = (0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x
else
tmp = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00078) || !(y <= 4.2e-12)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.00078) or not (y <= 4.2e-12): tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x else: tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.00078) || !(y <= 4.2e-12)) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x); else tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.00078) || ~((y <= 4.2e-12))) tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x; else tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00078], N[Not[LessEqual[y, 4.2e-12]], $MachinePrecision]], N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00078 \lor \neg \left(y \leq 4.2 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -7.79999999999999986e-4 or 4.19999999999999988e-12 < y Initial program 96.1%
remove-double-neg96.1%
distribute-frac-neg296.1%
sub-neg96.1%
associate-+l+96.1%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 63.2%
Taylor expanded in y around inf 63.2%
*-commutative63.2%
Simplified63.2%
if -7.79999999999999986e-4 < y < 4.19999999999999988e-12Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 60.0%
Taylor expanded in y around 0 59.8%
*-commutative59.8%
Simplified59.8%
Final simplification61.5%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (* z (- (+ 0.0007936500793651 y) (/ 0.0027777777777778 z))))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * (z * ((0.0007936500793651d0 + y) - (0.0027777777777778d0 / z))))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) - Float64(0.0027777777777778 / z))))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * (z * ((0.0007936500793651 + y) - (0.0027777777777778 / z))))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] - N[(0.0027777777777778 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(\left(0.0007936500793651 + y\right) - \frac{0.0027777777777778}{z}\right)\right)}{x}
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 61.6%
Taylor expanded in z around inf 61.2%
associate-*r/61.6%
metadata-eval61.6%
Simplified61.6%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 61.6%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* (+ 0.0007936500793651 y) (* z z))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + ((0.0007936500793651 + y) * (z * z))) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + ((0.0007936500793651d0 + y) * (z * z))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + ((0.0007936500793651 + y) * (z * z))) / x;
}
def code(x, y, z): return (0.083333333333333 + ((0.0007936500793651 + y) * (z * z))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(Float64(0.0007936500793651 + y) * Float64(z * z))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + ((0.0007936500793651 + y) * (z * z))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + \left(0.0007936500793651 + y\right) \cdot \left(z \cdot z\right)}{x}
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 61.6%
Taylor expanded in z around inf 61.1%
unpow242.0%
Applied egg-rr61.1%
Final simplification61.1%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 61.6%
Taylor expanded in y around 0 49.8%
*-commutative49.8%
Simplified49.8%
(FPCore (x y z) :precision binary64 (+ (* 0.083333333333333 (/ 1.0 x)) (* (/ z x) -0.0027777777777778)))
double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 * (1.0d0 / x)) + ((z / x) * (-0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778);
}
def code(x, y, z): return (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778)
function code(x, y, z) return Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z / x) * -0.0027777777777778)) end
function tmp = code(x, y, z) tmp = (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778); end
code[x_, y_, z_] := N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * -0.0027777777777778), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x} + \frac{z}{x} \cdot -0.0027777777777778
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 61.6%
Taylor expanded in z around 0 30.7%
*-commutative30.7%
Simplified30.7%
Taylor expanded in z around 0 30.7%
Final simplification30.7%
(FPCore (x y z) :precision binary64 (if (<= z -30.0) (* (/ z x) -0.0027777777777778) (* 0.083333333333333 (/ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -30.0) {
tmp = (z / x) * -0.0027777777777778;
} else {
tmp = 0.083333333333333 * (1.0 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-30.0d0)) then
tmp = (z / x) * (-0.0027777777777778d0)
else
tmp = 0.083333333333333d0 * (1.0d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -30.0) {
tmp = (z / x) * -0.0027777777777778;
} else {
tmp = 0.083333333333333 * (1.0 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -30.0: tmp = (z / x) * -0.0027777777777778 else: tmp = 0.083333333333333 * (1.0 / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -30.0) tmp = Float64(Float64(z / x) * -0.0027777777777778); else tmp = Float64(0.083333333333333 * Float64(1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -30.0) tmp = (z / x) * -0.0027777777777778; else tmp = 0.083333333333333 * (1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -30.0], N[(N[(z / x), $MachinePrecision] * -0.0027777777777778), $MachinePrecision], N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30:\\
\;\;\;\;\frac{z}{x} \cdot -0.0027777777777778\\
\mathbf{else}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\
\end{array}
\end{array}
if z < -30Initial program 91.6%
remove-double-neg91.6%
distribute-frac-neg291.6%
sub-neg91.6%
associate-+l+91.6%
fma-define91.7%
sub-neg91.7%
metadata-eval91.7%
+-commutative91.7%
unsub-neg91.7%
distribute-frac-neg291.7%
remove-double-neg91.7%
Simplified91.7%
Taylor expanded in x around 0 77.8%
Taylor expanded in z around 0 23.8%
*-commutative23.8%
Simplified23.8%
Taylor expanded in z around inf 23.8%
if -30 < z Initial program 97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
sub-neg97.6%
associate-+l+97.6%
fma-define97.6%
sub-neg97.6%
metadata-eval97.6%
+-commutative97.6%
unsub-neg97.6%
distribute-frac-neg297.6%
remove-double-neg97.6%
Simplified97.6%
Taylor expanded in x around 0 55.9%
Taylor expanded in z around 0 33.1%
*-commutative33.1%
Simplified33.1%
Taylor expanded in z around 0 32.2%
div-inv32.3%
Applied egg-rr32.3%
Final simplification30.1%
(FPCore (x y z) :precision binary64 (if (<= z -30.0) (* (/ z x) -0.0027777777777778) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -30.0) {
tmp = (z / x) * -0.0027777777777778;
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-30.0d0)) then
tmp = (z / x) * (-0.0027777777777778d0)
else
tmp = 0.083333333333333d0 / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -30.0) {
tmp = (z / x) * -0.0027777777777778;
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -30.0: tmp = (z / x) * -0.0027777777777778 else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -30.0) tmp = Float64(Float64(z / x) * -0.0027777777777778); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -30.0) tmp = (z / x) * -0.0027777777777778; else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -30.0], N[(N[(z / x), $MachinePrecision] * -0.0027777777777778), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30:\\
\;\;\;\;\frac{z}{x} \cdot -0.0027777777777778\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -30Initial program 91.6%
remove-double-neg91.6%
distribute-frac-neg291.6%
sub-neg91.6%
associate-+l+91.6%
fma-define91.7%
sub-neg91.7%
metadata-eval91.7%
+-commutative91.7%
unsub-neg91.7%
distribute-frac-neg291.7%
remove-double-neg91.7%
Simplified91.7%
Taylor expanded in x around 0 77.8%
Taylor expanded in z around 0 23.8%
*-commutative23.8%
Simplified23.8%
Taylor expanded in z around inf 23.8%
if -30 < z Initial program 97.6%
remove-double-neg97.6%
distribute-frac-neg297.6%
sub-neg97.6%
associate-+l+97.6%
fma-define97.6%
sub-neg97.6%
metadata-eval97.6%
+-commutative97.6%
unsub-neg97.6%
distribute-frac-neg297.6%
remove-double-neg97.6%
Simplified97.6%
Taylor expanded in x around 0 55.9%
Taylor expanded in z around 0 33.1%
*-commutative33.1%
Simplified33.1%
Taylor expanded in z around 0 32.2%
Final simplification30.0%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * -0.0027777777777778)) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 61.6%
Taylor expanded in z around 0 30.7%
*-commutative30.7%
Simplified30.7%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg296.0%
sub-neg96.0%
associate-+l+96.0%
fma-define96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
unsub-neg96.0%
distribute-frac-neg296.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in x around 0 61.6%
Taylor expanded in z around 0 30.7%
*-commutative30.7%
Simplified30.7%
Taylor expanded in z around 0 24.7%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024170
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))