
(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 13 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-6)
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e-6) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2e-6) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2e-6], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 1.99999999999999991e-6Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
unsub-neg99.7%
*-commutative99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 1.99999999999999991e-6 < x Initial program 89.8%
Taylor expanded in z around 0 99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 5e+302)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ (+ 0.083333333333333 t_0) x))
(+
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))
(+ 0.91893853320467 (* -0.5 (log x)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= 5e+302) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + t_0) / x);
} else {
tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (0.91893853320467 + (-0.5 * log(x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
if (t_0 <= 5d+302) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + t_0) / x)
else
tmp = ((z * ((z * ((0.0007936500793651d0 * (1.0d0 / x)) + (y / x))) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + (0.083333333333333d0 * (1.0d0 / x))) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= 5e+302) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + t_0) / x);
} else {
tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (0.91893853320467 + (-0.5 * Math.log(x)));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if t_0 <= 5e+302: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + t_0) / x) else: tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (0.91893853320467 + (-0.5 * math.log(x))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= 5e+302) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + t_0) / x)); else tmp = Float64(Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x))) + Float64(0.91893853320467 + Float64(-0.5 * log(x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= 5e+302) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + t_0) / x); else tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (0.91893853320467 + (-0.5 * log(x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+302], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + t$95$0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + t\_0}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5e302Initial program 99.1%
if 5e302 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 80.9%
Taylor expanded in x around 0 80.9%
Taylor expanded in z around 0 93.5%
Final simplification97.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 2e-6)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+
t_0
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 2e-6) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 2d-6) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((z * ((z * ((0.0007936500793651d0 * (1.0d0 / x)) + (y / x))) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 2e-6) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 2e-6: tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = t_0 + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 2e-6) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 2e-6) tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = t_0 + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2e-6], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 2 \cdot 10^{-6}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 1.99999999999999991e-6Initial program 99.7%
if 1.99999999999999991e-6 < x Initial program 89.8%
Taylor expanded in z around 0 99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= z -2e+170)
(/ (* y (pow z 2.0)) x)
(if (<= z -2e+32)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x))
(if (<= z 30000000.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 1.0 (* x 12.000000000000048)))
(* (/ y x) (pow z 2.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2e+170) {
tmp = (y * pow(z, 2.0)) / x;
} else if (z <= -2e+32) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
} else if (z <= 30000000.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (y / x) * pow(z, 2.0);
}
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) :: tmp
if (z <= (-2d+170)) then
tmp = (y * (z ** 2.0d0)) / x
else if (z <= (-2d+32)) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x)
else if (z <= 30000000.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (1.0d0 / (x * 12.000000000000048d0))
else
tmp = (y / x) * (z ** 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2e+170) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else if (z <= -2e+32) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
} else if (z <= 30000000.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (y / x) * Math.pow(z, 2.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2e+170: tmp = (y * math.pow(z, 2.0)) / x elif z <= -2e+32: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) elif z <= 30000000.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)) else: tmp = (y / x) * math.pow(z, 2.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2e+170) tmp = Float64(Float64(y * (z ^ 2.0)) / x); elseif (z <= -2e+32) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x)); elseif (z <= 30000000.0) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(1.0 / Float64(x * 12.000000000000048))); else tmp = Float64(Float64(y / x) * (z ^ 2.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2e+170) tmp = (y * (z ^ 2.0)) / x; elseif (z <= -2e+32) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x); elseif (z <= 30000000.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)); else tmp = (y / x) * (z ^ 2.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2e+170], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, -2e+32], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 30000000.0], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+170}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{elif}\;z \leq -2 \cdot 10^{+32}:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\mathbf{elif}\;z \leq 30000000:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot {z}^{2}\\
\end{array}
\end{array}
if z < -2.00000000000000007e170Initial program 86.2%
Taylor expanded in x around 0 86.2%
Taylor expanded in y around inf 77.1%
Taylor expanded in x around 0 77.1%
if -2.00000000000000007e170 < z < -2.00000000000000011e32Initial program 99.7%
Taylor expanded in x around 0 87.6%
Taylor expanded in y around 0 65.9%
*-commutative65.9%
Simplified65.9%
if -2.00000000000000011e32 < z < 3e7Initial program 99.5%
clear-num99.5%
inv-pow99.5%
*-commutative99.5%
fma-undefine99.5%
fma-neg99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 88.3%
*-commutative88.3%
Simplified88.3%
unpow-188.3%
Applied egg-rr88.3%
if 3e7 < z Initial program 86.6%
Taylor expanded in x around 0 74.6%
Taylor expanded in y around inf 65.1%
Taylor expanded in x around 0 65.2%
*-commutative65.2%
associate-*r/70.1%
Simplified70.1%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(if (<= z -2.2e+34)
(/ (* y (pow z 2.0)) x)
(if (<= z 350000.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 1.0 (* x 12.000000000000048)))
(* (/ y x) (pow z 2.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.2e+34) {
tmp = (y * pow(z, 2.0)) / x;
} else if (z <= 350000.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (y / x) * pow(z, 2.0);
}
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) :: tmp
if (z <= (-2.2d+34)) then
tmp = (y * (z ** 2.0d0)) / x
else if (z <= 350000.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (1.0d0 / (x * 12.000000000000048d0))
else
tmp = (y / x) * (z ** 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.2e+34) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else if (z <= 350000.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (y / x) * Math.pow(z, 2.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.2e+34: tmp = (y * math.pow(z, 2.0)) / x elif z <= 350000.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)) else: tmp = (y / x) * math.pow(z, 2.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.2e+34) tmp = Float64(Float64(y * (z ^ 2.0)) / x); elseif (z <= 350000.0) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(1.0 / Float64(x * 12.000000000000048))); else tmp = Float64(Float64(y / x) * (z ^ 2.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.2e+34) tmp = (y * (z ^ 2.0)) / x; elseif (z <= 350000.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)); else tmp = (y / x) * (z ^ 2.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.2e+34], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 350000.0], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+34}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{elif}\;z \leq 350000:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot {z}^{2}\\
\end{array}
\end{array}
if z < -2.2000000000000002e34Initial program 91.7%
Taylor expanded in x around 0 86.6%
Taylor expanded in y around inf 63.9%
Taylor expanded in x around 0 64.1%
if -2.2000000000000002e34 < z < 3.5e5Initial program 99.5%
clear-num99.5%
inv-pow99.5%
*-commutative99.5%
fma-undefine99.5%
fma-neg99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 87.7%
*-commutative87.7%
Simplified87.7%
unpow-187.7%
Applied egg-rr87.7%
if 3.5e5 < z Initial program 86.6%
Taylor expanded in x around 0 74.6%
Taylor expanded in y around inf 65.1%
Taylor expanded in x around 0 65.2%
*-commutative65.2%
associate-*r/70.1%
Simplified70.1%
Final simplification78.6%
(FPCore (x y z)
:precision binary64
(if (<= z -2.7e+44)
(/ (* y (pow z 2.0)) x)
(if (<= z 15500000.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))
(* (/ y x) (pow z 2.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.7e+44) {
tmp = (y * pow(z, 2.0)) / x;
} else if (z <= 15500000.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = (y / x) * pow(z, 2.0);
}
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) :: tmp
if (z <= (-2.7d+44)) then
tmp = (y * (z ** 2.0d0)) / x
else if (z <= 15500000.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
else
tmp = (y / x) * (z ** 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.7e+44) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else if (z <= 15500000.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = (y / x) * Math.pow(z, 2.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.7e+44: tmp = (y * math.pow(z, 2.0)) / x elif z <= 15500000.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) else: tmp = (y / x) * math.pow(z, 2.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.7e+44) tmp = Float64(Float64(y * (z ^ 2.0)) / x); elseif (z <= 15500000.0) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(y / x) * (z ^ 2.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.7e+44) tmp = (y * (z ^ 2.0)) / x; elseif (z <= 15500000.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); else tmp = (y / x) * (z ^ 2.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.7e+44], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 15500000.0], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+44}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{elif}\;z \leq 15500000:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot {z}^{2}\\
\end{array}
\end{array}
if z < -2.7e44Initial program 91.7%
Taylor expanded in x around 0 86.6%
Taylor expanded in y around inf 63.9%
Taylor expanded in x around 0 64.1%
if -2.7e44 < z < 1.55e7Initial program 99.5%
Taylor expanded in z around 0 87.6%
if 1.55e7 < z Initial program 86.6%
Taylor expanded in x around 0 74.6%
Taylor expanded in y around inf 65.1%
Taylor expanded in x around 0 65.2%
*-commutative65.2%
associate-*r/70.1%
Simplified70.1%
Final simplification78.6%
(FPCore (x y z)
:precision binary64
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
}
def code(x, y, z): return (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 94.9%
Final simplification94.9%
(FPCore (x y z)
:precision binary64
(if (<= x 9.4e+21)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x))
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 9.4e+21) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x);
} else {
tmp = x * (log(x) + -1.0);
}
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) :: tmp
if (x <= 9.4d+21) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x)
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 9.4e+21) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x);
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 9.4e+21: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 9.4e+21) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x)); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 9.4e+21) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 9.4e+21], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.4 \cdot 10^{+21}:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 9.4e21Initial program 99.7%
Taylor expanded in x around 0 98.9%
Taylor expanded in y around inf 87.9%
*-commutative87.9%
Simplified87.9%
if 9.4e21 < x Initial program 88.9%
sub-neg88.9%
associate-+l+88.9%
fma-define89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
unsub-neg89.0%
*-commutative89.0%
fma-define89.0%
fma-neg89.0%
metadata-eval89.0%
Simplified89.0%
Taylor expanded in z around 0 67.2%
Taylor expanded in x around inf 67.2%
sub-neg67.2%
mul-1-neg67.2%
log-rec67.2%
remove-double-neg67.2%
metadata-eval67.2%
Simplified67.2%
Final simplification78.8%
(FPCore (x y z)
:precision binary64
(if (<= z -4.2e+39)
(/ (* y (pow z 2.0)) x)
(if (<= z 80000000.0)
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))
(* (/ y x) (pow z 2.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.2e+39) {
tmp = (y * pow(z, 2.0)) / x;
} else if (z <= 80000000.0) {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = (y / x) * pow(z, 2.0);
}
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) :: tmp
if (z <= (-4.2d+39)) then
tmp = (y * (z ** 2.0d0)) / x
else if (z <= 80000000.0d0) then
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
else
tmp = (y / x) * (z ** 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.2e+39) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else if (z <= 80000000.0) {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = (y / x) * Math.pow(z, 2.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.2e+39: tmp = (y * math.pow(z, 2.0)) / x elif z <= 80000000.0: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) else: tmp = (y / x) * math.pow(z, 2.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.2e+39) tmp = Float64(Float64(y * (z ^ 2.0)) / x); elseif (z <= 80000000.0) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(y / x) * (z ^ 2.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.2e+39) tmp = (y * (z ^ 2.0)) / x; elseif (z <= 80000000.0) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); else tmp = (y / x) * (z ^ 2.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.2e+39], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 80000000.0], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+39}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{elif}\;z \leq 80000000:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot {z}^{2}\\
\end{array}
\end{array}
if z < -4.1999999999999997e39Initial program 91.7%
Taylor expanded in x around 0 86.6%
Taylor expanded in y around inf 63.9%
Taylor expanded in x around 0 64.1%
if -4.1999999999999997e39 < z < 8e7Initial program 99.5%
Taylor expanded in z around 0 87.6%
Taylor expanded in x around inf 87.5%
sub-neg87.5%
mul-1-neg87.5%
log-rec87.5%
remove-double-neg87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
if 8e7 < z Initial program 86.6%
Taylor expanded in x around 0 74.6%
Taylor expanded in y around inf 65.1%
Taylor expanded in x around 0 65.2%
*-commutative65.2%
associate-*r/70.1%
Simplified70.1%
Final simplification78.5%
(FPCore (x y z)
:precision binary64
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
}
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 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 94.9%
Taylor expanded in x around inf 94.7%
sub-neg56.0%
mul-1-neg56.0%
log-rec56.0%
remove-double-neg56.0%
metadata-eval56.0%
+-commutative56.0%
Simplified94.7%
Final simplification94.7%
(FPCore (x y z) :precision binary64 (if (<= x 4.8e+38) (* (/ y x) (pow z 2.0)) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+38) {
tmp = (y / x) * pow(z, 2.0);
} else {
tmp = x * (log(x) + -1.0);
}
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) :: tmp
if (x <= 4.8d+38) then
tmp = (y / x) * (z ** 2.0d0)
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+38) {
tmp = (y / x) * Math.pow(z, 2.0);
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.8e+38: tmp = (y / x) * math.pow(z, 2.0) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.8e+38) tmp = Float64(Float64(y / x) * (z ^ 2.0)); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.8e+38) tmp = (y / x) * (z ^ 2.0); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.8e+38], N[(N[(y / x), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.8 \cdot 10^{+38}:\\
\;\;\;\;\frac{y}{x} \cdot {z}^{2}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 4.80000000000000035e38Initial program 99.1%
Taylor expanded in x around 0 97.0%
Taylor expanded in y around inf 45.7%
Taylor expanded in x around 0 44.6%
*-commutative44.6%
associate-*r/42.6%
Simplified42.6%
if 4.80000000000000035e38 < x Initial program 89.3%
sub-neg89.3%
associate-+l+89.3%
fma-define89.4%
sub-neg89.4%
metadata-eval89.4%
+-commutative89.4%
unsub-neg89.4%
*-commutative89.4%
fma-define89.4%
fma-neg89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in z around 0 68.4%
Taylor expanded in x around inf 68.4%
sub-neg68.4%
mul-1-neg68.4%
log-rec68.4%
remove-double-neg68.4%
metadata-eval68.4%
Simplified68.4%
Final simplification53.5%
(FPCore (x y z) :precision binary64 (if (<= x 1.1e+38) (/ (* y (pow z 2.0)) x) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.1e+38) {
tmp = (y * pow(z, 2.0)) / x;
} else {
tmp = x * (log(x) + -1.0);
}
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) :: tmp
if (x <= 1.1d+38) then
tmp = (y * (z ** 2.0d0)) / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.1e+38) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.1e+38: tmp = (y * math.pow(z, 2.0)) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.1e+38) tmp = Float64(Float64(y * (z ^ 2.0)) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.1e+38) tmp = (y * (z ^ 2.0)) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.1e+38], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.1 \cdot 10^{+38}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.10000000000000003e38Initial program 99.1%
Taylor expanded in x around 0 97.0%
Taylor expanded in y around inf 45.7%
Taylor expanded in x around 0 44.6%
if 1.10000000000000003e38 < x Initial program 89.3%
sub-neg89.3%
associate-+l+89.3%
fma-define89.4%
sub-neg89.4%
metadata-eval89.4%
+-commutative89.4%
unsub-neg89.4%
*-commutative89.4%
fma-define89.4%
fma-neg89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in z around 0 68.4%
Taylor expanded in x around inf 68.4%
sub-neg68.4%
mul-1-neg68.4%
log-rec68.4%
remove-double-neg68.4%
metadata-eval68.4%
Simplified68.4%
Final simplification54.7%
(FPCore (x y z) :precision binary64 (* x (+ (log x) -1.0)))
double code(double x, double y, double z) {
return x * (log(x) + -1.0);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (log(x) + (-1.0d0))
end function
public static double code(double x, double y, double z) {
return x * (Math.log(x) + -1.0);
}
def code(x, y, z): return x * (math.log(x) + -1.0)
function code(x, y, z) return Float64(x * Float64(log(x) + -1.0)) end
function tmp = code(x, y, z) tmp = x * (log(x) + -1.0); end
code[x_, y_, z_] := N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right)
\end{array}
Initial program 94.9%
sub-neg94.9%
associate-+l+94.9%
fma-define95.0%
sub-neg95.0%
metadata-eval95.0%
+-commutative95.0%
unsub-neg95.0%
*-commutative95.0%
fma-define95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in z around 0 56.1%
Taylor expanded in x around inf 30.9%
sub-neg30.9%
mul-1-neg30.9%
log-rec30.9%
remove-double-neg30.9%
metadata-eval30.9%
Simplified30.9%
Final simplification30.9%
(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 2024078
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))