
(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 22 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 4e-56)
(fma
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
(/ 1.0 x)
(fma -0.5 (log x) 0.91893853320467))
(+
0.91893853320467
(fma
(log x)
(+ x -0.5)
(-
(fma
z
(fma z (/ y x) (/ (fma z 0.0007936500793651 -0.0027777777777778) x))
(/ 0.083333333333333 x))
x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4e-56) {
tmp = fma(fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), fma(-0.5, log(x), 0.91893853320467));
} else {
tmp = 0.91893853320467 + fma(log(x), (x + -0.5), (fma(z, fma(z, (y / x), (fma(z, 0.0007936500793651, -0.0027777777777778) / x)), (0.083333333333333 / x)) - x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 4e-56) tmp = fma(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / x), fma(-0.5, log(x), 0.91893853320467)); else tmp = Float64(0.91893853320467 + fma(log(x), Float64(x + -0.5), Float64(fma(z, fma(z, Float64(y / x), Float64(fma(z, 0.0007936500793651, -0.0027777777777778) / x)), Float64(0.083333333333333 / x)) - x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4e-56], N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(N[(z * N[(z * N[(y / x), $MachinePrecision] + N[(N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{-56}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{y}{x}, \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{x}\right), \frac{0.083333333333333}{x}\right) - x\right)\\
\end{array}
\end{array}
if x < 4.0000000000000002e-56Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
metadata-evalN/A
lower-/.f6499.9
lift-+.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
remove-double-negN/A
log-recN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6499.9
Applied rewrites99.9%
if 4.0000000000000002e-56 < x Initial program 88.1%
Taylor expanded in y around 0
Applied rewrites99.7%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (<=
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
-2e+75)
(* (* z y) (/ z x))
(/ (fma z (* z 0.0007936500793651) 0.083333333333333) x)))
double code(double x, double y, double z) {
double tmp;
if (((0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)) <= -2e+75) {
tmp = (z * y) * (z / x);
} else {
tmp = fma(z, (z * 0.0007936500793651), 0.083333333333333) / x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)) <= -2e+75) tmp = Float64(Float64(z * y) * Float64(z / x)); else tmp = Float64(fma(z, Float64(z * 0.0007936500793651), 0.083333333333333) / x); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], -2e+75], N[(N[(z * y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * 0.0007936500793651), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} \leq -2 \cdot 10^{+75}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{z}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, z \cdot 0.0007936500793651, 0.083333333333333\right)}{x}\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -1.99999999999999985e75Initial program 90.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6496.7
Applied rewrites96.7%
Applied rewrites96.7%
if -1.99999999999999985e75 < (+.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 93.1%
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-+.f6458.6
Applied rewrites58.6%
Taylor expanded in y around 0
Applied rewrites53.8%
Taylor expanded in z around inf
Applied rewrites53.5%
Final simplification58.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 -2e+74)
(* (* z y) (/ z x))
(if (<= t_0 1e+68)
(fma
(/ 1.0 x)
0.083333333333333
(- (fma (log x) (+ x -0.5) 0.91893853320467) x))
(* z (* (+ y 0.0007936500793651) (/ 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 <= -2e+74) {
tmp = (z * y) * (z / x);
} else if (t_0 <= 1e+68) {
tmp = fma((1.0 / x), 0.083333333333333, (fma(log(x), (x + -0.5), 0.91893853320467) - x));
} else {
tmp = z * ((y + 0.0007936500793651) * (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 <= -2e+74) tmp = Float64(Float64(z * y) * Float64(z / x)); elseif (t_0 <= 1e+68) tmp = fma(Float64(1.0 / x), 0.083333333333333, Float64(fma(log(x), Float64(x + -0.5), 0.91893853320467) - x)); else tmp = Float64(z * Float64(Float64(y + 0.0007936500793651) * Float64(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, -2e+74], N[(N[(z * y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+68], N[(N[(1.0 / x), $MachinePrecision] * 0.083333333333333 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * 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 -2 \cdot 10^{+74}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{z}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+68}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{x}, 0.083333333333333, \mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y + 0.0007936500793651\right) \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.9999999999999999e74Initial program 91.1%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6493.8
Applied rewrites93.8%
Applied rewrites93.9%
if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 9.99999999999999953e67Initial program 99.5%
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--.f6495.9
Applied rewrites95.9%
Applied rewrites96.0%
if 9.99999999999999953e67 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 85.6%
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.2
Applied rewrites97.2%
Taylor expanded in z around inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-rgt-inN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6482.5
Applied rewrites82.5%
Final simplification90.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 -2e+74)
(* (* z y) (/ z x))
(if (<= t_0 1e+68)
(+
(/ 0.083333333333333 x)
(- (fma (log x) (+ x -0.5) 0.91893853320467) x))
(* z (* (+ y 0.0007936500793651) (/ 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 <= -2e+74) {
tmp = (z * y) * (z / x);
} else if (t_0 <= 1e+68) {
tmp = (0.083333333333333 / x) + (fma(log(x), (x + -0.5), 0.91893853320467) - x);
} else {
tmp = z * ((y + 0.0007936500793651) * (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 <= -2e+74) tmp = Float64(Float64(z * y) * Float64(z / x)); elseif (t_0 <= 1e+68) tmp = Float64(Float64(0.083333333333333 / x) + Float64(fma(log(x), Float64(x + -0.5), 0.91893853320467) - x)); else tmp = Float64(z * Float64(Float64(y + 0.0007936500793651) * Float64(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, -2e+74], N[(N[(z * y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+68], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * 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 -2 \cdot 10^{+74}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{z}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+68}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y + 0.0007936500793651\right) \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.9999999999999999e74Initial program 91.1%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6493.8
Applied rewrites93.8%
Applied rewrites93.9%
if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 9.99999999999999953e67Initial program 99.5%
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--.f6495.9
Applied rewrites95.9%
Applied rewrites95.9%
if 9.99999999999999953e67 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 85.6%
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.2
Applied rewrites97.2%
Taylor expanded in z around inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-rgt-inN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6482.5
Applied rewrites82.5%
Final simplification90.2%
(FPCore (x y z)
:precision binary64
(if (<= x 62000000000000.0)
(fma
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
(/ 1.0 x)
(fma (+ x -0.5) (log x) (- 0.91893853320467 x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (* z (/ 1.0 x)) (* z (+ y 0.0007936500793651))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 62000000000000.0) {
tmp = fma(fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), fma((x + -0.5), log(x), (0.91893853320467 - x)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((z * (1.0 / x)) * (z * (y + 0.0007936500793651)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 62000000000000.0) tmp = fma(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / 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(Float64(z * Float64(1.0 / x)) * Float64(z * Float64(y + 0.0007936500793651)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 62000000000000.0], N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / 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[(N[(z * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] * N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 62000000000000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(z \cdot \frac{1}{x}\right) \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)\\
\end{array}
\end{array}
if x < 6.2e13Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
metadata-evalN/A
lower-/.f6499.8
lift-+.f64N/A
Applied rewrites99.8%
if 6.2e13 < 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
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6498.1
Applied rewrites98.1%
Applied rewrites98.1%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (<= x 8000000000000.0)
(+
0.91893853320467
(+
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)
(fma (+ x -0.5) (log x) (- x))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (* z (/ 1.0 x)) (* z (+ y 0.0007936500793651))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 8000000000000.0) {
tmp = 0.91893853320467 + ((fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma((x + -0.5), log(x), -x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((z * (1.0 / x)) * (z * (y + 0.0007936500793651)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 8000000000000.0) tmp = Float64(0.91893853320467 + Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma(Float64(x + -0.5), log(x), Float64(-x)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(z * Float64(1.0 / x)) * Float64(z * Float64(y + 0.0007936500793651)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 8000000000000.0], N[(0.91893853320467 + 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] + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] * N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8000000000000:\\
\;\;\;\;0.91893853320467 + \left(\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, -x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(z \cdot \frac{1}{x}\right) \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right)\\
\end{array}
\end{array}
if x < 8e12Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
if 8e12 < 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
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6498.1
Applied rewrites98.1%
Applied rewrites98.1%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (<= x 40000000000.0)
(+
0.91893853320467
(+
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)
(fma (+ x -0.5) (log x) (- 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 <= 40000000000.0) {
tmp = 0.91893853320467 + ((fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma((x + -0.5), log(x), -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 <= 40000000000.0) tmp = Float64(0.91893853320467 + Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + fma(Float64(x + -0.5), log(x), Float64(-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, 40000000000.0], N[(0.91893853320467 + 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] + (-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 40000000000:\\
\;\;\;\;0.91893853320467 + \left(\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, -x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\
\end{array}
\end{array}
if x < 4e10Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
if 4e10 < 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
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6498.1
Applied rewrites98.1%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (<= x 2.3)
(fma
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
(/ 1.0 x)
(fma -0.5 (log x) 0.91893853320467))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (* z (+ y 0.0007936500793651)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.3) {
tmp = fma(fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), (1.0 / x), fma(-0.5, log(x), 0.91893853320467));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (y + 0.0007936500793651)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.3) tmp = fma(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333), Float64(1.0 / x), fma(-0.5, log(x), 0.91893853320467)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.3], N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.3:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\
\end{array}
\end{array}
if x < 2.2999999999999998Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lower-fma.f64N/A
metadata-evalN/A
lower-/.f6499.8
lift-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
+-commutativeN/A
remove-double-negN/A
log-recN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6498.1
Applied rewrites98.1%
if 2.2999999999999998 < x Initial program 85.8%
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.0%
(FPCore (x y z)
:precision binary64
(if (<= x 2.05e+37)
(+
0.91893853320467
(/
(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.05e+37) {
tmp = 0.91893853320467 + (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.05e+37) tmp = Float64(0.91893853320467 + 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.05e+37], N[(0.91893853320467 + N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05 \cdot 10^{+37}:\\
\;\;\;\;0.91893853320467 + \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.0499999999999999e37Initial program 99.1%
Taylor expanded in y around 0
Applied rewrites87.9%
Taylor expanded in x around 0
Applied rewrites93.3%
if 2.0499999999999999e37 < x Initial program 84.5%
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.f6472.6
Applied rewrites72.6%
Final simplification84.4%
(FPCore (x y z)
:precision binary64
(if (<= x 2.05e+37)
(+
0.91893853320467
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x))
(- (* x (log x)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.05e+37) {
tmp = 0.91893853320467 + (fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (x * log(x)) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.05e+37) tmp = Float64(0.91893853320467 + Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(x * log(x)) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.05e+37], N[(0.91893853320467 + N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05 \cdot 10^{+37}:\\
\;\;\;\;0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log x - x\\
\end{array}
\end{array}
if x < 2.0499999999999999e37Initial program 99.1%
Taylor expanded in y around 0
Applied rewrites87.9%
Taylor expanded in x around 0
Applied rewrites93.3%
if 2.0499999999999999e37 < x Initial program 84.5%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6497.9
Applied rewrites97.9%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6472.4
Applied rewrites72.4%
Final simplification84.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))))
(if (<= t_0 -2e+74)
(* (* z y) (/ z x))
(if (<= t_0 0.1)
(/ (fma z -0.0027777777777778 0.083333333333333) x)
(* y (/ (* z z) 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 <= -2e+74) {
tmp = (z * y) * (z / x);
} else if (t_0 <= 0.1) {
tmp = fma(z, -0.0027777777777778, 0.083333333333333) / x;
} else {
tmp = y * ((z * z) / 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 <= -2e+74) tmp = Float64(Float64(z * y) * Float64(z / x)); elseif (t_0 <= 0.1) tmp = Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x); else tmp = Float64(y * Float64(Float64(z * z) / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+74], N[(N[(z * y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.1], N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(y * N[(N[(z * z), $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 -2 \cdot 10^{+74}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{z}{x}\\
\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -1.9999999999999999e74Initial program 91.1%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6493.8
Applied rewrites93.8%
Applied rewrites93.9%
if -1.9999999999999999e74 < (+.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.5%
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-+.f6444.6
Applied rewrites44.6%
Taylor expanded in z around 0
Applied rewrites44.0%
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 86.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6450.2
Applied rewrites50.2%
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 -2e+74)
t_1
(if (<= t_0 5e-6)
(/ (fma z -0.0027777777777778 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 <= -2e+74) {
tmp = t_1;
} else if (t_0 <= 5e-6) {
tmp = fma(z, -0.0027777777777778, 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(Float64(z * z) / x)) tmp = 0.0 if (t_0 <= -2e+74) tmp = t_1; elseif (t_0 <= 5e-6) tmp = Float64(fma(z, -0.0027777777777778, 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[(y + 0.0007936500793651), $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, -2e+74], t$95$1, If[LessEqual[t$95$0, 5e-6], N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / 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 \frac{z \cdot z}{x}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -0.0027777777777778, 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) < -1.9999999999999999e74 or 5.00000000000000041e-6 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 87.7%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6460.1
Applied rewrites60.1%
if -1.9999999999999999e74 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.00000000000000041e-6Initial program 99.5%
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-+.f6444.6
Applied rewrites44.6%
Taylor expanded in z around 0
Applied rewrites44.0%
Final simplification53.1%
(FPCore (x y z)
:precision binary64
(if (<=
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
40000000000.0)
(/ (fma z (* z y) 0.083333333333333) x)
(* z (* (+ y 0.0007936500793651) (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 40000000000.0) {
tmp = fma(z, (z * y), 0.083333333333333) / x;
} else {
tmp = z * ((y + 0.0007936500793651) * (z / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 40000000000.0) tmp = Float64(fma(z, Float64(z * y), 0.083333333333333) / x); else tmp = Float64(z * Float64(Float64(y + 0.0007936500793651) * Float64(z / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 40000000000.0], N[(N[(z * N[(z * y), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 40000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, z \cdot y, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y + 0.0007936500793651\right) \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) < 4e10Initial program 97.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-+.f6454.5
Applied rewrites54.5%
Taylor expanded in y around inf
Applied rewrites54.0%
if 4e10 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 86.5%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6496.9
Applied rewrites96.9%
Taylor expanded in z around inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-rgt-inN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6479.5
Applied rewrites79.5%
Final simplification65.0%
(FPCore (x y z)
:precision binary64
(if (<=
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
40000000000.0)
(/ (fma z (* z y) 0.083333333333333) x)
(* z (* z (/ (+ y 0.0007936500793651) x)))))
double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 40000000000.0) {
tmp = fma(z, (z * y), 0.083333333333333) / x;
} else {
tmp = z * (z * ((y + 0.0007936500793651) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 40000000000.0) tmp = Float64(fma(z, Float64(z * y), 0.083333333333333) / x); else tmp = Float64(z * Float64(z * Float64(Float64(y + 0.0007936500793651) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 40000000000.0], N[(N[(z * N[(z * y), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 40000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, z \cdot y, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 4e10Initial program 97.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-+.f6454.5
Applied rewrites54.5%
Taylor expanded in y around inf
Applied rewrites54.0%
if 4e10 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 86.5%
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-+.f6473.5
Applied rewrites73.5%
Taylor expanded in z around inf
Applied rewrites78.7%
Final simplification64.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (fma z (* z y) 0.083333333333333) x)))
(if (<= (+ y 0.0007936500793651) -1000000000000.0)
t_0
(if (<= (+ y 0.0007936500793651) 0.001)
(/
(fma
z
(fma z 0.0007936500793651 -0.0027777777777778)
0.083333333333333)
x)
t_0))))
double code(double x, double y, double z) {
double t_0 = fma(z, (z * y), 0.083333333333333) / x;
double tmp;
if ((y + 0.0007936500793651) <= -1000000000000.0) {
tmp = t_0;
} else if ((y + 0.0007936500793651) <= 0.001) {
tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(fma(z, Float64(z * y), 0.083333333333333) / x) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -1000000000000.0) tmp = t_0; elseif (Float64(y + 0.0007936500793651) <= 0.001) tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z * y), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -1000000000000.0], t$95$0, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.001], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(z, z \cdot y, 0.083333333333333\right)}{x}\\
\mathbf{if}\;y + 0.0007936500793651 \leq -1000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 0.001:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -1e12 or 1e-3 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 95.2%
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-+.f6465.8
Applied rewrites65.8%
Taylor expanded in y around inf
Applied rewrites65.8%
if -1e12 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 1e-3Initial program 90.5%
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-+.f6459.6
Applied rewrites59.6%
Taylor expanded in y around 0
Applied rewrites59.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (fma z (* z y) 0.083333333333333) x)))
(if (<= (+ y 0.0007936500793651) -1000000000000.0)
t_0
(if (<= (+ y 0.0007936500793651) 0.000794)
(/ (fma z (* z 0.0007936500793651) 0.083333333333333) x)
t_0))))
double code(double x, double y, double z) {
double t_0 = fma(z, (z * y), 0.083333333333333) / x;
double tmp;
if ((y + 0.0007936500793651) <= -1000000000000.0) {
tmp = t_0;
} else if ((y + 0.0007936500793651) <= 0.000794) {
tmp = fma(z, (z * 0.0007936500793651), 0.083333333333333) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(fma(z, Float64(z * y), 0.083333333333333) / x) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -1000000000000.0) tmp = t_0; elseif (Float64(y + 0.0007936500793651) <= 0.000794) tmp = Float64(fma(z, Float64(z * 0.0007936500793651), 0.083333333333333) / x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z * y), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -1000000000000.0], t$95$0, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.000794], N[(N[(z * N[(z * 0.0007936500793651), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(z, z \cdot y, 0.083333333333333\right)}{x}\\
\mathbf{if}\;y + 0.0007936500793651 \leq -1000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 0.000794:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, z \cdot 0.0007936500793651, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -1e12 or 7.94e-4 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 95.3%
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-+.f6466.1
Applied rewrites66.1%
Taylor expanded in y around inf
Applied rewrites65.5%
if -1e12 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 7.94e-4Initial program 90.4%
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-+.f6459.3
Applied rewrites59.3%
Taylor expanded in y around 0
Applied rewrites59.3%
Taylor expanded in z around inf
Applied rewrites58.9%
(FPCore (x y z)
:precision binary64
(if (<= x 2.05e+32)
(+
0.91893853320467
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x))
(* z (* (+ y 0.0007936500793651) (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.05e+32) {
tmp = 0.91893853320467 + (fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = z * ((y + 0.0007936500793651) * (z / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.05e+32) tmp = Float64(0.91893853320467 + Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(z * Float64(Float64(y + 0.0007936500793651) * Float64(z / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.05e+32], N[(0.91893853320467 + N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05 \cdot 10^{+32}:\\
\;\;\;\;0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 2.0499999999999999e32Initial program 99.7%
Taylor expanded in y around 0
Applied rewrites87.6%
Taylor expanded in x around 0
Applied rewrites93.7%
if 2.0499999999999999e32 < x Initial program 84.1%
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.9
Applied rewrites97.9%
Taylor expanded in z around inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-rgt-inN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6432.0
Applied rewrites32.0%
Final simplification66.5%
(FPCore (x y z)
:precision binary64
(if (<= x 2.05e+32)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(* z (* (+ y 0.0007936500793651) (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.05e+32) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = z * ((y + 0.0007936500793651) * (z / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.05e+32) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(z * Float64(Float64(y + 0.0007936500793651) * Float64(z / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.05e+32], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05 \cdot 10^{+32}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 2.0499999999999999e32Initial program 99.7%
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.6
Applied rewrites93.6%
if 2.0499999999999999e32 < x Initial program 84.1%
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.9
Applied rewrites97.9%
Taylor expanded in z around inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-rgt-inN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6432.0
Applied rewrites32.0%
Final simplification66.4%
(FPCore (x y z) :precision binary64 (if (<= z 35.0) (/ (fma z -0.0027777777777778 0.083333333333333) x) (* y (/ 0.083333333333333 (* x y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= 35.0) {
tmp = fma(z, -0.0027777777777778, 0.083333333333333) / x;
} else {
tmp = y * (0.083333333333333 / (x * y));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= 35.0) tmp = Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x); else tmp = Float64(y * Float64(0.083333333333333 / Float64(x * y))); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, 35.0], N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(y * N[(0.083333333333333 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 35:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.083333333333333}{x \cdot y}\\
\end{array}
\end{array}
if z < 35Initial 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-+.f6457.5
Applied rewrites57.5%
Taylor expanded in z around 0
Applied rewrites34.7%
if 35 < z Initial program 89.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6476.2
Applied rewrites76.2%
Taylor expanded in y around inf
Applied rewrites71.0%
Taylor expanded in z around 0
Applied rewrites15.3%
(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 92.8%
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%
Taylor expanded in z around 0
Applied rewrites26.5%
(FPCore (x y z) :precision binary64 (* 0.083333333333333 (/ 1.0 x)))
double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 * (1.0d0 / x)
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / x);
}
def code(x, y, z): return 0.083333333333333 * (1.0 / x)
function code(x, y, z) return Float64(0.083333333333333 * Float64(1.0 / x)) end
function tmp = code(x, y, z) tmp = 0.083333333333333 * (1.0 / x); end
code[x_, y_, z_] := N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x}
\end{array}
Initial program 92.8%
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--.f6454.5
Applied rewrites54.5%
Taylor expanded in x around 0
Applied rewrites21.0%
Applied rewrites21.0%
Final simplification21.0%
(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 92.8%
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--.f6454.5
Applied rewrites54.5%
Taylor expanded in x around 0
Applied rewrites21.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 2024219
(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)))