
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 4e+97)
(+
(+ (- (/ (* (fma x x -0.25) (log x)) (+ x 0.5)) x) 0.91893853320467)
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x))
(+
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+97) {
tmp = ((((fma(x, x, -0.25) * log(x)) / (x + 0.5)) - x) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} 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+97) tmp = Float64(Float64(Float64(Float64(Float64(fma(x, x, -0.25) * log(x)) / Float64(x + 0.5)) - x) + 0.91893853320467) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)); 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+97], N[(N[(N[(N[(N[(N[(x * x + -0.25), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] / N[(x + 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $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^{+97}:\\
\;\;\;\;\left(\left(\frac{\mathsf{fma}\left(x, x, -0.25\right) \cdot \log x}{x + 0.5} - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\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.0000000000000003e97Initial program 99.7%
flip--N/A
lift-log.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-+.f6499.7
Applied rewrites99.7%
if 4.0000000000000003e97 < x Initial program 82.9%
Taylor expanded in y around 0
Applied rewrites99.8%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ y 0.0007936500793651)))
(t_1
(+
(/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
(if (<= t_1 -5e+186)
(/ (* z t_0) x)
(if (<= t_1 4e+294)
(fma
(+ x -0.5)
(log x)
(-
(+
0.91893853320467
(/
(fma
z
(fma z 0.0007936500793651 -0.0027777777777778)
0.083333333333333)
x))
x))
(* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
double tmp;
if (t_1 <= -5e+186) {
tmp = (z * t_0) / x;
} else if (t_1 <= 4e+294) {
tmp = fma((x + -0.5), log(x), ((0.91893853320467 + (fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x)) - x));
} else {
tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(y + 0.0007936500793651)) t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) tmp = 0.0 if (t_1 <= -5e+186) tmp = Float64(Float64(z * t_0) / x); elseif (t_1 <= 4e+294) tmp = fma(Float64(x + -0.5), log(x), Float64(Float64(0.91893853320467 + Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x)) - x)); else tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(0.91893853320467 + N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{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)) < -4.99999999999999954e186Initial program 94.2%
Taylor expanded in x around 0
Applied rewrites94.2%
Taylor expanded in z around inf
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6494.2
Applied rewrites94.2%
if -4.99999999999999954e186 < (+.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)) < 4.00000000000000027e294Initial program 99.5%
Applied rewrites99.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6496.6
Applied rewrites96.6%
lift-neg.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6496.6
Applied rewrites96.6%
if 4.00000000000000027e294 < (+.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 82.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
Final simplification93.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ y 0.0007936500793651)))
(t_1
(+
(/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
(if (<= t_1 -5e+186)
(/ (* z t_0) x)
(if (<= t_1 4e+294)
(fma
(+ x -0.5)
(log x)
(- 0.91893853320467 (- x (/ 0.083333333333333 x))))
(* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
double tmp;
if (t_1 <= -5e+186) {
tmp = (z * t_0) / x;
} else if (t_1 <= 4e+294) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - (x - (0.083333333333333 / x))));
} else {
tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(y + 0.0007936500793651)) t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) tmp = 0.0 if (t_1 <= -5e+186) tmp = Float64(Float64(z * t_0) / x); elseif (t_1 <= 4e+294) tmp = fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - Float64(x - Float64(0.083333333333333 / x)))); else tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - N[(x - N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - \left(x - \frac{0.083333333333333}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{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)) < -4.99999999999999954e186Initial program 94.2%
Taylor expanded in x around 0
Applied rewrites94.2%
Taylor expanded in z around inf
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6494.2
Applied rewrites94.2%
if -4.99999999999999954e186 < (+.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)) < 4.00000000000000027e294Initial program 99.5%
Applied rewrites99.5%
Taylor expanded in z around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6486.8
Applied rewrites86.8%
if 4.00000000000000027e294 < (+.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 82.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ y 0.0007936500793651)))
(t_1
(+
(/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
(if (<= t_1 -5e+186)
(/ (* z t_0) x)
(if (<= t_1 4e+294)
(+
(fma (log x) (+ x -0.5) (/ 0.083333333333333 x))
(- 0.91893853320467 x))
(* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
double tmp;
if (t_1 <= -5e+186) {
tmp = (z * t_0) / x;
} else if (t_1 <= 4e+294) {
tmp = fma(log(x), (x + -0.5), (0.083333333333333 / x)) + (0.91893853320467 - x);
} else {
tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(y + 0.0007936500793651)) t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) tmp = 0.0 if (t_1 <= -5e+186) tmp = Float64(Float64(z * t_0) / x); elseif (t_1 <= 4e+294) tmp = Float64(fma(log(x), Float64(x + -0.5), Float64(0.083333333333333 / x)) + Float64(0.91893853320467 - x)); else tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right) + \left(0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{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)) < -4.99999999999999954e186Initial program 94.2%
Taylor expanded in x around 0
Applied rewrites94.2%
Taylor expanded in z around inf
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6494.2
Applied rewrites94.2%
if -4.99999999999999954e186 < (+.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)) < 4.00000000000000027e294Initial 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--.f6486.7
Applied rewrites86.7%
if 4.00000000000000027e294 < (+.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 82.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ y 0.0007936500793651)))
(t_1
(+
(/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
(if (<= t_1 -5e+186)
(/ (* z t_0) x)
(if (<= t_1 4e+294)
(+
(/ 0.083333333333333 x)
(- (fma (log x) (+ x -0.5) 0.91893853320467) x))
(* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
double tmp;
if (t_1 <= -5e+186) {
tmp = (z * t_0) / x;
} else if (t_1 <= 4e+294) {
tmp = (0.083333333333333 / x) + (fma(log(x), (x + -0.5), 0.91893853320467) - x);
} else {
tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(y + 0.0007936500793651)) t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) tmp = 0.0 if (t_1 <= -5e+186) tmp = Float64(Float64(z * t_0) / x); elseif (t_1 <= 4e+294) tmp = Float64(Float64(0.083333333333333 / x) + Float64(fma(log(x), Float64(x + -0.5), 0.91893853320467) - x)); else tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{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)) < -4.99999999999999954e186Initial program 94.2%
Taylor expanded in x around 0
Applied rewrites94.2%
Taylor expanded in z around inf
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6494.2
Applied rewrites94.2%
if -4.99999999999999954e186 < (+.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)) < 4.00000000000000027e294Initial program 99.5%
Taylor expanded in z around 0
Applied rewrites86.7%
Applied rewrites86.7%
if 4.00000000000000027e294 < (+.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 82.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ y 0.0007936500793651)))
(t_1
(+
(/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
(if (<= t_1 -5e+186)
(/ (* z t_0) x)
(if (<= t_1 4e+294)
(+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x)))
(* (* z z) (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
double tmp;
if (t_1 <= -5e+186) {
tmp = (z * t_0) / x;
} else if (t_1 <= 4e+294) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x));
} else {
tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z * (y + 0.0007936500793651d0)
t_1 = (((z * (t_0 - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x))
if (t_1 <= (-5d+186)) then
tmp = (z * t_0) / x
else if (t_1 <= 4d+294) then
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((x * log(x)) - x))
else
tmp = (z * z) * ((y / x) + (0.0007936500793651d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x));
double tmp;
if (t_1 <= -5e+186) {
tmp = (z * t_0) / x;
} else if (t_1 <= 4e+294) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
} else {
tmp = (z * z) * ((y / x) + (0.0007936500793651 / x));
}
return tmp;
}
def code(x, y, z): t_0 = z * (y + 0.0007936500793651) t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) tmp = 0 if t_1 <= -5e+186: tmp = (z * t_0) / x elif t_1 <= 4e+294: tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * math.log(x)) - x)) else: tmp = (z * z) * ((y / x) + (0.0007936500793651 / x)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y + 0.0007936500793651)) t_1 = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) tmp = 0.0 if (t_1 <= -5e+186) tmp = Float64(Float64(z * t_0) / x); elseif (t_1 <= 4e+294) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); else tmp = Float64(Float64(z * z) * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y + 0.0007936500793651); t_1 = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x)); tmp = 0.0; if (t_1 <= -5e+186) tmp = (z * t_0) / x; elseif (t_1 <= 4e+294) tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x)); else tmp = (z * z) * ((y / x) + (0.0007936500793651 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+186], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{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)) < -4.99999999999999954e186Initial program 94.2%
Taylor expanded in x around 0
Applied rewrites94.2%
Taylor expanded in z around inf
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6494.2
Applied rewrites94.2%
if -4.99999999999999954e186 < (+.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)) < 4.00000000000000027e294Initial program 99.5%
Taylor expanded in z around 0
Applied rewrites86.7%
Taylor expanded in x around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6485.0
Applied rewrites85.0%
if 4.00000000000000027e294 < (+.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 82.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
Final simplification86.2%
(FPCore (x y z)
:precision binary64
(if (<=
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))
-5e+186)
(* y (/ (* z z) x))
(/
(fma z (fma z 0.0007936500793651 -0.0027777777777778) 0.083333333333333)
x)))
double code(double x, double y, double z) {
double tmp;
if (((((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x))) <= -5e+186) {
tmp = y * ((z * z) / x);
} else {
tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) <= -5e+186) tmp = Float64(y * Float64(Float64(z * z) / x)); else tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e+186], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) \leq -5 \cdot 10^{+186}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.99999999999999954e186Initial program 94.2%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6490.6
Applied rewrites90.6%
if -4.99999999999999954e186 < (+.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.8%
Applied rewrites93.9%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6488.5
Applied rewrites88.5%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6456.5
Applied rewrites56.5%
Final simplification61.2%
(FPCore (x y z)
:precision binary64
(if (<= x 2850000.0)
(+
(* (log x) (+ x -0.5))
(-
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)
(+ 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 <= 2850000.0) {
tmp = (log(x) * (x + -0.5)) + ((fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) - (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 <= 2850000.0) tmp = Float64(Float64(log(x) * Float64(x + -0.5)) + Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) - Float64(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, 2850000.0], N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(x + -0.91893853320467), $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 2850000:\\
\;\;\;\;\log x \cdot \left(x + -0.5\right) + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \left(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.85e6Initial program 99.7%
Applied rewrites99.7%
if 2.85e6 < x Initial program 88.0%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6498.3
Applied rewrites98.3%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (<= x 8e+51)
(fma
(+ x -0.5)
(log x)
(-
(+
0.91893853320467
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
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 <= 8e+51) {
tmp = fma((x + -0.5), log(x), ((0.91893853320467 + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / 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 <= 8e+51) tmp = fma(Float64(x + -0.5), log(x), Float64(Float64(0.91893853320467 + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)) - 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, 8e+51], N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(0.91893853320467 + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\
\end{array}
\end{array}
if x < 8e51Initial program 99.7%
Applied rewrites99.7%
if 8e51 < x Initial program 85.3%
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%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (<= x 0.0135)
(/
(fma
z
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
0.083333333333333)
x)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (* z (+ y 0.0007936500793651)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.0135) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((z * (y + 0.0007936500793651)) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.0135) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.0135], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0135:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z \cdot \left(y + 0.0007936500793651\right)}{x}\\
\end{array}
\end{array}
if x < 0.0134999999999999998Initial 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-+.f6499.0
Applied rewrites99.0%
if 0.0134999999999999998 < x Initial program 88.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-+.f6498.0
Applied rewrites98.0%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(if (<= x 1.35e+46)
(/
(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 <= 1.35e+46) {
tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(x, log(x), -x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.35e+46) tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x); else tmp = fma(x, log(x), Float64(-x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.35e+46], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+46}:\\
\;\;\;\;\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 < 1.3500000000000001e46Initial 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-+.f6492.4
Applied rewrites92.4%
if 1.3500000000000001e46 < x Initial program 85.7%
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.f6468.2
Applied rewrites68.2%
Final simplification82.4%
(FPCore (x y z)
:precision binary64
(if (<= x 1.35e+46)
(/
(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 <= 1.35e+46) {
tmp = 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 <= 1.35e+46) tmp = 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, 1.35e+46], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+46}:\\
\;\;\;\;\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 < 1.3500000000000001e46Initial 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-+.f6492.4
Applied rewrites92.4%
if 1.3500000000000001e46 < x Initial program 85.7%
Applied rewrites85.7%
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
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6468.1
Applied rewrites68.1%
Final simplification82.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ y 0.0007936500793651)))
(t_1 (/ (* z t_0) x))
(t_2 (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333)))
(if (<= t_2 -5e+31)
t_1
(if (<= t_2 2e+14)
(/
(fma
z
(fma z 0.0007936500793651 -0.0027777777777778)
0.083333333333333)
x)
t_1))))
double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double t_1 = (z * t_0) / x;
double t_2 = (z * (t_0 - 0.0027777777777778)) + 0.083333333333333;
double tmp;
if (t_2 <= -5e+31) {
tmp = t_1;
} else if (t_2 <= 2e+14) {
tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(y + 0.0007936500793651)) t_1 = Float64(Float64(z * t_0) / x) t_2 = Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) tmp = 0.0 if (t_2 <= -5e+31) tmp = t_1; elseif (t_2 <= 2e+14) tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x); else tmp = t_1; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+31], t$95$1, If[LessEqual[t$95$2, 2e+14], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
t_1 := \frac{z \cdot t\_0}{x}\\
t_2 := z \cdot \left(t\_0 - 0.0027777777777778\right) + 0.083333333333333\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+14}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)) < -5.00000000000000027e31 or 2e14 < (+.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 89.8%
Taylor expanded in x around 0
Applied rewrites77.8%
Taylor expanded in z around inf
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6473.6
Applied rewrites73.6%
if -5.00000000000000027e31 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 2e14Initial program 99.5%
Applied rewrites99.6%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6499.0
Applied rewrites99.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6455.7
Applied rewrites55.7%
Final simplification66.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 -5e+31)
(* y (/ (* z z) x))
(if (<= t_0 5e-6)
(+ 0.91893853320467 (/ 0.083333333333333 x))
(/ (* 0.0007936500793651 (* z z)) x)))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+31) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e-6) {
tmp = 0.91893853320467 + (0.083333333333333 / x);
} else {
tmp = (0.0007936500793651 * (z * z)) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
if (t_0 <= (-5d+31)) then
tmp = y * ((z * z) / x)
else if (t_0 <= 5d-6) then
tmp = 0.91893853320467d0 + (0.083333333333333d0 / x)
else
tmp = (0.0007936500793651d0 * (z * z)) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+31) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e-6) {
tmp = 0.91893853320467 + (0.083333333333333 / x);
} else {
tmp = (0.0007936500793651 * (z * z)) / x;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if t_0 <= -5e+31: tmp = y * ((z * z) / x) elif t_0 <= 5e-6: tmp = 0.91893853320467 + (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(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -5e+31) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 5e-6) tmp = Float64(0.91893853320467 + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(0.0007936500793651 * Float64(z * z)) / x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -5e+31) tmp = y * ((z * z) / x); elseif (t_0 <= 5e-6) tmp = 0.91893853320467 + (0.083333333333333 / x); else tmp = (0.0007936500793651 * (z * z)) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+31], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-6], N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $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(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;0.91893853320467 + \frac{0.083333333333333}{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.00000000000000027e31Initial program 95.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6477.5
Applied rewrites77.5%
if -5.00000000000000027e31 < (*.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 z around 0
Applied rewrites98.7%
Applied rewrites98.6%
Taylor expanded in x around inf
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6496.7
Applied rewrites96.7%
Taylor expanded in x around 0
Applied rewrites56.2%
if 5.00000000000000041e-6 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 88.3%
Applied rewrites88.3%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6478.2
Applied rewrites78.2%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6459.0
Applied rewrites59.0%
Final simplification60.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 -5e+31)
(* y (/ (* z z) x))
(if (<= t_0 5e+26)
(+ 0.91893853320467 (/ 0.083333333333333 x))
(* y (* z (/ z x)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+31) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e+26) {
tmp = 0.91893853320467 + (0.083333333333333 / x);
} else {
tmp = y * (z * (z / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
if (t_0 <= (-5d+31)) then
tmp = y * ((z * z) / x)
else if (t_0 <= 5d+26) then
tmp = 0.91893853320467d0 + (0.083333333333333d0 / x)
else
tmp = y * (z * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+31) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 5e+26) {
tmp = 0.91893853320467 + (0.083333333333333 / x);
} else {
tmp = y * (z * (z / x));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if t_0 <= -5e+31: tmp = y * ((z * z) / x) elif t_0 <= 5e+26: tmp = 0.91893853320467 + (0.083333333333333 / x) else: tmp = y * (z * (z / x)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -5e+31) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 5e+26) tmp = Float64(0.91893853320467 + Float64(0.083333333333333 / x)); else tmp = Float64(y * Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -5e+31) tmp = y * ((z * z) / x); elseif (t_0 <= 5e+26) tmp = 0.91893853320467 + (0.083333333333333 / x); else tmp = y * (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+31], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+26], N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+26}:\\
\;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.00000000000000027e31Initial program 95.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6477.5
Applied rewrites77.5%
if -5.00000000000000027e31 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e26Initial program 99.4%
Taylor expanded in z around 0
Applied rewrites96.6%
Applied rewrites96.6%
Taylor expanded in x around inf
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6494.3
Applied rewrites94.3%
Taylor expanded in x around 0
Applied rewrites53.7%
if 5.0000000000000001e26 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 87.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6450.0
Applied rewrites50.0%
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6450.6
Applied rewrites50.6%
Final simplification56.3%
(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 -5e+31)
t_1
(if (<= t_0 5e+26) (+ 0.91893853320467 (/ 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 <= -5e+31) {
tmp = t_1;
} else if (t_0 <= 5e+26) {
tmp = 0.91893853320467 + (0.083333333333333 / x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
t_1 = y * (z * (z / x))
if (t_0 <= (-5d+31)) then
tmp = t_1
else if (t_0 <= 5d+26) then
tmp = 0.91893853320467d0 + (0.083333333333333d0 / x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = y * (z * (z / x));
double tmp;
if (t_0 <= -5e+31) {
tmp = t_1;
} else if (t_0 <= 5e+26) {
tmp = 0.91893853320467 + (0.083333333333333 / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) t_1 = y * (z * (z / x)) tmp = 0 if t_0 <= -5e+31: tmp = t_1 elif t_0 <= 5e+26: tmp = 0.91893853320467 + (0.083333333333333 / x) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) t_1 = Float64(y * Float64(z * Float64(z / x))) tmp = 0.0 if (t_0 <= -5e+31) tmp = t_1; elseif (t_0 <= 5e+26) tmp = Float64(0.91893853320467 + Float64(0.083333333333333 / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); t_1 = y * (z * (z / x)); tmp = 0.0; if (t_0 <= -5e+31) tmp = t_1; elseif (t_0 <= 5e+26) tmp = 0.91893853320467 + (0.083333333333333 / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+31], t$95$1, If[LessEqual[t$95$0, 5e+26], N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
t_1 := y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+26}:\\
\;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.00000000000000027e31 or 5.0000000000000001e26 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 89.7%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6457.7
Applied rewrites57.7%
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.2
Applied rewrites58.2%
if -5.00000000000000027e31 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e26Initial program 99.4%
Taylor expanded in z around 0
Applied rewrites96.6%
Applied rewrites96.6%
Taylor expanded in x around inf
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6494.3
Applied rewrites94.3%
Taylor expanded in x around 0
Applied rewrites53.7%
Final simplification56.3%
(FPCore (x y z) :precision binary64 (/ (fma z (fma z (+ y 0.0007936500793651) -0.0027777777777778) 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}
\end{array}
Initial program 93.9%
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.3
Applied rewrites66.3%
Final simplification66.3%
(FPCore (x y z) :precision binary64 (+ 0.91893853320467 (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return 0.91893853320467 + (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.91893853320467d0 + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + (0.083333333333333 / x);
}
def code(x, y, z): return 0.91893853320467 + (0.083333333333333 / x)
function code(x, y, z) return Float64(0.91893853320467 + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + \frac{0.083333333333333}{x}
\end{array}
Initial program 93.9%
Taylor expanded in z around 0
Applied rewrites55.7%
Applied rewrites55.7%
Taylor expanded in x around inf
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6454.7
Applied rewrites54.7%
Taylor expanded in x around 0
Applied rewrites25.1%
(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 93.9%
Taylor expanded in z around 0
Applied rewrites55.7%
Taylor expanded in x around 0
lower-/.f6424.5
Applied rewrites24.5%
(FPCore (x y z) :precision binary64 (- x))
double code(double x, double y, double z) {
return -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
end function
public static double code(double x, double y, double z) {
return -x;
}
def code(x, y, z): return -x
function code(x, y, z) return Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 93.9%
Taylor expanded in z around 0
Applied rewrites55.7%
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites23.7%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f641.2
Applied rewrites1.2%
(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 2024216
(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)))