
(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 2e+35)
(/
(fma
(+ (fma (- x 0.5) (log x) (- x)) 0.91893853320467)
x
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333))
x)
(+ (* (* (/ (+ y 0.0007936500793651) x) z) z) (* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e+35) {
tmp = fma((fma((x - 0.5), log(x), -x) + 0.91893853320467), x, fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + ((log(x) - 1.0) * x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2e+35) tmp = Float64(fma(Float64(fma(Float64(x - 0.5), log(x), Float64(-x)) + 0.91893853320467), x, fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z) + Float64(Float64(log(x) - 1.0) * x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2e+35], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x - 0.5, \log x, -x\right) + 0.91893853320467, x, \mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 1.9999999999999999e35Initial program 99.6%
Taylor expanded in x around 0
Applied rewrites99.7%
if 1.9999999999999999e35 < x Initial program 90.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/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
lower-/.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6498.0
Applied rewrites98.0%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
div-addN/A
lower-/.f64N/A
lower-+.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(-
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(-
(* (- 0.0027777777777778 (* (+ y 0.0007936500793651) z)) z)
0.083333333333333)
x))))
(if (<= t_0 -4e+95)
(* (* (/ z x) z) y)
(if (<= t_0 5e+307)
(-
(+
(fma (- x 0.5) (log x) 0.91893853320467)
(/ (fma -0.0027777777777778 z 0.083333333333333) x))
x)
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) - ((((0.0027777777777778 - ((y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x);
double tmp;
if (t_0 <= -4e+95) {
tmp = ((z / x) * z) * y;
} else if (t_0 <= 5e+307) {
tmp = (fma((x - 0.5), log(x), 0.91893853320467) + (fma(-0.0027777777777778, z, 0.083333333333333) / x)) - x;
} else {
tmp = fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) - Float64(Float64(Float64(Float64(0.0027777777777778 - Float64(Float64(y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x)) tmp = 0.0 if (t_0 <= -4e+95) tmp = Float64(Float64(Float64(z / x) * z) * y); elseif (t_0 <= 5e+307) tmp = Float64(Float64(fma(Float64(x - 0.5), log(x), 0.91893853320467) + Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x)) - x); else tmp = fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(0.0027777777777778 - N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+95], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 5e+307], N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) - \frac{\left(0.0027777777777778 - \left(y + 0.0007936500793651\right) \cdot z\right) \cdot z - 0.083333333333333}{x}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{+95}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\left(\mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467\right) + \frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\right) - x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.00000000000000008e95Initial program 90.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6490.2
Applied rewrites90.2%
Applied rewrites93.3%
if -4.00000000000000008e95 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 5e307Initial program 99.4%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites89.5%
if 5e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 88.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
lower-+.f6483.2
Applied rewrites83.2%
Applied rewrites86.8%
Final simplification89.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(-
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(-
(* (- 0.0027777777777778 (* (+ y 0.0007936500793651) z)) z)
0.083333333333333)
x))))
(if (<= t_0 -4e+95)
(* (* (/ z x) z) y)
(if (<= t_0 5e+307)
(-
(fma (log x) (+ -0.5 x) (/ 0.083333333333333 x))
(- x 0.91893853320467))
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) - ((((0.0027777777777778 - ((y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x);
double tmp;
if (t_0 <= -4e+95) {
tmp = ((z / x) * z) * y;
} else if (t_0 <= 5e+307) {
tmp = fma(log(x), (-0.5 + x), (0.083333333333333 / x)) - (x - 0.91893853320467);
} else {
tmp = fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) - Float64(Float64(Float64(Float64(0.0027777777777778 - Float64(Float64(y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x)) tmp = 0.0 if (t_0 <= -4e+95) tmp = Float64(Float64(Float64(z / x) * z) * y); elseif (t_0 <= 5e+307) tmp = Float64(fma(log(x), Float64(-0.5 + x), Float64(0.083333333333333 / x)) - Float64(x - 0.91893853320467)); else tmp = fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(0.0027777777777778 - N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+95], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 5e+307], N[(N[(N[Log[x], $MachinePrecision] * N[(-0.5 + x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) - \frac{\left(0.0027777777777778 - \left(y + 0.0007936500793651\right) \cdot z\right) \cdot z - 0.083333333333333}{x}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{+95}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\mathsf{fma}\left(\log x, -0.5 + x, \frac{0.083333333333333}{x}\right) - \left(x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -4.00000000000000008e95Initial program 90.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6490.2
Applied rewrites90.2%
Applied rewrites93.3%
if -4.00000000000000008e95 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 5e307Initial program 99.4%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites96.1%
Taylor expanded in z around 0
Applied rewrites89.3%
if 5e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 88.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
lower-+.f6483.2
Applied rewrites83.2%
Applied rewrites86.8%
Final simplification89.2%
(FPCore (x y z)
:precision binary64
(if (<=
(-
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(-
(* (- 0.0027777777777778 (* (+ y 0.0007936500793651) z)) z)
0.083333333333333)
x))
-4e+95)
(* (* (/ z x) z) y)
(+
(/
(fma (fma 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 (((0.91893853320467 + ((log(x) * (x - 0.5)) - x)) - ((((0.0027777777777778 - ((y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x)) <= -4e+95) {
tmp = ((z / x) * z) * y;
} else {
tmp = (fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) + ((log(x) - 1.0) * x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) - Float64(Float64(Float64(Float64(0.0027777777777778 - Float64(Float64(y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x)) <= -4e+95) tmp = Float64(Float64(Float64(z / x) * z) * y); else tmp = Float64(Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) + Float64(Float64(log(x) - 1.0) * x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(0.0027777777777778 - N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], -4e+95], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) - \frac{\left(0.0027777777777778 - \left(y + 0.0007936500793651\right) \cdot z\right) \cdot z - 0.083333333333333}{x} \leq -4 \cdot 10^{+95}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} + \left(\log x - 1\right) \cdot 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.00000000000000008e95Initial program 90.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6490.2
Applied rewrites90.2%
Applied rewrites93.3%
if -4.00000000000000008e95 < (+.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 96.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/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
lower-/.f64N/A
lower-/.f6499.1
Applied rewrites99.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6497.7
Applied rewrites97.7%
Taylor expanded in y around 0
associate-*r/N/A
metadata-evalN/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f6491.2
Applied rewrites91.2%
Final simplification91.5%
(FPCore (x y z)
:precision binary64
(if (<=
(-
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(-
(* (- 0.0027777777777778 (* (+ y 0.0007936500793651) z)) z)
0.083333333333333)
x))
-4e+95)
(* (* (/ z x) z) y)
(/
(fma (fma 0.0007936500793651 z -0.0027777777777778) z 0.083333333333333)
x)))
double code(double x, double y, double z) {
double tmp;
if (((0.91893853320467 + ((log(x) * (x - 0.5)) - x)) - ((((0.0027777777777778 - ((y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x)) <= -4e+95) {
tmp = ((z / x) * z) * y;
} else {
tmp = fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) - Float64(Float64(Float64(Float64(0.0027777777777778 - Float64(Float64(y + 0.0007936500793651) * z)) * z) - 0.083333333333333) / x)) <= -4e+95) tmp = Float64(Float64(Float64(z / x) * z) * y); else tmp = Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(0.0027777777777778 - N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], -4e+95], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) - \frac{\left(0.0027777777777778 - \left(y + 0.0007936500793651\right) \cdot z\right) \cdot z - 0.083333333333333}{x} \leq -4 \cdot 10^{+95}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 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.00000000000000008e95Initial program 90.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6490.2
Applied rewrites90.2%
Applied rewrites93.3%
if -4.00000000000000008e95 < (+.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 96.3%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites92.7%
Taylor expanded in x around 0
Applied rewrites54.1%
Final simplification58.7%
(FPCore (x y z) :precision binary64 (+ (fma (fma z (+ y 0.0007936500793651) -0.0027777777777778) (/ z x) (/ 0.083333333333333 x)) (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
double code(double x, double y, double z) {
return fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / x)) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
}
function code(x, y, z) return Float64(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x)) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) end
code[x_, y_, z_] := N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)
\end{array}
Initial program 95.6%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/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
lower-/.f64N/A
lower-/.f6498.8
Applied rewrites98.8%
Final simplification98.8%
(FPCore (x y z)
:precision binary64
(if (<= x 2e+21)
(+
(+
(/
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
x)
0.91893853320467)
(fma (log x) (- x 0.5) (- x)))
(+ (* (* (/ (+ y 0.0007936500793651) x) z) z) (* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e+21) {
tmp = ((fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333) / x) + 0.91893853320467) + fma(log(x), (x - 0.5), -x);
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + ((log(x) - 1.0) * x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2e+21) tmp = Float64(Float64(Float64(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333) / x) + 0.91893853320467) + fma(log(x), Float64(x - 0.5), Float64(-x))); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z) + Float64(Float64(log(x) - 1.0) * x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2e+21], N[(N[(N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+21}:\\
\;\;\;\;\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} + 0.91893853320467\right) + \mathsf{fma}\left(\log x, x - 0.5, -x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 2e21Initial program 99.6%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
if 2e21 < x Initial program 90.8%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/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
lower-/.f64N/A
lower-/.f6497.9
Applied rewrites97.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6498.0
Applied rewrites98.0%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
div-addN/A
lower-/.f64N/A
lower-+.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 0.2)
(/
(fma
(fma (log x) -0.5 0.91893853320467)
x
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333))
x)
(+
(* (* (/ (+ y 0.0007936500793651) x) z) z)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.2) {
tmp = fma(fma(log(x), -0.5, 0.91893853320467), x, fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.2) tmp = Float64(fma(fma(log(x), -0.5, 0.91893853320467), x, fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.2], N[(N[(N[(N[Log[x], $MachinePrecision] * -0.5 + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.2:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\log x, -0.5, 0.91893853320467\right), x, \mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\end{array}
\end{array}
if x < 0.20000000000000001Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites98.7%
if 0.20000000000000001 < x Initial program 91.7%
Taylor expanded in z around inf
associate-/l*N/A
div-add-revN/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6499.4
Applied rewrites99.4%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= x 1.0)
(/
(fma
(fma (log x) -0.5 0.91893853320467)
x
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333))
x)
(+ (* (* (/ (+ y 0.0007936500793651) x) z) z) (* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = fma(fma(log(x), -0.5, 0.91893853320467), x, fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + ((log(x) - 1.0) * x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(fma(fma(log(x), -0.5, 0.91893853320467), x, fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z) + Float64(Float64(log(x) - 1.0) * x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(N[(N[Log[x], $MachinePrecision] * -0.5 + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\log x, -0.5, 0.91893853320467\right), x, \mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites98.7%
if 1 < x Initial program 91.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/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
lower-/.f64N/A
lower-/.f6498.0
Applied rewrites98.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6497.1
Applied rewrites97.1%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
div-addN/A
lower-/.f64N/A
lower-+.f6498.5
Applied rewrites98.5%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(if (<= x 1.0)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(+ (* (* (/ (+ y 0.0007936500793651) x) z) z) (* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + ((log(x) - 1.0) * x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z) + Float64(Float64(log(x) - 1.0) * x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
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
lower-+.f6498.1
Applied rewrites98.1%
if 1 < x Initial program 91.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/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
lower-/.f64N/A
lower-/.f6498.0
Applied rewrites98.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6497.1
Applied rewrites97.1%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
div-addN/A
lower-/.f64N/A
lower-+.f6498.5
Applied rewrites98.5%
Final simplification98.3%
(FPCore (x y z)
:precision binary64
(if (<= x 3.8e+45)
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x))
(* (- (log x) 1.0) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.8e+45) {
tmp = fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / x));
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3.8e+45) tmp = fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x)); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3.8e+45], N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 3.8000000000000002e45Initial program 99.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
lower-+.f6491.5
Applied rewrites91.5%
Applied rewrites92.2%
if 3.8000000000000002e45 < x Initial program 90.8%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/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
lower-/.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6497.9
Applied rewrites97.9%
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.f6479.4
Applied rewrites79.4%
Final simplification86.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -1e+107)
(* (* (/ z x) z) y)
(if (<= t_0 1e+58)
(/
(fma
(fma 0.0007936500793651 z -0.0027777777777778)
z
0.083333333333333)
x)
(* (* (/ (+ y 0.0007936500793651) x) z) z)))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -1e+107) {
tmp = ((z / x) * z) * y;
} else if (t_0 <= 1e+58) {
tmp = fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (((y + 0.0007936500793651) / x) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -1e+107) tmp = Float64(Float64(Float64(z / x) * z) * y); elseif (t_0 <= 1e+58) tmp = Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+107], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e+58], N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / 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 + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+107}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{+58}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z\\
\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)) < -9.9999999999999997e106Initial program 91.3%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6479.7
Applied rewrites79.7%
Applied rewrites82.4%
if -9.9999999999999997e106 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 9.99999999999999944e57Initial program 99.4%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites98.5%
Taylor expanded in x around 0
Applied rewrites50.6%
if 9.99999999999999944e57 < (+.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 91.3%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6472.8
Applied rewrites72.8%
Final simplification62.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -1e+107)
(* (* (/ z x) z) y)
(if (<= t_0 50.0)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(* (/ (* 0.0007936500793651 z) x) z)))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -1e+107) {
tmp = ((z / x) * z) * y;
} else if (t_0 <= 50.0) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((0.0007936500793651 * z) / x) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -1e+107) tmp = Float64(Float64(Float64(z / x) * z) * y); elseif (t_0 <= 50.0) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(0.0007936500793651 * z) / x) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+107], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 50.0], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.0007936500793651 * z), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+107}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 50:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.0007936500793651 \cdot z}{x} \cdot z\\
\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)) < -9.9999999999999997e106Initial program 91.3%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6479.7
Applied rewrites79.7%
Applied rewrites82.4%
if -9.9999999999999997e106 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 50Initial program 99.4%
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
lower-+.f6450.4
Applied rewrites50.4%
Taylor expanded in z around 0
Applied rewrites49.2%
if 50 < (+.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 91.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites84.4%
Taylor expanded in z around inf
Applied rewrites61.4%
Applied rewrites62.7%
Applied rewrites62.7%
Final simplification58.5%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 50.0) (/ (fma -0.0027777777777778 z 0.083333333333333) x) (* (/ (* 0.0007936500793651 z) x) z)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 50.0) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((0.0007936500793651 * z) / x) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 50.0) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(0.0007936500793651 * z) / x) * 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], 50.0], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.0007936500793651 * z), $MachinePrecision] / x), $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 50:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.0007936500793651 \cdot z}{x} \cdot z\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 50Initial program 97.7%
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
lower-+.f6456.5
Applied rewrites56.5%
Taylor expanded in z around 0
Applied rewrites41.7%
if 50 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 91.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites84.4%
Taylor expanded in z around inf
Applied rewrites61.4%
Applied rewrites62.7%
Applied rewrites62.7%
Final simplification49.3%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 50.0) (/ (fma -0.0027777777777778 z 0.083333333333333) x) (* (* (/ z x) 0.0007936500793651) z)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 50.0) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((z / x) * 0.0007936500793651) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 50.0) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z / x) * 0.0007936500793651) * 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], 50.0], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * 0.0007936500793651), $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 50:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot 0.0007936500793651\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) < 50Initial program 97.7%
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
lower-+.f6456.5
Applied rewrites56.5%
Taylor expanded in z around 0
Applied rewrites41.7%
if 50 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 91.9%
Taylor expanded in y around 0
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
Applied rewrites84.4%
Taylor expanded in z around inf
Applied rewrites61.4%
Applied rewrites62.7%
Final simplification49.3%
(FPCore (x y z) :precision binary64 (fma (fma z (+ y 0.0007936500793651) -0.0027777777777778) (/ z x) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / x));
}
function code(x, y, z) return fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x)) end
code[x_, y_, z_] := N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)
\end{array}
Initial program 95.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
lower-+.f6461.9
Applied rewrites61.9%
Applied rewrites63.2%
Final simplification63.2%
(FPCore (x y z) :precision binary64 (/ (fma (fma (+ y 0.0007936500793651) z -0.0027777777777778) z 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}
\end{array}
Initial program 95.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
lower-+.f6461.9
Applied rewrites61.9%
Final simplification61.9%
(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 95.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
lower-+.f6461.9
Applied rewrites61.9%
Taylor expanded in z around 0
Applied rewrites30.5%
(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 95.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
lower-+.f6461.9
Applied rewrites61.9%
Taylor expanded in z around 0
Applied rewrites26.3%
(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 2024298
(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)))