
(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 21 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 5e+88)
(+
(fma (* x (- 1.0 (/ 0.5 x))) (log x) (- 0.91893853320467 x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (* z (+ y 0.0007936500793651)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+88) {
tmp = fma((x * (1.0 - (0.5 / x))), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (y + 0.0007936500793651)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5e+88) tmp = Float64(fma(Float64(x * Float64(1.0 - Float64(0.5 / x))), log(x), Float64(0.91893853320467 - x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5e+88], N[(N[(N[(x * N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $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[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot \left(1 - \frac{0.5}{x}\right), \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\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(y + 0.0007936500793651\right)}{x}\\
\end{array}
\end{array}
if x < 4.99999999999999997e88Initial program 99.6%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6499.7
Applied rewrites99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.7
Applied rewrites99.7%
if 4.99999999999999997e88 < x Initial program 84.7%
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-+.f6497.5
Applied rewrites97.5%
Final simplification98.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(t_1 (fma x (log x) (- x))))
(if (<= t_0 -1e+42)
(+ t_1 (/ (* y (* z z)) x))
(if (<= t_0 4e+274)
(+
t_1
(/
(fma
z
(fma z 0.0007936500793651 -0.0027777777777778)
0.083333333333333)
x))
(fma
z
(*
(fma
-0.0069444444444443885
(/ (fma y 144.00000000000117 0.12761894476190902) x)
(/ 9.259259259259444e-5 x))
(- z))
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = fma(x, log(x), -x);
double tmp;
if (t_0 <= -1e+42) {
tmp = t_1 + ((y * (z * z)) / x);
} else if (t_0 <= 4e+274) {
tmp = t_1 + (fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = fma(z, (fma(-0.0069444444444443885, (fma(y, 144.00000000000117, 0.12761894476190902) / x), (9.259259259259444e-5 / x)) * -z), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) t_1 = fma(x, log(x), Float64(-x)) tmp = 0.0 if (t_0 <= -1e+42) tmp = Float64(t_1 + Float64(Float64(y * Float64(z * z)) / x)); elseif (t_0 <= 4e+274) tmp = Float64(t_1 + Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x)); else tmp = fma(z, Float64(fma(-0.0069444444444443885, Float64(fma(y, 144.00000000000117, 0.12761894476190902) / x), Float64(9.259259259259444e-5 / x)) * Float64(-z)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+42], N[(t$95$1 + N[(N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+274], N[(t$95$1 + N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(-0.0069444444444443885 * N[(N[(y * 144.00000000000117 + 0.12761894476190902), $MachinePrecision] / x), $MachinePrecision] + N[(9.259259259259444e-5 / x), $MachinePrecision]), $MachinePrecision] * (-z)), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
t_1 := \mathsf{fma}\left(x, \log x, -x\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+42}:\\
\;\;\;\;t\_1 + \frac{y \cdot \left(z \cdot z\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+274}:\\
\;\;\;\;t\_1 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(-0.0069444444444443885, \frac{\mathsf{fma}\left(y, 144.00000000000117, 0.12761894476190902\right)}{x}, \frac{9.259259259259444 \cdot 10^{-5}}{x}\right) \cdot \left(-z\right), \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.00000000000000004e42Initial program 89.2%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6489.2
Applied rewrites89.2%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f64N/A
lower-neg.f6489.2
Applied rewrites89.2%
Taylor expanded in y around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6489.2
Applied rewrites89.2%
if -1.00000000000000004e42 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 3.99999999999999969e274Initial program 99.3%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6497.1
Applied rewrites97.1%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f64N/A
lower-neg.f6495.7
Applied rewrites95.7%
if 3.99999999999999969e274 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 84.0%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites2.0%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites2.0%
Taylor expanded in z around 0
Applied rewrites91.7%
Taylor expanded in z around -inf
Applied rewrites91.8%
Final simplification93.6%
(FPCore (x y z)
:precision binary64
(if (<= x 5e+88)
(+
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)
(fma (+ x -0.5) (log x) (- 0.91893853320467 x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (* z (+ y 0.0007936500793651)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+88) {
tmp = (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma((x + -0.5), log(x), (0.91893853320467 - x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (y + 0.0007936500793651)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5e+88) tmp = Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5e+88], N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $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[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+88}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} + \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\
\end{array}
\end{array}
if x < 4.99999999999999997e88Initial program 99.6%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6499.7
Applied rewrites99.7%
if 4.99999999999999997e88 < x Initial program 84.7%
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-+.f6497.5
Applied rewrites97.5%
Final simplification98.8%
(FPCore (x y z)
:precision binary64
(if (<= x 0.035)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (* z (+ y 0.0007936500793651)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.035) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (y + 0.0007936500793651)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.035) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.035], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $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[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.035:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\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(y + 0.0007936500793651\right)}{x}\\
\end{array}
\end{array}
if x < 0.035000000000000003Initial 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-+.f6498.4
Applied rewrites98.4%
if 0.035000000000000003 < x Initial program 89.2%
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.0
Applied rewrites98.0%
Final simplification98.2%
(FPCore (x y z)
:precision binary64
(if (<= x 2.25e+41)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(if (<= x 1.35e+207)
(+ (fma x (log x) (- x)) (/ (* y (* z z)) x))
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.25e+41) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else if (x <= 1.35e+207) {
tmp = fma(x, log(x), -x) + ((y * (z * z)) / x);
} else {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (0.083333333333333 / x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.25e+41) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); elseif (x <= 1.35e+207) tmp = Float64(fma(x, log(x), Float64(-x)) + Float64(Float64(y * Float64(z * z)) / x)); else tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.25e+41], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1.35e+207], N[(N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + N[(N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.25 \cdot 10^{+41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+207}:\\
\;\;\;\;\mathsf{fma}\left(x, \log x, -x\right) + \frac{y \cdot \left(z \cdot z\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 2.2500000000000001e41Initial 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-+.f6494.9
Applied rewrites94.9%
if 2.2500000000000001e41 < x < 1.35000000000000012e207Initial program 92.1%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6492.3
Applied rewrites92.3%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f64N/A
lower-neg.f6492.3
Applied rewrites92.3%
Taylor expanded in y around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6488.5
Applied rewrites88.5%
if 1.35000000000000012e207 < x Initial program 78.6%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6478.8
Applied rewrites78.8%
Taylor expanded in z around 0
Applied rewrites88.4%
Final simplification91.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fma x (log x) (- x))))
(if (<= x 1e+94)
(+
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)
t_0)
(+ t_0 (* (* z z) (/ (+ y 0.0007936500793651) x))))))
double code(double x, double y, double z) {
double t_0 = fma(x, log(x), -x);
double tmp;
if (x <= 1e+94) {
tmp = (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + ((z * z) * ((y + 0.0007936500793651) / x));
}
return tmp;
}
function code(x, y, z) t_0 = fma(x, log(x), Float64(-x)) tmp = 0.0 if (x <= 1e+94) tmp = Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + t_0); else tmp = Float64(t_0 + Float64(Float64(z * z) * Float64(Float64(y + 0.0007936500793651) / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]}, If[LessEqual[x, 1e+94], N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(N[(z * z), $MachinePrecision] * N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x, \log x, -x\right)\\
\mathbf{if}\;x \leq 10^{+94}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \left(z \cdot z\right) \cdot \frac{y + 0.0007936500793651}{x}\\
\end{array}
\end{array}
if x < 1e94Initial program 99.0%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6499.1
Applied rewrites99.1%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f64N/A
lower-neg.f6497.6
Applied rewrites97.6%
if 1e94 < x Initial program 85.4%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6485.6
Applied rewrites85.6%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f64N/A
lower-neg.f6485.6
Applied rewrites85.6%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6493.8
Applied rewrites93.8%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (<= x 1.0)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(+ (fma x (log x) (- x)) (* (* z z) (/ (+ y 0.0007936500793651) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(x, log(x), -x) + ((z * z) * ((y + 0.0007936500793651) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(fma(x, log(x), Float64(-x)) + Float64(Float64(z * z) * Float64(Float64(y + 0.0007936500793651) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] * N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log x, -x\right) + \left(z \cdot z\right) \cdot \frac{y + 0.0007936500793651}{x}\\
\end{array}
\end{array}
if x < 1Initial 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-+.f6498.4
Applied rewrites98.4%
if 1 < x Initial program 89.2%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6489.4
Applied rewrites89.4%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f64N/A
lower-neg.f6488.7
Applied rewrites88.7%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6494.3
Applied rewrites94.3%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (<= z -5e+85)
(fma
z
(*
(fma
-0.0069444444444443885
(/ (fma y 144.00000000000117 0.12761894476190902) x)
(/ 9.259259259259444e-5 x))
(- z))
(/ 0.083333333333333 x))
(if (<= z 7.8e+24)
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/ 0.083333333333333 x))
(fma
z
(/
(*
z
(fma
-0.0069444444444443885
(fma y 144.00000000000117 0.12761894476190902)
9.259259259259444e-5))
(- x))
(/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5e+85) {
tmp = fma(z, (fma(-0.0069444444444443885, (fma(y, 144.00000000000117, 0.12761894476190902) / x), (9.259259259259444e-5 / x)) * -z), (0.083333333333333 / x));
} else if (z <= 7.8e+24) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (0.083333333333333 / x);
} else {
tmp = fma(z, ((z * fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.12761894476190902), 9.259259259259444e-5)) / -x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -5e+85) tmp = fma(z, Float64(fma(-0.0069444444444443885, Float64(fma(y, 144.00000000000117, 0.12761894476190902) / x), Float64(9.259259259259444e-5 / x)) * Float64(-z)), Float64(0.083333333333333 / x)); elseif (z <= 7.8e+24) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)); else tmp = fma(z, Float64(Float64(z * fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.12761894476190902), 9.259259259259444e-5)) / Float64(-x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -5e+85], N[(z * N[(N[(-0.0069444444444443885 * N[(N[(y * 144.00000000000117 + 0.12761894476190902), $MachinePrecision] / x), $MachinePrecision] + N[(9.259259259259444e-5 / x), $MachinePrecision]), $MachinePrecision] * (-z)), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+24], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(z * N[(-0.0069444444444443885 * N[(y * 144.00000000000117 + 0.12761894476190902), $MachinePrecision] + 9.259259259259444e-5), $MachinePrecision]), $MachinePrecision] / (-x)), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(-0.0069444444444443885, \frac{\mathsf{fma}\left(y, 144.00000000000117, 0.12761894476190902\right)}{x}, \frac{9.259259259259444 \cdot 10^{-5}}{x}\right) \cdot \left(-z\right), \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{z \cdot \mathsf{fma}\left(-0.0069444444444443885, \mathsf{fma}\left(y, 144.00000000000117, 0.12761894476190902\right), 9.259259259259444 \cdot 10^{-5}\right)}{-x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if z < -5.0000000000000001e85Initial program 84.7%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites12.9%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites21.5%
Taylor expanded in z around 0
Applied rewrites86.5%
Taylor expanded in z around -inf
Applied rewrites86.6%
if -5.0000000000000001e85 < z < 7.7999999999999995e24Initial program 97.9%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-evalN/A
lower-+.f64N/A
lower-neg.f6498.1
Applied rewrites98.1%
Taylor expanded in z around 0
Applied rewrites91.2%
if 7.7999999999999995e24 < z Initial program 92.0%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites7.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites11.2%
Taylor expanded in z around 0
Applied rewrites87.5%
Taylor expanded in z around inf
Applied rewrites87.5%
Final simplification89.4%
(FPCore (x y z)
:precision binary64
(if (<= z -5e+85)
(fma
z
(*
(fma
-0.0069444444444443885
(/ (fma y 144.00000000000117 0.12761894476190902) x)
(/ 9.259259259259444e-5 x))
(- z))
(/ 0.083333333333333 x))
(if (<= z 7.8e+24)
(+
(- 0.91893853320467 x)
(fma (log x) (+ x -0.5) (/ 0.083333333333333 x)))
(fma
z
(/
(*
z
(fma
-0.0069444444444443885
(fma y 144.00000000000117 0.12761894476190902)
9.259259259259444e-5))
(- x))
(/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5e+85) {
tmp = fma(z, (fma(-0.0069444444444443885, (fma(y, 144.00000000000117, 0.12761894476190902) / x), (9.259259259259444e-5 / x)) * -z), (0.083333333333333 / x));
} else if (z <= 7.8e+24) {
tmp = (0.91893853320467 - x) + fma(log(x), (x + -0.5), (0.083333333333333 / x));
} else {
tmp = fma(z, ((z * fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.12761894476190902), 9.259259259259444e-5)) / -x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -5e+85) tmp = fma(z, Float64(fma(-0.0069444444444443885, Float64(fma(y, 144.00000000000117, 0.12761894476190902) / x), Float64(9.259259259259444e-5 / x)) * Float64(-z)), Float64(0.083333333333333 / x)); elseif (z <= 7.8e+24) tmp = Float64(Float64(0.91893853320467 - x) + fma(log(x), Float64(x + -0.5), Float64(0.083333333333333 / x))); else tmp = fma(z, Float64(Float64(z * fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.12761894476190902), 9.259259259259444e-5)) / Float64(-x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -5e+85], N[(z * N[(N[(-0.0069444444444443885 * N[(N[(y * 144.00000000000117 + 0.12761894476190902), $MachinePrecision] / x), $MachinePrecision] + N[(9.259259259259444e-5 / x), $MachinePrecision]), $MachinePrecision] * (-z)), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+24], 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[(N[(z * N[(-0.0069444444444443885 * N[(y * 144.00000000000117 + 0.12761894476190902), $MachinePrecision] + 9.259259259259444e-5), $MachinePrecision]), $MachinePrecision] / (-x)), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(-0.0069444444444443885, \frac{\mathsf{fma}\left(y, 144.00000000000117, 0.12761894476190902\right)}{x}, \frac{9.259259259259444 \cdot 10^{-5}}{x}\right) \cdot \left(-z\right), \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+24}:\\
\;\;\;\;\left(0.91893853320467 - x\right) + \mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{z \cdot \mathsf{fma}\left(-0.0069444444444443885, \mathsf{fma}\left(y, 144.00000000000117, 0.12761894476190902\right), 9.259259259259444 \cdot 10^{-5}\right)}{-x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if z < -5.0000000000000001e85Initial program 84.7%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites12.9%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites21.5%
Taylor expanded in z around 0
Applied rewrites86.5%
Taylor expanded in z around -inf
Applied rewrites86.6%
if -5.0000000000000001e85 < z < 7.7999999999999995e24Initial program 97.9%
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--.f6491.0
Applied rewrites91.0%
if 7.7999999999999995e24 < z Initial program 92.0%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites7.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites11.2%
Taylor expanded in z around 0
Applied rewrites87.5%
Taylor expanded in z around inf
Applied rewrites87.5%
Final simplification89.3%
(FPCore (x y z)
:precision binary64
(if (<= x 2.5e+71)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(fma x (log x) (- x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.5e+71) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(x, log(x), -x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.5e+71) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = fma(x, log(x), Float64(-x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.5e+71], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5 \cdot 10^{+71}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log x, -x\right)\\
\end{array}
\end{array}
if x < 2.49999999999999986e71Initial 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-+.f6493.3
Applied rewrites93.3%
if 2.49999999999999986e71 < x Initial program 86.2%
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.f6476.9
Applied rewrites76.9%
Final simplification86.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))))
(if (<= t_0 -1e+42)
(* y (/ (* z z) x))
(if (<= t_0 0.1)
(/ (fma z -0.0027777777777778 0.083333333333333) x)
(* (* z z) (/ (+ y 0.0007936500793651) x))))))
double code(double x, double y, double z) {
double t_0 = 0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
double tmp;
if (t_0 <= -1e+42) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 0.1) {
tmp = fma(z, -0.0027777777777778, 0.083333333333333) / x;
} else {
tmp = (z * z) * ((y + 0.0007936500793651) / x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) tmp = 0.0 if (t_0 <= -1e+42) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 0.1) tmp = Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x); else tmp = Float64(Float64(z * z) * Float64(Float64(y + 0.0007936500793651) / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+42], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.1], N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{y + 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)) < -1.00000000000000004e42Initial program 89.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6482.6
Applied rewrites82.6%
if -1.00000000000000004e42 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 99.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites49.3%
Taylor expanded in z around 0
Applied rewrites48.9%
if 0.10000000000000001 < (+.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 90.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites21.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites19.4%
Applied rewrites15.9%
Taylor expanded in z around inf
Applied rewrites70.1%
Final simplification63.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 -1e+42)
(* y (/ (* z z) x))
(if (<= t_0 5e-5)
(/ (fma z -0.0027777777777778 0.083333333333333) x)
(/ (* (+ y 0.0007936500793651) (* z z)) x)))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -1e+42) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e-5) {
tmp = fma(z, -0.0027777777777778, 0.083333333333333) / x;
} else {
tmp = ((y + 0.0007936500793651) * (z * z)) / x;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -1e+42) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 5e-5) tmp = Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z * z)) / x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+42], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-5], N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.00000000000000004e42Initial program 89.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6482.6
Applied rewrites82.6%
if -1.00000000000000004e42 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.00000000000000024e-5Initial program 99.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites49.3%
Taylor expanded in z around 0
Applied rewrites48.9%
if 5.00000000000000024e-5 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 90.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites21.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites19.4%
Taylor expanded in z around inf
Applied rewrites69.0%
Final simplification62.7%
(FPCore (x y z)
:precision binary64
(if (<= x 5.3e+70)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(fma
z
(fma
z
(/
(fma
-0.0069444444444443885
(+ 0.013333333333333707 (fma 144.00000000000117 y 0.11428561142857531))
9.259259259259444e-5)
(- x))
(/ -0.0027777777777778 x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.3e+70) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(z, fma(z, (fma(-0.0069444444444443885, (0.013333333333333707 + fma(144.00000000000117, y, 0.11428561142857531)), 9.259259259259444e-5) / -x), (-0.0027777777777778 / x)), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5.3e+70) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = fma(z, fma(z, Float64(fma(-0.0069444444444443885, Float64(0.013333333333333707 + fma(144.00000000000117, y, 0.11428561142857531)), 9.259259259259444e-5) / Float64(-x)), Float64(-0.0027777777777778 / x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5.3e+70], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(z * N[(N[(-0.0069444444444443885 * N[(0.013333333333333707 + N[(144.00000000000117 * y + 0.11428561142857531), $MachinePrecision]), $MachinePrecision] + 9.259259259259444e-5), $MachinePrecision] / (-x)), $MachinePrecision] + N[(-0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.3 \cdot 10^{+70}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{\mathsf{fma}\left(-0.0069444444444443885, 0.013333333333333707 + \mathsf{fma}\left(144.00000000000117, y, 0.11428561142857531\right), 9.259259259259444 \cdot 10^{-5}\right)}{-x}, \frac{-0.0027777777777778}{x}\right), \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 5.3e70Initial 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-+.f6493.2
Applied rewrites93.2%
if 5.3e70 < x Initial program 86.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites56.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites2.9%
Taylor expanded in z around 0
Applied rewrites26.0%
Final simplification64.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 -1e+42)
(* y (/ (* z z) x))
(if (<= t_0 1e+97) (/ 1.0 (/ x 0.083333333333333)) (* y (* z (/ z x)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -1e+42) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 1e+97) {
tmp = 1.0 / (x / 0.083333333333333);
} else {
tmp = y * (z * (z / 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 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
if (t_0 <= (-1d+42)) then
tmp = y * ((z * z) / x)
else if (t_0 <= 1d+97) then
tmp = 1.0d0 / (x / 0.083333333333333d0)
else
tmp = y * (z * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -1e+42) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 1e+97) {
tmp = 1.0 / (x / 0.083333333333333);
} else {
tmp = y * (z * (z / x));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if t_0 <= -1e+42: tmp = y * ((z * z) / x) elif t_0 <= 1e+97: tmp = 1.0 / (x / 0.083333333333333) else: tmp = y * (z * (z / x)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -1e+42) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 1e+97) tmp = Float64(1.0 / Float64(x / 0.083333333333333)); else tmp = Float64(y * Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -1e+42) tmp = y * ((z * z) / x); elseif (t_0 <= 1e+97) tmp = 1.0 / (x / 0.083333333333333); else tmp = y * (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+42], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+97], N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+97}:\\
\;\;\;\;\frac{1}{\frac{x}{0.083333333333333}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.00000000000000004e42Initial program 89.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6482.6
Applied rewrites82.6%
if -1.00000000000000004e42 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1.0000000000000001e97Initial program 99.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites47.5%
Taylor expanded in z around 0
Applied rewrites43.8%
Applied rewrites43.9%
if 1.0000000000000001e97 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 88.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6450.8
Applied rewrites50.8%
Applied rewrites50.8%
Final simplification53.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 -1e+42)
(* y (/ (* z z) x))
(if (<= t_0 1e+97) (/ 0.083333333333333 x) (* y (* z (/ z x)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -1e+42) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 1e+97) {
tmp = 0.083333333333333 / x;
} else {
tmp = y * (z * (z / 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 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
if (t_0 <= (-1d+42)) then
tmp = y * ((z * z) / x)
else if (t_0 <= 1d+97) then
tmp = 0.083333333333333d0 / x
else
tmp = y * (z * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -1e+42) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 1e+97) {
tmp = 0.083333333333333 / x;
} else {
tmp = y * (z * (z / x));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if t_0 <= -1e+42: tmp = y * ((z * z) / x) elif t_0 <= 1e+97: tmp = 0.083333333333333 / x else: tmp = y * (z * (z / x)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -1e+42) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 1e+97) tmp = Float64(0.083333333333333 / x); else tmp = Float64(y * Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -1e+42) tmp = y * ((z * z) / x); elseif (t_0 <= 1e+97) tmp = 0.083333333333333 / x; else tmp = y * (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+42], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+97], N[(0.083333333333333 / x), $MachinePrecision], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+97}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.00000000000000004e42Initial program 89.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6482.6
Applied rewrites82.6%
if -1.00000000000000004e42 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1.0000000000000001e97Initial program 99.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites47.5%
Taylor expanded in z around 0
Applied rewrites43.8%
if 1.0000000000000001e97 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 88.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6450.8
Applied rewrites50.8%
Applied rewrites50.8%
Final simplification53.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(t_1 (* y (* z (/ z x)))))
(if (<= t_0 -1e+42) t_1 (if (<= t_0 1e+97) (/ 0.083333333333333 x) t_1))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = y * (z * (z / x));
double tmp;
if (t_0 <= -1e+42) {
tmp = t_1;
} else if (t_0 <= 1e+97) {
tmp = 0.083333333333333 / x;
} else {
tmp = t_1;
}
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 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
t_1 = y * (z * (z / x))
if (t_0 <= (-1d+42)) then
tmp = t_1
else if (t_0 <= 1d+97) then
tmp = 0.083333333333333d0 / x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = y * (z * (z / x));
double tmp;
if (t_0 <= -1e+42) {
tmp = t_1;
} else if (t_0 <= 1e+97) {
tmp = 0.083333333333333 / x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) t_1 = y * (z * (z / x)) tmp = 0 if t_0 <= -1e+42: tmp = t_1 elif t_0 <= 1e+97: tmp = 0.083333333333333 / x else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) t_1 = Float64(y * Float64(z * Float64(z / x))) tmp = 0.0 if (t_0 <= -1e+42) tmp = t_1; elseif (t_0 <= 1e+97) tmp = Float64(0.083333333333333 / x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); t_1 = y * (z * (z / x)); tmp = 0.0; if (t_0 <= -1e+42) tmp = t_1; elseif (t_0 <= 1e+97) tmp = 0.083333333333333 / x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+42], t$95$1, If[LessEqual[t$95$0, 1e+97], N[(0.083333333333333 / x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
t_1 := y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+97}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1.00000000000000004e42 or 1.0000000000000001e97 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 88.9%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6462.1
Applied rewrites62.1%
Applied rewrites62.1%
if -1.00000000000000004e42 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1.0000000000000001e97Initial program 99.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites47.5%
Taylor expanded in z around 0
Applied rewrites43.8%
Final simplification53.1%
(FPCore (x y z)
:precision binary64
(if (<= x 5.3e+70)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(fma
z
(*
(fma
-0.0069444444444443885
(/ (fma y 144.00000000000117 0.12761894476190902) x)
(/ 9.259259259259444e-5 x))
(- z))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.3e+70) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(z, (fma(-0.0069444444444443885, (fma(y, 144.00000000000117, 0.12761894476190902) / x), (9.259259259259444e-5 / x)) * -z), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5.3e+70) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = fma(z, Float64(fma(-0.0069444444444443885, Float64(fma(y, 144.00000000000117, 0.12761894476190902) / x), Float64(9.259259259259444e-5 / x)) * Float64(-z)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5.3e+70], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(N[(-0.0069444444444443885 * N[(N[(y * 144.00000000000117 + 0.12761894476190902), $MachinePrecision] / x), $MachinePrecision] + N[(9.259259259259444e-5 / x), $MachinePrecision]), $MachinePrecision] * (-z)), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.3 \cdot 10^{+70}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(-0.0069444444444443885, \frac{\mathsf{fma}\left(y, 144.00000000000117, 0.12761894476190902\right)}{x}, \frac{9.259259259259444 \cdot 10^{-5}}{x}\right) \cdot \left(-z\right), \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 5.3e70Initial 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-+.f6493.2
Applied rewrites93.2%
if 5.3e70 < x Initial program 86.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites56.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites2.9%
Taylor expanded in z around 0
Applied rewrites26.0%
Taylor expanded in z around -inf
Applied rewrites26.0%
Final simplification64.9%
(FPCore (x y z)
:precision binary64
(if (<= x 5.3e+70)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(fma
z
(/
(*
z
(fma
-0.0069444444444443885
(fma y 144.00000000000117 0.12761894476190902)
9.259259259259444e-5))
(- x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.3e+70) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(z, ((z * fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.12761894476190902), 9.259259259259444e-5)) / -x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5.3e+70) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = fma(z, Float64(Float64(z * fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.12761894476190902), 9.259259259259444e-5)) / Float64(-x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5.3e+70], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(N[(z * N[(-0.0069444444444443885 * N[(y * 144.00000000000117 + 0.12761894476190902), $MachinePrecision] + 9.259259259259444e-5), $MachinePrecision]), $MachinePrecision] / (-x)), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.3 \cdot 10^{+70}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{z \cdot \mathsf{fma}\left(-0.0069444444444443885, \mathsf{fma}\left(y, 144.00000000000117, 0.12761894476190902\right), 9.259259259259444 \cdot 10^{-5}\right)}{-x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 5.3e70Initial 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-+.f6493.2
Applied rewrites93.2%
if 5.3e70 < x Initial program 86.3%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites56.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites2.9%
Taylor expanded in z around 0
Applied rewrites26.0%
Taylor expanded in z around inf
Applied rewrites25.1%
Final simplification64.5%
(FPCore (x y z) :precision binary64 (/ (fma z (fma z (+ y 0.0007936500793651) -0.0027777777777778) 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}
\end{array}
Initial program 94.0%
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-+.f6462.7
Applied rewrites62.7%
Final simplification62.7%
(FPCore (x y z) :precision binary64 (/ (fma z -0.0027777777777778 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(z, -0.0027777777777778, 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}
\end{array}
Initial program 94.0%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites53.5%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites31.1%
Taylor expanded in z around 0
Applied rewrites29.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 94.0%
lift-/.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites53.5%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites31.1%
Taylor expanded in z around 0
Applied rewrites23.0%
(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 2024221
(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)))