
(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 19 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 920000.0)
(/
(fma
x
(+ 0.91893853320467 (- (fma (log x) (+ x -0.5) 0.0) x))
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
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 <= 920000.0) {
tmp = fma(x, (0.91893853320467 + (fma(log(x), (x + -0.5), 0.0) - x)), fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 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 <= 920000.0) tmp = Float64(fma(x, Float64(0.91893853320467 + Float64(fma(log(x), Float64(x + -0.5), 0.0) - x)), fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333)) / x); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 920000.0], N[(N[(x * N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + 0.0), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $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[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 920000:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 0.91893853320467 + \left(\mathsf{fma}\left(\log x, x + -0.5, 0\right) - x\right), \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 9.2e5Initial program 99.7%
Taylor expanded in x around 0
Simplified99.8%
if 9.2e5 < x Initial program 89.8%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6496.8
Simplified96.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.5
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))))
(if (<= t_0 -5e+150)
(* y (/ (* z z) x))
(if (<= t_0 5e+307)
(+
0.91893853320467
(+ (/ 0.083333333333333 x) (fma (log x) (+ x -0.5) (- 0.0 x))))
(fma
z
(fma
z
(/
(-
(- 0.0 9.259259259259444e-5)
(fma
-0.0069444444444443885
(fma y 144.00000000000117 0.11428561142857531)
-9.259259259259444e-5))
x)
(/ -0.0027777777777778 x))
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
double tmp;
if (t_0 <= -5e+150) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e+307) {
tmp = 0.91893853320467 + ((0.083333333333333 / x) + fma(log(x), (x + -0.5), (0.0 - x)));
} else {
tmp = fma(z, fma(z, (((0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), (-0.0027777777777778 / x)), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -5e+150) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 5e+307) tmp = Float64(0.91893853320467 + Float64(Float64(0.083333333333333 / x) + fma(log(x), Float64(x + -0.5), Float64(0.0 - x)))); else tmp = fma(z, fma(z, Float64(Float64(Float64(0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), Float64(-0.0027777777777778 / x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -5e+150], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+307], N[(0.91893853320467 + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(N[(0.0 - 9.259259259259444e-5), $MachinePrecision] - N[(-0.0069444444444443885 * N[(y * 144.00000000000117 + 0.11428561142857531), $MachinePrecision] + -9.259259259259444e-5), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(-0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+150}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;0.91893853320467 + \left(\frac{0.083333333333333}{x} + \mathsf{fma}\left(\log x, x + -0.5, 0 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{\left(0 - 9.259259259259444 \cdot 10^{-5}\right) - \mathsf{fma}\left(-0.0069444444444443885, \mathsf{fma}\left(y, 144.00000000000117, 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 (+.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)) < -5.00000000000000009e150Initial program 81.4%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6488.6
Simplified88.6%
if -5.00000000000000009e150 < (+.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)) < 5e307Initial program 99.5%
Taylor expanded in z around 0
Simplified89.1%
clear-numN/A
/-lowering-/.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-eval89.2
Applied egg-rr89.2%
+-commutativeN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
/-lowering-/.f64N/A
sub-negN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-sub0N/A
--lowering--.f6489.2
Applied egg-rr89.2%
if 5e307 < (+.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 89.1%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr18.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified17.0%
Taylor expanded in z around 0
Simplified94.8%
Final simplification90.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))))
(if (<= t_0 -5e+150)
(* y (/ (* z z) x))
(if (<= t_0 5e+307)
(+
0.91893853320467
(- (fma (+ x -0.5) (log x) (/ 0.083333333333333 x)) x))
(fma
z
(fma
z
(/
(-
(- 0.0 9.259259259259444e-5)
(fma
-0.0069444444444443885
(fma y 144.00000000000117 0.11428561142857531)
-9.259259259259444e-5))
x)
(/ -0.0027777777777778 x))
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
double tmp;
if (t_0 <= -5e+150) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e+307) {
tmp = 0.91893853320467 + (fma((x + -0.5), log(x), (0.083333333333333 / x)) - x);
} else {
tmp = fma(z, fma(z, (((0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), (-0.0027777777777778 / x)), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -5e+150) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 5e+307) tmp = Float64(0.91893853320467 + Float64(fma(Float64(x + -0.5), log(x), Float64(0.083333333333333 / x)) - x)); else tmp = fma(z, fma(z, Float64(Float64(Float64(0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), Float64(-0.0027777777777778 / x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -5e+150], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+307], N[(0.91893853320467 + N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(N[(0.0 - 9.259259259259444e-5), $MachinePrecision] - N[(-0.0069444444444443885 * N[(y * 144.00000000000117 + 0.11428561142857531), $MachinePrecision] + -9.259259259259444e-5), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(-0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+150}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;0.91893853320467 + \left(\mathsf{fma}\left(x + -0.5, \log x, \frac{0.083333333333333}{x}\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{\left(0 - 9.259259259259444 \cdot 10^{-5}\right) - \mathsf{fma}\left(-0.0069444444444443885, \mathsf{fma}\left(y, 144.00000000000117, 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 (+.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)) < -5.00000000000000009e150Initial program 81.4%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6488.6
Simplified88.6%
if -5.00000000000000009e150 < (+.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)) < 5e307Initial program 99.5%
+-commutativeN/A
div-invN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
sub-negN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
neg-sub0N/A
--lowering--.f6499.5
Applied egg-rr99.5%
Taylor expanded in z around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-commutativeN/A
*-commutativeN/A
remove-double-negN/A
log-recN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
log-lowering-log.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6489.1
Simplified89.1%
if 5e307 < (+.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 89.1%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr18.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified17.0%
Taylor expanded in z around 0
Simplified94.8%
Final simplification90.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))))
(if (<= t_0 -5e+150)
(* y (/ (* z z) x))
(if (<= t_0 5e+307)
(+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x)))
(fma
z
(fma
z
(/
(-
(- 0.0 9.259259259259444e-5)
(fma
-0.0069444444444443885
(fma y 144.00000000000117 0.11428561142857531)
-9.259259259259444e-5))
x)
(/ -0.0027777777777778 x))
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
double tmp;
if (t_0 <= -5e+150) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e+307) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x));
} else {
tmp = fma(z, fma(z, (((0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), (-0.0027777777777778 / x)), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -5e+150) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 5e+307) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); else tmp = fma(z, fma(z, Float64(Float64(Float64(0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), Float64(-0.0027777777777778 / x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -5e+150], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+307], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(N[(0.0 - 9.259259259259444e-5), $MachinePrecision] - N[(-0.0069444444444443885 * N[(y * 144.00000000000117 + 0.11428561142857531), $MachinePrecision] + -9.259259259259444e-5), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(-0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+150}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{\left(0 - 9.259259259259444 \cdot 10^{-5}\right) - \mathsf{fma}\left(-0.0069444444444443885, \mathsf{fma}\left(y, 144.00000000000117, 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 (+.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)) < -5.00000000000000009e150Initial program 81.4%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6488.6
Simplified88.6%
if -5.00000000000000009e150 < (+.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)) < 5e307Initial program 99.5%
Taylor expanded in z around 0
Simplified89.1%
Taylor expanded in x around inf
Simplified86.8%
if 5e307 < (+.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 89.1%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr18.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified17.0%
Taylor expanded in z around 0
Simplified94.8%
Final simplification88.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 1e+117)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+ t_0 (* z (* z (/ (+ 0.0007936500793651 y) x)))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 1e+117) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / 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.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 1d+117) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + (z * (z * ((0.0007936500793651d0 + y) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 1e+117) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 1e+117: tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x))) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 1e+117) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 1e+117) tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1e+117], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 10^{+117}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 1.00000000000000005e117Initial program 99.7%
if 1.00000000000000005e117 < x Initial program 85.2%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6495.6
Simplified95.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.5
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 0.034)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
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 <= 0.034) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 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 <= 0.034) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.034], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $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[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.034:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -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 \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 0.034000000000000002Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6498.1
Simplified98.1%
if 0.034000000000000002 < x Initial program 90.0%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6496.2
Simplified96.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.8
Applied egg-rr98.8%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(if (<= x 1.0)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(+ (* x (+ (log x) -1.0)) (* z (/ (* z (+ 0.0007936500793651 y)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = (x * (log(x) + -1.0)) + (z * ((z * (0.0007936500793651 + y)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $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 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \frac{z \cdot \left(0.0007936500793651 + y\right)}{x}\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6497.4
Simplified97.4%
if 1 < x Initial program 89.9%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6496.7
Simplified96.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
log-lowering-log.f6496.4
Simplified96.4%
(FPCore (x y z)
:precision binary64
(if (<= x 1.06e+22)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.06e+22) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.06e+22) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.06e+22], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.06 \cdot 10^{+22}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.06e22Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6496.1
Simplified96.1%
if 1.06e22 < x Initial program 89.4%
Taylor expanded in x around inf
mul-1-negN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f6477.9
Simplified77.9%
(FPCore (x y z)
:precision binary64
(if (<= x 1.95e+118)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(fma
z
(fma
z
(/
(-
(- 0.0 9.259259259259444e-5)
(fma
-0.0069444444444443885
(fma y 144.00000000000117 0.11428561142857531)
-9.259259259259444e-5))
x)
(/ -0.0027777777777778 x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.95e+118) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(z, fma(z, (((0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), (-0.0027777777777778 / x)), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.95e+118) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = fma(z, fma(z, Float64(Float64(Float64(0.0 - 9.259259259259444e-5) - fma(-0.0069444444444443885, fma(y, 144.00000000000117, 0.11428561142857531), -9.259259259259444e-5)) / x), Float64(-0.0027777777777778 / x)), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.95e+118], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(z * N[(N[(N[(0.0 - 9.259259259259444e-5), $MachinePrecision] - N[(-0.0069444444444443885 * N[(y * 144.00000000000117 + 0.11428561142857531), $MachinePrecision] + -9.259259259259444e-5), $MachinePrecision]), $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 1.95 \cdot 10^{+118}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{\left(0 - 9.259259259259444 \cdot 10^{-5}\right) - \mathsf{fma}\left(-0.0069444444444443885, \mathsf{fma}\left(y, 144.00000000000117, 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 < 1.95e118Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6482.2
Simplified82.2%
if 1.95e118 < x Initial program 85.0%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr62.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified2.0%
Taylor expanded in z around 0
Simplified19.5%
Final simplification60.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -5e+54)
(* y (/ (* z z) x))
(if (<= t_0 0.0005)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(/ (* (+ 0.0007936500793651 y) (* z z)) x)))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+54) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 0.0005) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((0.0007936500793651 + y) * (z * z)) / 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 <= -5e+54) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 0.0005) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(0.0007936500793651 + y) * Float64(z * z)) / 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, -5e+54], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0005], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision] / x), $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 -5 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 0.0005:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(0.0007936500793651 + y\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) < -5.00000000000000005e54Initial program 84.7%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6472.7
Simplified72.7%
if -5.00000000000000005e54 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e-4Initial program 99.5%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified41.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f6440.5
Simplified40.5%
if 5.0000000000000001e-4 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 92.6%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr29.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified27.9%
Taylor expanded in z around inf
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6474.4
Simplified74.4%
Final simplification57.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -5e+54)
(* y (/ (* z z) x))
(if (<= t_0 0.0005)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(* (/ (+ 0.0007936500793651 y) x) (* z z))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+54) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 0.0005) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((0.0007936500793651 + y) / x) * (z * z);
}
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 <= -5e+54) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 0.0005) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(0.0007936500793651 + y) / x) * Float64(z * z)); 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, -5e+54], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0005], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision] * N[(z * z), $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 -5 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 0.0005:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.0007936500793651 + y}{x} \cdot \left(z \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.00000000000000005e54Initial program 84.7%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6472.7
Simplified72.7%
if -5.00000000000000005e54 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e-4Initial program 99.5%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified41.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f6440.5
Simplified40.5%
if 5.0000000000000001e-4 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 92.6%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr29.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified27.9%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6474.4
Simplified74.4%
Final simplification57.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -5e+54)
(* y (/ (* z z) x))
(if (<= t_0 0.0005)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(/ (* 0.0007936500793651 (* z z)) x)))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+54) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 0.0005) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = (0.0007936500793651 * (z * z)) / 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 <= -5e+54) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 0.0005) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(0.0007936500793651 * Float64(z * z)) / 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, -5e+54], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0005], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.0007936500793651 * N[(z * z), $MachinePrecision]), $MachinePrecision] / x), $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 -5 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 0.0005:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.0007936500793651 \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) < -5.00000000000000005e54Initial program 84.7%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6472.7
Simplified72.7%
if -5.00000000000000005e54 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e-4Initial program 99.5%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified41.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f6440.5
Simplified40.5%
if 5.0000000000000001e-4 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 92.6%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr29.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sub-negN/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
Simplified35.2%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.7
Simplified64.7%
Final simplification54.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
(t_1 (* y (/ (* z z) x))))
(if (<= t_0 -5e+54)
t_1
(if (<= t_0 10000000.0)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
t_1))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double t_1 = y * ((z * z) / x);
double tmp;
if (t_0 <= -5e+54) {
tmp = t_1;
} else if (t_0 <= 10000000.0) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) t_1 = Float64(y * Float64(Float64(z * z) / x)) tmp = 0.0 if (t_0 <= -5e+54) tmp = t_1; elseif (t_0 <= 10000000.0) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = t_1; 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]}, Block[{t$95$1 = N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+54], t$95$1, If[LessEqual[t$95$0, 10000000.0], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
t_1 := y \cdot \frac{z \cdot z}{x}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{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) < -5.00000000000000005e54 or 1e7 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 89.8%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6454.3
Simplified54.3%
if -5.00000000000000005e54 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1e7Initial program 99.5%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified41.1%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f6439.9
Simplified39.9%
Final simplification47.3%
(FPCore (x y z)
:precision binary64
(fma
z
(/
(fma
z
(fma
(fma 144.00000000000117 (+ 0.0007936500793651 y) 0.013333333333333707)
0.0069444444444443885
-9.259259259259444e-5)
-0.0027777777777778)
x)
(/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return fma(z, (fma(z, fma(fma(144.00000000000117, (0.0007936500793651 + y), 0.013333333333333707), 0.0069444444444443885, -9.259259259259444e-5), -0.0027777777777778) / x), (0.083333333333333 / x));
}
function code(x, y, z) return fma(z, Float64(fma(z, fma(fma(144.00000000000117, Float64(0.0007936500793651 + y), 0.013333333333333707), 0.0069444444444443885, -9.259259259259444e-5), -0.0027777777777778) / x), Float64(0.083333333333333 / x)) end
code[x_, y_, z_] := N[(z * N[(N[(z * N[(N[(144.00000000000117 * N[(0.0007936500793651 + y), $MachinePrecision] + 0.013333333333333707), $MachinePrecision] * 0.0069444444444443885 + -9.259259259259444e-5), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(\mathsf{fma}\left(144.00000000000117, 0.0007936500793651 + y, 0.013333333333333707\right), 0.0069444444444443885, -9.259259259259444 \cdot 10^{-5}\right), -0.0027777777777778\right)}{x}, \frac{0.083333333333333}{x}\right)
\end{array}
Initial program 94.6%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr62.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified32.9%
+-lowering-+.f64N/A
Applied egg-rr32.2%
Taylor expanded in z around 0
Simplified58.0%
(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 94.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6457.4
Simplified57.4%
(FPCore (x y z) :precision binary64 (/ (fma (* z z) (+ 0.0007936500793651 y) 0.083333333333333) x))
double code(double x, double y, double z) {
return fma((z * z), (0.0007936500793651 + y), 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(Float64(z * z), Float64(0.0007936500793651 + y), 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(N[(z * z), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(z \cdot z, 0.0007936500793651 + y, 0.083333333333333\right)}{x}
\end{array}
Initial program 94.6%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr62.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified32.9%
Taylor expanded in z around inf
+-lowering-+.f6456.8
Simplified56.8%
Taylor expanded in z around 0
Simplified56.4%
(FPCore (x y z) :precision binary64 (/ (fma -0.0027777777777778 z 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(-0.0027777777777778, z, 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}
\end{array}
Initial program 94.6%
div-invN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr62.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified32.9%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f6427.6
Simplified27.6%
(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 94.6%
Taylor expanded in z around 0
Simplified60.0%
Taylor expanded in x around 0
/-lowering-/.f6420.8
Simplified20.8%
clear-numN/A
clear-numN/A
div-invN/A
metadata-evalN/A
/-lowering-/.f64N/A
associate-/l*N/A
metadata-evalN/A
*-lowering-*.f6420.8
Applied egg-rr20.8%
(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.6%
Taylor expanded in z around 0
Simplified60.0%
Taylor expanded in x around 0
/-lowering-/.f6420.8
Simplified20.8%
(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 2024196
(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)))