
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 1e+56)
(fma
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
(pow x -1.0)
(fma (log x) (- x 0.5) (fma -1.0 x 0.91893853320467)))
(-
(fma
(fma (/ y x) z (/ (fma 0.0007936500793651 z -0.0027777777777778) x))
z
(fma (- x 0.5) (log x) (/ 0.083333333333333 x)))
(- x 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e+56) {
tmp = fma(fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), pow(x, -1.0), fma(log(x), (x - 0.5), fma(-1.0, x, 0.91893853320467)));
} else {
tmp = fma(fma((y / x), z, (fma(0.0007936500793651, z, -0.0027777777777778) / x)), z, fma((x - 0.5), log(x), (0.083333333333333 / x))) - (x - 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1e+56) tmp = fma(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), (x ^ -1.0), fma(log(x), Float64(x - 0.5), fma(-1.0, x, 0.91893853320467))); else tmp = Float64(fma(fma(Float64(y / x), z, Float64(fma(0.0007936500793651, z, -0.0027777777777778) / x)), z, fma(Float64(x - 0.5), log(x), Float64(0.083333333333333 / x))) - Float64(x - 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1e+56], N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[Power[x, -1.0], $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(-1.0 * x + 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / x), $MachinePrecision] * z + N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * z + N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right), {x}^{-1}, \mathsf{fma}\left(\log x, x - 0.5, \mathsf{fma}\left(-1, x, 0.91893853320467\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{x}, z, \frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x}\right), z, \mathsf{fma}\left(x - 0.5, \log x, \frac{0.083333333333333}{x}\right)\right) - \left(x - 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 1.00000000000000009e56Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.7
Applied rewrites99.7%
if 1.00000000000000009e56 < x Initial program 87.3%
Taylor expanded in z around 0
Applied rewrites99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
(if (<= t_0 -2e+82)
(fma
(* (* z z) (+ (/ 1.0 x) (/ (/ 0.0007936500793651 x) y)))
y
(/ 0.083333333333333 x))
(if (<= t_0 2e+299)
(fma
(- x 0.5)
(log x)
(- (+ (/ 0.083333333333333 x) 0.91893853320467) x))
(* (* (* (+ y 0.0007936500793651) (pow x -1.0)) z) z)))))
double code(double x, double y, double z) {
double t_0 = ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
double tmp;
if (t_0 <= -2e+82) {
tmp = fma(((z * z) * ((1.0 / x) + ((0.0007936500793651 / x) / y))), y, (0.083333333333333 / x));
} else if (t_0 <= 2e+299) {
tmp = fma((x - 0.5), log(x), (((0.083333333333333 / x) + 0.91893853320467) - x));
} else {
tmp = (((y + 0.0007936500793651) * pow(x, -1.0)) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)) tmp = 0.0 if (t_0 <= -2e+82) tmp = fma(Float64(Float64(z * z) * Float64(Float64(1.0 / x) + Float64(Float64(0.0007936500793651 / x) / y))), y, Float64(0.083333333333333 / x)); elseif (t_0 <= 2e+299) tmp = fma(Float64(x - 0.5), log(x), Float64(Float64(Float64(0.083333333333333 / x) + 0.91893853320467) - x)); else tmp = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * (x ^ -1.0)) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+82], N[(N[(N[(z * z), $MachinePrecision] * N[(N[(1.0 / x), $MachinePrecision] + N[(N[(0.0007936500793651 / x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+299], N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(N[(0.083333333333333 / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[Power[x, -1.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot z\right) \cdot \left(\frac{1}{x} + \frac{\frac{0.0007936500793651}{x}}{y}\right), y, \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\mathsf{fma}\left(x - 0.5, \log x, \left(\frac{0.083333333333333}{x} + 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(y + 0.0007936500793651\right) \cdot {x}^{-1}\right) \cdot z\right) \cdot z\\
\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.9999999999999999e82Initial program 90.6%
Taylor expanded in y around inf
Applied rewrites99.7%
Taylor expanded in z around inf
Applied rewrites97.4%
if -1.9999999999999999e82 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2.0000000000000001e299Initial program 99.4%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6486.7
Applied rewrites86.7%
if 2.0000000000000001e299 < (+.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 87.0%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6485.6
Applied rewrites85.6%
Applied rewrites90.7%
Final simplification89.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
(if (<= t_0 -2e+82)
(fma
(* (* z z) (+ (/ 1.0 x) (/ (/ 0.0007936500793651 x) y)))
y
(/ 0.083333333333333 x))
(if (<= t_0 2e+299)
(+ (/ 0.083333333333333 x) (+ (- (* (log x) x) x) 0.91893853320467))
(* (* (* (+ y 0.0007936500793651) (pow x -1.0)) z) z)))))
double code(double x, double y, double z) {
double t_0 = ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
double tmp;
if (t_0 <= -2e+82) {
tmp = fma(((z * z) * ((1.0 / x) + ((0.0007936500793651 / x) / y))), y, (0.083333333333333 / x));
} else if (t_0 <= 2e+299) {
tmp = (0.083333333333333 / x) + (((log(x) * x) - x) + 0.91893853320467);
} else {
tmp = (((y + 0.0007936500793651) * pow(x, -1.0)) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)) tmp = 0.0 if (t_0 <= -2e+82) tmp = fma(Float64(Float64(z * z) * Float64(Float64(1.0 / x) + Float64(Float64(0.0007936500793651 / x) / y))), y, Float64(0.083333333333333 / x)); elseif (t_0 <= 2e+299) tmp = Float64(Float64(0.083333333333333 / x) + Float64(Float64(Float64(log(x) * x) - x) + 0.91893853320467)); else tmp = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * (x ^ -1.0)) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+82], N[(N[(N[(z * z), $MachinePrecision] * N[(N[(1.0 / x), $MachinePrecision] + N[(N[(0.0007936500793651 / x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+299], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[Power[x, -1.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot z\right) \cdot \left(\frac{1}{x} + \frac{\frac{0.0007936500793651}{x}}{y}\right), y, \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(\left(\log x \cdot x - x\right) + 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(y + 0.0007936500793651\right) \cdot {x}^{-1}\right) \cdot z\right) \cdot z\\
\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.9999999999999999e82Initial program 90.6%
Taylor expanded in y around inf
Applied rewrites99.7%
Taylor expanded in z around inf
Applied rewrites97.4%
if -1.9999999999999999e82 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2.0000000000000001e299Initial program 99.4%
Taylor expanded in z around 0
Applied rewrites86.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6484.8
Applied rewrites84.8%
if 2.0000000000000001e299 < (+.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 87.0%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6485.6
Applied rewrites85.6%
Applied rewrites90.7%
Final simplification88.4%
(FPCore (x y z)
:precision binary64
(if (<= x 3.9e+56)
(+
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(fma (- x 0.5) (log x) (- 0.91893853320467 x)))
(-
(fma
(fma (/ y x) z (/ (fma 0.0007936500793651 z -0.0027777777777778) x))
z
(fma (- x 0.5) (log x) (/ 0.083333333333333 x)))
(- x 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.9e+56) {
tmp = (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x) + fma((x - 0.5), log(x), (0.91893853320467 - x));
} else {
tmp = fma(fma((y / x), z, (fma(0.0007936500793651, z, -0.0027777777777778) / x)), z, fma((x - 0.5), log(x), (0.083333333333333 / x))) - (x - 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3.9e+56) tmp = Float64(Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x) + fma(Float64(x - 0.5), log(x), Float64(0.91893853320467 - x))); else tmp = Float64(fma(fma(Float64(y / x), z, Float64(fma(0.0007936500793651, z, -0.0027777777777778) / x)), z, fma(Float64(x - 0.5), log(x), Float64(0.083333333333333 / x))) - Float64(x - 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3.9e+56], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / x), $MachinePrecision] * z + N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * z + N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.9 \cdot 10^{+56}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} + \mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{x}, z, \frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x}\right), z, \mathsf{fma}\left(x - 0.5, \log x, \frac{0.083333333333333}{x}\right)\right) - \left(x - 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 3.89999999999999994e56Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.7
Applied rewrites99.7%
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
mul-1-negN/A
associate-+r+N/A
*-commutativeN/A
lift-*.f64N/A
sub-negN/A
lift--.f64N/A
lift-+.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow-1N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites99.7%
if 3.89999999999999994e56 < x Initial program 87.3%
Taylor expanded in z around 0
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 2e+288)
(+
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(fma (- x 0.5) (log x) (- 0.91893853320467 x)))
(-
(fma (/ (fma 0.0007936500793651 z -0.0027777777777778) x) z (* (log x) x))
(- x 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 2e+288) {
tmp = (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x) + fma((x - 0.5), log(x), (0.91893853320467 - x));
} else {
tmp = fma((fma(0.0007936500793651, z, -0.0027777777777778) / x), z, (log(x) * x)) - (x - 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 2e+288) tmp = Float64(Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x) + fma(Float64(x - 0.5), log(x), Float64(0.91893853320467 - x))); else tmp = Float64(fma(Float64(fma(0.0007936500793651, z, -0.0027777777777778) / x), z, Float64(log(x) * x)) - Float64(x - 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 2e+288], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] * z + N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} + \mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x}, z, \log x \cdot x\right) - \left(x - 0.91893853320467\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 2e288Initial program 97.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6497.6
Applied rewrites97.7%
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
mul-1-negN/A
associate-+r+N/A
*-commutativeN/A
lift-*.f64N/A
sub-negN/A
lift--.f64N/A
lift-+.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow-1N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites97.7%
if 2e288 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 84.4%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites93.7%
Taylor expanded in x around inf
Applied rewrites93.7%
Final simplification96.8%
(FPCore (x y z)
:precision binary64
(if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 5e+107)
(+
(/ (fma (* y z) z 0.083333333333333) x)
(fma (- x 0.5) (log x) (- 0.91893853320467 x)))
(-
(fma (/ (fma 0.0007936500793651 z -0.0027777777777778) x) z (* (log x) x))
(- x 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 5e+107) {
tmp = (fma((y * z), z, 0.083333333333333) / x) + fma((x - 0.5), log(x), (0.91893853320467 - x));
} else {
tmp = fma((fma(0.0007936500793651, z, -0.0027777777777778) / x), z, (log(x) * x)) - (x - 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 5e+107) tmp = Float64(Float64(fma(Float64(y * z), z, 0.083333333333333) / x) + fma(Float64(x - 0.5), log(x), Float64(0.91893853320467 - x))); else tmp = Float64(fma(Float64(fma(0.0007936500793651, z, -0.0027777777777778) / x), z, Float64(log(x) * x)) - Float64(x - 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 5e+107], N[(N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] * z + N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 5 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x} + \mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x}, z, \log x \cdot x\right) - \left(x - 0.91893853320467\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000002e107Initial program 97.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6497.2
Applied rewrites97.3%
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
mul-1-negN/A
associate-+r+N/A
*-commutativeN/A
lift-*.f64N/A
sub-negN/A
lift--.f64N/A
lift-+.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow-1N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites97.3%
Taylor expanded in y around inf
lower-*.f6496.3
Applied rewrites96.3%
if 5.0000000000000002e107 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 89.5%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites91.7%
Taylor expanded in x around inf
Applied rewrites91.7%
Final simplification94.7%
(FPCore (x y z)
:precision binary64
(if (<= x 1500000.0)
(*
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
(pow x -1.0))
(-
(fma (/ (fma 0.0007936500793651 z -0.0027777777777778) x) z (* (log x) x))
(- x 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1500000.0) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) * pow(x, -1.0);
} else {
tmp = fma((fma(0.0007936500793651, z, -0.0027777777777778) / x), z, (log(x) * x)) - (x - 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1500000.0) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) * (x ^ -1.0)); else tmp = Float64(fma(Float64(fma(0.0007936500793651, z, -0.0027777777777778) / x), z, Float64(log(x) * x)) - Float64(x - 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1500000.0], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[Power[x, -1.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] * z + N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1500000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right) \cdot {x}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x}, z, \log x \cdot x\right) - \left(x - 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 1.5e6Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6497.6
Applied rewrites97.6%
Applied rewrites97.6%
if 1.5e6 < x Initial program 89.3%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites83.3%
Taylor expanded in x around inf
Applied rewrites83.0%
Final simplification90.4%
(FPCore (x y z)
:precision binary64
(if (<= x 3e+53)
(*
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
(pow x -1.0))
(* (- (log x) 1.0) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 3e+53) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) * pow(x, -1.0);
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3e+53) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) * (x ^ -1.0)); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3e+53], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[Power[x, -1.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right) \cdot {x}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 2.99999999999999998e53Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6493.5
Applied rewrites93.5%
Applied rewrites93.5%
if 2.99999999999999998e53 < x Initial program 87.4%
Taylor expanded in x around inf
*-commutativeN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6473.3
Applied rewrites73.3%
Final simplification85.1%
(FPCore (x y z)
:precision binary64
(if (<= x 3e+53)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (- (log x) 1.0) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 3e+53) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3e+53) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3e+53], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3 \cdot 10^{+53}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 2.99999999999999998e53Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6493.5
Applied rewrites93.5%
if 2.99999999999999998e53 < x Initial program 87.4%
Taylor expanded in x around inf
*-commutativeN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6473.3
Applied rewrites73.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z))
(t_1 (* (* (/ z x) z) y)))
(if (<= t_0 -500000.0)
t_1
(if (<= t_0 50.0)
(/ 0.083333333333333 x)
(if (<= t_0 5e+132) t_1 (* (* (/ 0.0007936500793651 x) z) z))))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double t_1 = ((z / x) * z) * y;
double tmp;
if (t_0 <= -500000.0) {
tmp = t_1;
} else if (t_0 <= 50.0) {
tmp = 0.083333333333333 / x;
} else if (t_0 <= 5e+132) {
tmp = t_1;
} else {
tmp = ((0.0007936500793651 / x) * z) * z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z
t_1 = ((z / x) * z) * y
if (t_0 <= (-500000.0d0)) then
tmp = t_1
else if (t_0 <= 50.0d0) then
tmp = 0.083333333333333d0 / x
else if (t_0 <= 5d+132) then
tmp = t_1
else
tmp = ((0.0007936500793651d0 / x) * z) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double t_1 = ((z / x) * z) * y;
double tmp;
if (t_0 <= -500000.0) {
tmp = t_1;
} else if (t_0 <= 50.0) {
tmp = 0.083333333333333 / x;
} else if (t_0 <= 5e+132) {
tmp = t_1;
} else {
tmp = ((0.0007936500793651 / x) * z) * z;
}
return tmp;
}
def code(x, y, z): t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z t_1 = ((z / x) * z) * y tmp = 0 if t_0 <= -500000.0: tmp = t_1 elif t_0 <= 50.0: tmp = 0.083333333333333 / x elif t_0 <= 5e+132: tmp = t_1 else: tmp = ((0.0007936500793651 / x) * z) * z return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) t_1 = Float64(Float64(Float64(z / x) * z) * y) tmp = 0.0 if (t_0 <= -500000.0) tmp = t_1; elseif (t_0 <= 50.0) tmp = Float64(0.083333333333333 / x); elseif (t_0 <= 5e+132) tmp = t_1; else tmp = Float64(Float64(Float64(0.0007936500793651 / x) * z) * z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z; t_1 = ((z / x) * z) * y; tmp = 0.0; if (t_0 <= -500000.0) tmp = t_1; elseif (t_0 <= 50.0) tmp = 0.083333333333333 / x; elseif (t_0 <= 5e+132) tmp = t_1; else tmp = ((0.0007936500793651 / x) * z) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$0, -500000.0], t$95$1, If[LessEqual[t$95$0, 50.0], N[(0.083333333333333 / x), $MachinePrecision], If[LessEqual[t$95$0, 5e+132], t$95$1, N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
t_1 := \left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{if}\;t\_0 \leq -500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 50:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5e5 or 50 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000001e132Initial program 94.0%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6467.9
Applied rewrites67.9%
Applied rewrites73.5%
if -5e5 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 50Initial program 99.3%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6445.8
Applied rewrites45.8%
Taylor expanded in z around 0
Applied rewrites43.7%
if 5.0000000000000001e132 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 88.7%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites92.1%
Taylor expanded in z around inf
Applied rewrites78.4%
Final simplification62.7%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.12) (/ (fma (* y z) z 0.083333333333333) x) (* (* (/ z x) z) (+ y 0.0007936500793651))))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.12) {
tmp = fma((y * z), z, 0.083333333333333) / x;
} else {
tmp = ((z / x) * z) * (y + 0.0007936500793651);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.12) tmp = Float64(fma(Float64(y * z), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 0.12], N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 0.12:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 0.12Initial program 97.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6455.6
Applied rewrites55.6%
Taylor expanded in y around inf
Applied rewrites55.6%
if 0.12 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 90.9%
Taylor expanded in z around 0
Applied rewrites24.6%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6413.3
Applied rewrites13.3%
Taylor expanded in z around inf
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
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6478.8
Applied rewrites78.8%
Final simplification65.0%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 1e+95) (/ (fma (* y z) z 0.083333333333333) x) (* (/ (+ y 0.0007936500793651) x) (* z z))))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 1e+95) {
tmp = fma((y * z), z, 0.083333333333333) / x;
} else {
tmp = ((y + 0.0007936500793651) / x) * (z * z);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 1e+95) tmp = Float64(fma(Float64(y * z), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(y + 0.0007936500793651) / x) * Float64(z * z)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 1e+95], N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 10^{+95}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y + 0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1.00000000000000002e95Initial program 97.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6455.6
Applied rewrites55.6%
Taylor expanded in y around inf
Applied rewrites54.5%
if 1.00000000000000002e95 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 89.6%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6448.3
Applied rewrites48.3%
Applied rewrites53.6%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6480.0
Applied rewrites80.0%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 5e+107) (/ (fma (* y z) z 0.083333333333333) x) (* (* (/ 0.0007936500793651 x) z) z)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 5e+107) {
tmp = fma((y * z), z, 0.083333333333333) / x;
} else {
tmp = ((0.0007936500793651 / x) * z) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 5e+107) tmp = Float64(fma(Float64(y * z), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(0.0007936500793651 / x) * z) * z); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 5e+107], N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 5 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.0000000000000002e107Initial program 97.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6455.9
Applied rewrites55.9%
Taylor expanded in y around inf
Applied rewrites54.8%
if 5.0000000000000002e107 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 89.5%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites91.7%
Taylor expanded in z around inf
Applied rewrites75.6%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.12) (/ (fma -0.0027777777777778 z 0.083333333333333) x) (* (* (/ 0.0007936500793651 x) z) z)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.12) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((0.0007936500793651 / x) * z) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.12) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(0.0007936500793651 / x) * z) * z); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 0.12], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 0.12:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 0.12Initial program 97.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6455.6
Applied rewrites55.6%
Taylor expanded in z around 0
Applied rewrites32.4%
if 0.12 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 90.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites87.3%
Taylor expanded in z around inf
Applied rewrites67.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (fma (* y z) z 0.083333333333333) x)))
(if (<= (+ y 0.0007936500793651) -20000000.0)
t_0
(if (<= (+ y 0.0007936500793651) 0.0007936501)
(/
(fma
(fma 0.0007936500793651 z -0.0027777777777778)
z
0.083333333333333)
x)
t_0))))
double code(double x, double y, double z) {
double t_0 = fma((y * z), z, 0.083333333333333) / x;
double tmp;
if ((y + 0.0007936500793651) <= -20000000.0) {
tmp = t_0;
} else if ((y + 0.0007936500793651) <= 0.0007936501) {
tmp = fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(fma(Float64(y * z), z, 0.083333333333333) / x) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -20000000.0) tmp = t_0; elseif (Float64(y + 0.0007936500793651) <= 0.0007936501) tmp = Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -20000000.0], t$95$0, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.0007936501], N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\\
\mathbf{if}\;y + 0.0007936500793651 \leq -20000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 0.0007936501:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -2e7 or 7.93650100000000054e-4 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 96.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6470.4
Applied rewrites70.4%
Taylor expanded in y around inf
Applied rewrites69.9%
if -2e7 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 7.93650100000000054e-4Initial program 93.0%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites57.7%
(FPCore (x y z)
:precision binary64
(if (<= x 2.6e+89)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (* (/ z x) z) (+ y 0.0007936500793651))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.6e+89) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((z / x) * z) * (y + 0.0007936500793651);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.6e+89) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.6e+89], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.6 \cdot 10^{+89}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if x < 2.6000000000000001e89Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6488.8
Applied rewrites88.8%
if 2.6000000000000001e89 < x Initial program 85.6%
Taylor expanded in z around 0
Applied rewrites74.4%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6424.0
Applied rewrites24.0%
Taylor expanded in z around inf
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
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6427.6
Applied rewrites27.6%
Final simplification66.6%
(FPCore (x y z) :precision binary64 (if (<= x 2.6e+89) (/ (fma (* (+ y 0.0007936500793651) z) z 0.083333333333333) x) (* (* (/ z x) z) (+ y 0.0007936500793651))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.6e+89) {
tmp = fma(((y + 0.0007936500793651) * z), z, 0.083333333333333) / x;
} else {
tmp = ((z / x) * z) * (y + 0.0007936500793651);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.6e+89) tmp = Float64(fma(Float64(Float64(y + 0.0007936500793651) * z), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.6e+89], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.6 \cdot 10^{+89}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(y + 0.0007936500793651\right) \cdot z, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if x < 2.6000000000000001e89Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6488.8
Applied rewrites88.8%
Taylor expanded in z around inf
Applied rewrites88.4%
if 2.6000000000000001e89 < x Initial program 85.6%
Taylor expanded in z around 0
Applied rewrites74.4%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6424.0
Applied rewrites24.0%
Taylor expanded in z around inf
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
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6427.6
Applied rewrites27.6%
Final simplification66.3%
(FPCore (x y z) :precision binary64 (/ (fma -0.0027777777777778 z 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(-0.0027777777777778, z, 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}
\end{array}
Initial program 94.5%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6464.2
Applied rewrites64.2%
Taylor expanded in z around 0
Applied rewrites24.7%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 94.5%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6464.2
Applied rewrites64.2%
Taylor expanded in z around 0
Applied rewrites20.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 2024243
(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)))