
(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 20 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
(if (<= x 650.0)
(+
(- 0.91893853320467 x)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
(fma (* x (log x)) (+ x -0.5) 0.083333333333333))
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (* z (+ 0.0007936500793651 y)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 650.0) {
tmp = (0.91893853320467 - x) + (fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), fma((x * log(x)), (x + -0.5), 0.083333333333333)) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (0.0007936500793651 + y)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 650.0) tmp = Float64(Float64(0.91893853320467 - x) + Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), fma(Float64(x * log(x)), Float64(x + -0.5), 0.083333333333333)) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 650.0], N[(N[(0.91893853320467 - x), $MachinePrecision] + N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + 0.083333333333333), $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[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 650:\\
\;\;\;\;\left(0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \mathsf{fma}\left(x \cdot \log x, x + -0.5, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(0.0007936500793651 + y\right)}{x}\\
\end{array}
\end{array}
if x < 650Initial program 99.6%
Taylor expanded in y around inf
Simplified89.9%
Taylor expanded in z around 0
Simplified99.6%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified99.7%
if 650 < x Initial program 81.5%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6499.0
Simplified99.0%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(if (<=
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
-2e+56)
(* y (* z (/ z x)))
(/
(fma z (fma z 0.0007936500793651 -0.0027777777777778) 0.083333333333333)
x)))
double code(double x, double y, double z) {
double tmp;
if (((0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)) <= -2e+56) {
tmp = y * (z * (z / x));
} else {
tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (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)) <= -2e+56) tmp = Float64(y * Float64(z * Float64(z / x))); else tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x); end return tmp end
code[x_, y_, z_] := If[LessEqual[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], -2e+56], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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} \leq -2 \cdot 10^{+56}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -2.00000000000000018e56Initial program 76.9%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6484.2
Simplified84.2%
associate-*l/N/A
lift-/.f64N/A
lower-*.f6484.2
Applied egg-rr84.2%
if -2.00000000000000018e56 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 91.8%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
Simplified91.9%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6453.8
Simplified53.8%
Final simplification58.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -2e+53)
(* y (* z (/ z x)))
(if (<= t_0 4e+73)
(+
(- 0.91893853320467 x)
(fma (log x) (+ x -0.5) (/ 1.0 (* x 12.000000000000048))))
(* z (* z (* (+ 0.0007936500793651 y) (/ 1.0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -2e+53) {
tmp = y * (z * (z / x));
} else if (t_0 <= 4e+73) {
tmp = (0.91893853320467 - x) + fma(log(x), (x + -0.5), (1.0 / (x * 12.000000000000048)));
} else {
tmp = z * (z * ((0.0007936500793651 + y) * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -2e+53) tmp = Float64(y * Float64(z * Float64(z / x))); elseif (t_0 <= 4e+73) tmp = Float64(Float64(0.91893853320467 - x) + fma(log(x), Float64(x + -0.5), Float64(1.0 / Float64(x * 12.000000000000048)))); else tmp = Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+53], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+73], N[(N[(0.91893853320467 - x), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+73}:\\
\;\;\;\;\left(0.91893853320467 - x\right) + \mathsf{fma}\left(\log x, x + -0.5, \frac{1}{x \cdot 12.000000000000048}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{1}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -2e53Initial program 79.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6474.5
Simplified74.5%
associate-*l/N/A
lift-/.f64N/A
lower-*.f6474.6
Applied egg-rr74.6%
if -2e53 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 3.99999999999999993e73Initial program 99.4%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6494.8
Simplified94.8%
clear-numN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval94.9
Applied egg-rr94.9%
if 3.99999999999999993e73 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 81.6%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6476.0
Simplified76.0%
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.4
lift-+.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6483.4
Applied egg-rr83.4%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -2e+53)
(* y (* z (/ z x)))
(if (<= t_0 4e+73)
(+
(- 0.91893853320467 x)
(fma (log x) (+ x -0.5) (/ 0.083333333333333 x)))
(* z (* z (* (+ 0.0007936500793651 y) (/ 1.0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -2e+53) {
tmp = y * (z * (z / x));
} else if (t_0 <= 4e+73) {
tmp = (0.91893853320467 - x) + fma(log(x), (x + -0.5), (0.083333333333333 / x));
} else {
tmp = z * (z * ((0.0007936500793651 + y) * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -2e+53) tmp = Float64(y * Float64(z * Float64(z / x))); elseif (t_0 <= 4e+73) tmp = Float64(Float64(0.91893853320467 - x) + fma(log(x), Float64(x + -0.5), Float64(0.083333333333333 / x))); else tmp = Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+53], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+73], N[(N[(0.91893853320467 - x), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+73}:\\
\;\;\;\;\left(0.91893853320467 - x\right) + \mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{1}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -2e53Initial program 79.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6474.5
Simplified74.5%
associate-*l/N/A
lift-/.f64N/A
lower-*.f6474.6
Applied egg-rr74.6%
if -2e53 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 3.99999999999999993e73Initial program 99.4%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6494.8
Simplified94.8%
if 3.99999999999999993e73 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 81.6%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6476.0
Simplified76.0%
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.4
lift-+.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6483.4
Applied egg-rr83.4%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -2e+53)
(* y (* z (/ z x)))
(if (<= t_0 4e+73)
(- (fma (log x) (+ x -0.5) (/ 0.083333333333333 x)) x)
(* z (* z (* (+ 0.0007936500793651 y) (/ 1.0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -2e+53) {
tmp = y * (z * (z / x));
} else if (t_0 <= 4e+73) {
tmp = fma(log(x), (x + -0.5), (0.083333333333333 / x)) - x;
} else {
tmp = z * (z * ((0.0007936500793651 + y) * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -2e+53) tmp = Float64(y * Float64(z * Float64(z / x))); elseif (t_0 <= 4e+73) tmp = Float64(fma(log(x), Float64(x + -0.5), Float64(0.083333333333333 / x)) - x); else tmp = Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+53], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+73], N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right) - x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{1}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -2e53Initial program 79.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6474.5
Simplified74.5%
associate-*l/N/A
lift-/.f64N/A
lower-*.f6474.6
Applied egg-rr74.6%
if -2e53 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 3.99999999999999993e73Initial program 99.4%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6494.8
Simplified94.8%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6492.7
Simplified92.7%
if 3.99999999999999993e73 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 81.6%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6476.0
Simplified76.0%
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.4
lift-+.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6483.4
Applied egg-rr83.4%
Final simplification86.2%
(FPCore (x y z) :precision binary64 (+ (fma (fma z (+ 0.0007936500793651 y) -0.0027777777777778) (/ z x) (fma (log x) (+ x -0.5) (/ 0.083333333333333 x))) (- 0.91893853320467 x)))
double code(double x, double y, double z) {
return fma(fma(z, (0.0007936500793651 + y), -0.0027777777777778), (z / x), fma(log(x), (x + -0.5), (0.083333333333333 / x))) + (0.91893853320467 - x);
}
function code(x, y, z) return Float64(fma(fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), Float64(z / x), fma(log(x), Float64(x + -0.5), Float64(0.083333333333333 / x))) + Float64(0.91893853320467 - x)) end
code[x_, y_, z_] := N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \frac{z}{x}, \mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right)\right) + \left(0.91893853320467 - x\right)
\end{array}
Initial program 89.6%
Taylor expanded in y around inf
Simplified90.7%
Taylor expanded in z around 0
Simplified99.3%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00125)
(fma
(fma
z
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
0.083333333333333)
(/ 1.0 x)
(fma -0.5 (log x) 0.91893853320467))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (* z (+ 0.0007936500793651 y)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00125) {
tmp = fma(fma(z, fma((0.0007936500793651 + y), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), fma(-0.5, log(x), 0.91893853320467));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (0.0007936500793651 + y)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.00125) tmp = fma(fma(z, fma(Float64(0.0007936500793651 + y), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / x), fma(-0.5, log(x), 0.91893853320467)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.00125], N[(N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00125:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(0.0007936500793651 + y\right)}{x}\\
\end{array}
\end{array}
if x < 0.00125000000000000003Initial program 99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0
+-commutativeN/A
remove-double-negN/A
log-recN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6498.6
Simplified98.6%
if 0.00125000000000000003 < x Initial program 82.0%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6498.6
Simplified98.6%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (log x))))
(if (<= x 1.6e+131)
(fma
(fma
z
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
0.083333333333333)
(/ 1.0 x)
(- t_0 x))
(+
t_0
(-
(fma
z
(/ (fma z 0.0007936500793651 -0.0027777777777778) x)
0.91893853320467)
x)))))
double code(double x, double y, double z) {
double t_0 = x * log(x);
double tmp;
if (x <= 1.6e+131) {
tmp = fma(fma(z, fma((0.0007936500793651 + y), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), (t_0 - x));
} else {
tmp = t_0 + (fma(z, (fma(z, 0.0007936500793651, -0.0027777777777778) / x), 0.91893853320467) - x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(x * log(x)) tmp = 0.0 if (x <= 1.6e+131) tmp = fma(fma(z, fma(Float64(0.0007936500793651 + y), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / x), Float64(t_0 - x)); else tmp = Float64(t_0 + Float64(fma(z, Float64(fma(z, 0.0007936500793651, -0.0027777777777778) / x), 0.91893853320467) - x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.6e+131], N[(N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(z * N[(N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \log x\\
\mathbf{if}\;x \leq 1.6 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, t\_0 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \left(\mathsf{fma}\left(z, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}, 0.91893853320467\right) - x\right)\\
\end{array}
\end{array}
if x < 1.6000000000000001e131Initial program 97.6%
Applied egg-rr97.6%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6496.1
Simplified96.1%
if 1.6000000000000001e131 < x Initial program 71.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
Simplified86.5%
Taylor expanded in x around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6486.5
Simplified86.5%
Final simplification93.1%
(FPCore (x y z)
:precision binary64
(if (<= x 4.8e+29)
(+
(- 0.91893853320467 x)
(fma
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x)))
(+
(* x (log x))
(-
(fma
z
(/ (fma z 0.0007936500793651 -0.0027777777777778) x)
0.91893853320467)
x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+29) {
tmp = (0.91893853320467 - x) + fma(fma(z, (0.0007936500793651 + y), -0.0027777777777778), (z / x), (0.083333333333333 / x));
} else {
tmp = (x * log(x)) + (fma(z, (fma(z, 0.0007936500793651, -0.0027777777777778) / x), 0.91893853320467) - x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 4.8e+29) tmp = Float64(Float64(0.91893853320467 - x) + fma(fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x))); else tmp = Float64(Float64(x * log(x)) + Float64(fma(z, Float64(fma(z, 0.0007936500793651, -0.0027777777777778) / x), 0.91893853320467) - x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4.8e+29], N[(N[(0.91893853320467 - x), $MachinePrecision] + N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.8 \cdot 10^{+29}:\\
\;\;\;\;\left(0.91893853320467 - x\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log x + \left(\mathsf{fma}\left(z, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}, 0.91893853320467\right) - x\right)\\
\end{array}
\end{array}
if x < 4.8000000000000002e29Initial program 98.9%
Taylor expanded in y around inf
Simplified90.1%
Taylor expanded in z around 0
Simplified99.7%
Taylor expanded in x around 0
lower-/.f6495.8
Simplified95.8%
if 4.8000000000000002e29 < x Initial program 80.5%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
Simplified85.5%
Taylor expanded in x around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6485.5
Simplified85.5%
Final simplification90.6%
(FPCore (x y z)
:precision binary64
(if (<= x 1.46e+100)
(+
(- 0.91893853320467 x)
(fma
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x)))
(fma x (log x) (- x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.46e+100) {
tmp = (0.91893853320467 - x) + fma(fma(z, (0.0007936500793651 + y), -0.0027777777777778), (z / x), (0.083333333333333 / x));
} else {
tmp = fma(x, log(x), -x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.46e+100) tmp = Float64(Float64(0.91893853320467 - x) + fma(fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x))); else tmp = fma(x, log(x), Float64(-x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.46e+100], N[(N[(0.91893853320467 - x), $MachinePrecision] + N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.46 \cdot 10^{+100}:\\
\;\;\;\;\left(0.91893853320467 - x\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log x, -x\right)\\
\end{array}
\end{array}
if x < 1.46e100Initial program 98.0%
Taylor expanded in y around inf
Simplified90.3%
Taylor expanded in z around 0
Simplified99.6%
Taylor expanded in x around 0
lower-/.f6488.3
Simplified88.3%
if 1.46e100 < x Initial program 76.0%
Taylor expanded in x around inf
sub-negN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
metadata-evalN/A
distribute-rgt-inN/A
neg-mul-1N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-neg.f6475.9
Simplified75.9%
Final simplification83.6%
(FPCore (x y z)
:precision binary64
(if (<= x 1.46e+100)
(+
(- 0.91893853320467 x)
(fma
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x)))
(- (* x (log x)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.46e+100) {
tmp = (0.91893853320467 - x) + fma(fma(z, (0.0007936500793651 + y), -0.0027777777777778), (z / x), (0.083333333333333 / x));
} else {
tmp = (x * log(x)) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.46e+100) tmp = Float64(Float64(0.91893853320467 - x) + fma(fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x))); else tmp = Float64(Float64(x * log(x)) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.46e+100], N[(N[(0.91893853320467 - x), $MachinePrecision] + N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.46 \cdot 10^{+100}:\\
\;\;\;\;\left(0.91893853320467 - x\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log x - x\\
\end{array}
\end{array}
if x < 1.46e100Initial program 98.0%
Taylor expanded in y around inf
Simplified90.3%
Taylor expanded in z around 0
Simplified99.6%
Taylor expanded in x around 0
lower-/.f6488.3
Simplified88.3%
if 1.46e100 < x Initial program 76.0%
Taylor expanded in y around inf
Simplified91.3%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6475.8
Simplified75.8%
Final simplification83.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))))
(if (<= t_0 -2e+53)
(* y (* z (/ z x)))
(if (<= t_0 5e+14)
(/
(fma
z
(fma z 0.0007936500793651 -0.0027777777777778)
0.083333333333333)
x)
(* (+ 0.0007936500793651 y) (/ (* z z) x))))))
double code(double x, double y, double z) {
double t_0 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_0 <= -2e+53) {
tmp = y * (z * (z / x));
} else if (t_0 <= 5e+14) {
tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = (0.0007936500793651 + y) * ((z * z) / x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) tmp = 0.0 if (t_0 <= -2e+53) tmp = Float64(y * Float64(z * Float64(z / x))); elseif (t_0 <= 5e+14) tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(Float64(0.0007936500793651 + y) * Float64(Float64(z * z) / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+53], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+14], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+14}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -2e53Initial program 79.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6474.5
Simplified74.5%
associate-*l/N/A
lift-/.f64N/A
lower-*.f6474.6
Applied egg-rr74.6%
if -2e53 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 5e14Initial program 99.4%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
Simplified98.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6446.8
Simplified46.8%
if 5e14 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 83.0%
Taylor expanded in y around inf
Simplified83.7%
Taylor expanded in z around 0
Simplified99.8%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6473.3
Simplified73.3%
Final simplification62.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))))
(if (<= t_0 -2e+53)
(* y (* z (/ z x)))
(if (<= t_0 0.2)
(/ 1.0 (* x 12.000000000000048))
(* z (/ (* z 0.0007936500793651) x))))))
double code(double x, double y, double z) {
double t_0 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_0 <= -2e+53) {
tmp = y * (z * (z / x));
} else if (t_0 <= 0.2) {
tmp = 1.0 / (x * 12.000000000000048);
} else {
tmp = z * ((z * 0.0007936500793651) / 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) :: t_0
real(8) :: tmp
t_0 = 0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))
if (t_0 <= (-2d+53)) then
tmp = y * (z * (z / x))
else if (t_0 <= 0.2d0) then
tmp = 1.0d0 / (x * 12.000000000000048d0)
else
tmp = z * ((z * 0.0007936500793651d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_0 <= -2e+53) {
tmp = y * (z * (z / x));
} else if (t_0 <= 0.2) {
tmp = 1.0 / (x * 12.000000000000048);
} else {
tmp = z * ((z * 0.0007936500793651) / x);
}
return tmp;
}
def code(x, y, z): t_0 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0 if t_0 <= -2e+53: tmp = y * (z * (z / x)) elif t_0 <= 0.2: tmp = 1.0 / (x * 12.000000000000048) else: tmp = z * ((z * 0.0007936500793651) / x) return tmp
function code(x, y, z) t_0 = Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) tmp = 0.0 if (t_0 <= -2e+53) tmp = Float64(y * Float64(z * Float64(z / x))); elseif (t_0 <= 0.2) tmp = Float64(1.0 / Float64(x * 12.000000000000048)); else tmp = Float64(z * Float64(Float64(z * 0.0007936500793651) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)); tmp = 0.0; if (t_0 <= -2e+53) tmp = y * (z * (z / x)); elseif (t_0 <= 0.2) tmp = 1.0 / (x * 12.000000000000048); else tmp = z * ((z * 0.0007936500793651) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+53], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.2], N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 0.2:\\
\;\;\;\;\frac{1}{x \cdot 12.000000000000048}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{z \cdot 0.0007936500793651}{x}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -2e53Initial program 79.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6474.5
Simplified74.5%
associate-*l/N/A
lift-/.f64N/A
lower-*.f6474.6
Applied egg-rr74.6%
if -2e53 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.20000000000000001Initial program 99.4%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6498.5
Simplified98.5%
Taylor expanded in x around 0
lower-/.f6446.9
Simplified46.9%
clear-numN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval46.9
Applied egg-rr46.9%
if 0.20000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 83.8%
Taylor expanded in y around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
Simplified84.9%
Taylor expanded in z around inf
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6462.3
Simplified62.3%
Final simplification58.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z (/ z x))))
(t_1
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))))
(if (<= t_1 -2e+53)
t_0
(if (<= t_1 5e+14) (/ 1.0 (* x 12.000000000000048)) t_0))))
double code(double x, double y, double z) {
double t_0 = y * (z * (z / x));
double t_1 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_1 <= -2e+53) {
tmp = t_0;
} else if (t_1 <= 5e+14) {
tmp = 1.0 / (x * 12.000000000000048);
} else {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * (z * (z / x))
t_1 = 0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))
if (t_1 <= (-2d+53)) then
tmp = t_0
else if (t_1 <= 5d+14) then
tmp = 1.0d0 / (x * 12.000000000000048d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * (z / x));
double t_1 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_1 <= -2e+53) {
tmp = t_0;
} else if (t_1 <= 5e+14) {
tmp = 1.0 / (x * 12.000000000000048);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * (z / x)) t_1 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0 if t_1 <= -2e+53: tmp = t_0 elif t_1 <= 5e+14: tmp = 1.0 / (x * 12.000000000000048) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * Float64(z / x))) t_1 = Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) tmp = 0.0 if (t_1 <= -2e+53) tmp = t_0; elseif (t_1 <= 5e+14) tmp = Float64(1.0 / Float64(x * 12.000000000000048)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * (z / x)); t_1 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)); tmp = 0.0; if (t_1 <= -2e+53) tmp = t_0; elseif (t_1 <= 5e+14) tmp = 1.0 / (x * 12.000000000000048); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+53], t$95$0, If[LessEqual[t$95$1, 5e+14], N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot \frac{z}{x}\right)\\
t_1 := 0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+14}:\\
\;\;\;\;\frac{1}{x \cdot 12.000000000000048}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -2e53 or 5e14 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 82.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6456.5
Simplified56.5%
associate-*l/N/A
lift-/.f64N/A
lower-*.f6457.0
Applied egg-rr57.0%
if -2e53 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 5e14Initial program 99.4%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6496.9
Simplified96.9%
Taylor expanded in x around 0
lower-/.f6445.0
Simplified45.0%
clear-numN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval45.1
Applied egg-rr45.1%
Final simplification51.8%
(FPCore (x y z) :precision binary64 (+ (- 0.91893853320467 x) (fma (fma z (+ 0.0007936500793651 y) -0.0027777777777778) (/ z x) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
return (0.91893853320467 - x) + fma(fma(z, (0.0007936500793651 + y), -0.0027777777777778), (z / x), (0.083333333333333 / x));
}
function code(x, y, z) return Float64(Float64(0.91893853320467 - x) + fma(fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x))) end
code[x_, y_, z_] := N[(N[(0.91893853320467 - x), $MachinePrecision] + N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 - x\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)
\end{array}
Initial program 89.6%
Taylor expanded in y around inf
Simplified90.7%
Taylor expanded in z around 0
Simplified99.3%
Taylor expanded in x around 0
lower-/.f6463.6
Simplified63.6%
Final simplification63.6%
(FPCore (x y z)
:precision binary64
(if (<= x 650.0)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(* z (* z (* (+ 0.0007936500793651 y) (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 650.0) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = z * (z * ((0.0007936500793651 + y) * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 650.0) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 650.0], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 650:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{1}{x}\right)\right)\\
\end{array}
\end{array}
if x < 650Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6497.2
Simplified97.2%
if 650 < x Initial program 81.5%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6433.9
Simplified33.9%
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.8
lift-+.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-+.f6438.8
Applied egg-rr38.8%
Final simplification64.8%
(FPCore (x y z) :precision binary64 (/ (fma z (fma z (+ 0.0007936500793651 y) -0.0027777777777778) 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}
\end{array}
Initial program 89.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6460.9
Simplified60.9%
(FPCore (x y z) :precision binary64 (/ 1.0 (* x 12.000000000000048)))
double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / (x * 12.000000000000048d0)
end function
public static double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
def code(x, y, z): return 1.0 / (x * 12.000000000000048)
function code(x, y, z) return Float64(1.0 / Float64(x * 12.000000000000048)) end
function tmp = code(x, y, z) tmp = 1.0 / (x * 12.000000000000048); end
code[x_, y_, z_] := N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot 12.000000000000048}
\end{array}
Initial program 89.6%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6456.1
Simplified56.1%
Taylor expanded in x around 0
lower-/.f6421.3
Simplified21.3%
clear-numN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval21.3
Applied egg-rr21.3%
(FPCore (x y z) :precision binary64 (* 0.083333333333333 (/ 1.0 x)))
double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / 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 * (1.0d0 / x)
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / x);
}
def code(x, y, z): return 0.083333333333333 * (1.0 / x)
function code(x, y, z) return Float64(0.083333333333333 * Float64(1.0 / x)) end
function tmp = code(x, y, z) tmp = 0.083333333333333 * (1.0 / x); end
code[x_, y_, z_] := N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x}
\end{array}
Initial program 89.6%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6456.1
Simplified56.1%
Taylor expanded in x around 0
lower-/.f6421.3
Simplified21.3%
metadata-evalN/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6421.3
Applied egg-rr21.3%
Final simplification21.3%
(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 89.6%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6456.1
Simplified56.1%
Taylor expanded in x around 0
lower-/.f6421.3
Simplified21.3%
(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 2024207
(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)))