
(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 16 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 (<= z 1.5e+18)
(+
(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))
(/ (pow z 2.0) (/ x (+ y 0.0007936500793651))))))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.5e+18) {
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)) + (pow(z, 2.0) / (x / (y + 0.0007936500793651)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= 1.5e+18) 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((z ^ 2.0) / Float64(x / Float64(y + 0.0007936500793651)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, 1.5e+18], 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[Power[z, 2.0], $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{+18}:\\
\;\;\;\;\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) + \frac{{z}^{2}}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if z < 1.5e18Initial program 98.6%
sub-neg98.6%
associate-+l+98.6%
fma-def98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
unsub-neg98.7%
*-commutative98.7%
fma-def98.7%
fma-neg98.7%
metadata-eval98.7%
Simplified98.7%
if 1.5e18 < z Initial program 91.9%
Taylor expanded in z around inf 91.9%
associate-/l*98.5%
Simplified98.5%
Final simplification98.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= z 22000000000000.0)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ t_0 (/ (pow z 2.0) (/ x (+ y 0.0007936500793651)))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (z <= 22000000000000.0) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (pow(z, 2.0) / (x / (y + 0.0007936500793651)));
}
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 (z <= 22000000000000.0d0) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((z ** 2.0d0) / (x / (y + 0.0007936500793651d0)))
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 (z <= 22000000000000.0) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (Math.pow(z, 2.0) / (x / (y + 0.0007936500793651)));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if z <= 22000000000000.0: tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = t_0 + (math.pow(z, 2.0) / (x / (y + 0.0007936500793651))) 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 (z <= 22000000000000.0) 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((z ^ 2.0) / Float64(x / Float64(y + 0.0007936500793651)))); 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 (z <= 22000000000000.0) tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = t_0 + ((z ^ 2.0) / (x / (y + 0.0007936500793651))); 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[z, 22000000000000.0], 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[Power[z, 2.0], $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $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}\;z \leq 22000000000000:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{{z}^{2}}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if z < 2.2e13Initial program 98.6%
if 2.2e13 < z Initial program 92.0%
Taylor expanded in z around inf 92.0%
associate-/l*98.5%
Simplified98.5%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.85e+70) (not (<= z 6.8e+78)))
(* (+ y 0.0007936500793651) (/ (pow z 2.0) x))
(+
(* x (+ (log x) -1.0))
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+70) || !(z <= 6.8e+78)) {
tmp = (y + 0.0007936500793651) * (pow(z, 2.0) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / 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) :: tmp
if ((z <= (-1.85d+70)) .or. (.not. (z <= 6.8d+78))) then
tmp = (y + 0.0007936500793651d0) * ((z ** 2.0d0) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+70) || !(z <= 6.8e+78)) {
tmp = (y + 0.0007936500793651) * (Math.pow(z, 2.0) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.85e+70) or not (z <= 6.8e+78): tmp = (y + 0.0007936500793651) * (math.pow(z, 2.0) / x) else: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.85e+70) || !(z <= 6.8e+78)) tmp = Float64(Float64(y + 0.0007936500793651) * Float64((z ^ 2.0) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.85e+70) || ~((z <= 6.8e+78))) tmp = (y + 0.0007936500793651) * ((z ^ 2.0) / x); else tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.85e+70], N[Not[LessEqual[z, 6.8e+78]], $MachinePrecision]], N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+70} \lor \neg \left(z \leq 6.8 \cdot 10^{+78}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{{z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if z < -1.84999999999999994e70 or 6.80000000000000014e78 < z Initial program 93.8%
Taylor expanded in z around inf 93.8%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in x around 0 88.5%
+-commutative88.5%
Simplified88.5%
Taylor expanded in x around 0 85.5%
+-commutative85.5%
associate-*l/88.6%
+-commutative88.6%
Simplified88.6%
if -1.84999999999999994e70 < z < 6.80000000000000014e78Initial program 98.4%
Taylor expanded in x around inf 98.1%
sub-neg82.3%
mul-1-neg82.3%
log-rec82.3%
remove-double-neg82.3%
metadata-eval82.3%
Simplified98.1%
Taylor expanded in y around 0 89.3%
*-commutative89.3%
Simplified89.3%
Final simplification89.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -850000000000.0) (not (<= y 1.25e-6)))
(+ t_0 (/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((y <= -850000000000.0) || !(y <= 1.25e-6)) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / 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 = x * (log(x) + (-1.0d0))
if ((y <= (-850000000000.0d0)) .or. (.not. (y <= 1.25d-6))) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((y <= -850000000000.0) || !(y <= 1.25e-6)) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (y <= -850000000000.0) or not (y <= 1.25e-6): tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x) else: tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((y <= -850000000000.0) || !(y <= 1.25e-6)) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((y <= -850000000000.0) || ~((y <= 1.25e-6))) tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x); else tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -850000000000.0], N[Not[LessEqual[y, 1.25e-6]], $MachinePrecision]], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -850000000000 \lor \neg \left(y \leq 1.25 \cdot 10^{-6}\right):\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -8.5e11 or 1.2500000000000001e-6 < y Initial program 95.9%
Taylor expanded in x around inf 95.8%
sub-neg50.6%
mul-1-neg50.6%
log-rec50.6%
remove-double-neg50.6%
metadata-eval50.6%
Simplified95.8%
Taylor expanded in y around inf 95.8%
*-commutative95.8%
Simplified95.8%
if -8.5e11 < y < 1.2500000000000001e-6Initial program 97.6%
Taylor expanded in x around inf 97.3%
sub-neg65.1%
mul-1-neg65.1%
log-rec65.1%
remove-double-neg65.1%
metadata-eval65.1%
Simplified97.3%
Taylor expanded in y around 0 97.3%
*-commutative97.3%
Simplified97.3%
Final simplification96.6%
(FPCore (x y z)
:precision binary64
(if (<= z -2.35e+24)
(/ (* (pow z 2.0) (+ y 0.0007936500793651)) x)
(if (<= z 220000.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 1.0 (* x 12.000000000000048)))
(* (+ y 0.0007936500793651) (/ (pow z 2.0) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.35e+24) {
tmp = (pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 220000.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (y + 0.0007936500793651) * (pow(z, 2.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) :: tmp
if (z <= (-2.35d+24)) then
tmp = ((z ** 2.0d0) * (y + 0.0007936500793651d0)) / x
else if (z <= 220000.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (1.0d0 / (x * 12.000000000000048d0))
else
tmp = (y + 0.0007936500793651d0) * ((z ** 2.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.35e+24) {
tmp = (Math.pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 220000.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (y + 0.0007936500793651) * (Math.pow(z, 2.0) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.35e+24: tmp = (math.pow(z, 2.0) * (y + 0.0007936500793651)) / x elif z <= 220000.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)) else: tmp = (y + 0.0007936500793651) * (math.pow(z, 2.0) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.35e+24) tmp = Float64(Float64((z ^ 2.0) * Float64(y + 0.0007936500793651)) / x); elseif (z <= 220000.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 + 0.0007936500793651) * Float64((z ^ 2.0) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.35e+24) tmp = ((z ^ 2.0) * (y + 0.0007936500793651)) / x; elseif (z <= 220000.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)); else tmp = (y + 0.0007936500793651) * ((z ^ 2.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.35e+24], N[(N[(N[Power[z, 2.0], $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 220000.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 + 0.0007936500793651), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+24}:\\
\;\;\;\;\frac{{z}^{2} \cdot \left(y + 0.0007936500793651\right)}{x}\\
\mathbf{elif}\;z \leq 220000:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{{z}^{2}}{x}\\
\end{array}
\end{array}
if z < -2.35e24Initial program 96.2%
Taylor expanded in z around inf 96.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around 0 80.4%
+-commutative80.4%
Simplified80.4%
Taylor expanded in x around 0 80.7%
if -2.35e24 < z < 2.2e5Initial program 99.5%
clear-num99.5%
inv-pow99.5%
*-commutative99.5%
fma-udef99.5%
fma-neg99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 91.8%
*-commutative91.8%
Simplified91.8%
unpow-191.8%
Applied egg-rr91.8%
if 2.2e5 < z Initial program 92.2%
Taylor expanded in z around inf 91.3%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around 0 79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 74.6%
+-commutative74.6%
associate-*l/79.5%
+-commutative79.5%
Simplified79.5%
Final simplification86.1%
(FPCore (x y z)
:precision binary64
(if (<= z -2.65e+17)
(/ (* (pow z 2.0) (+ y 0.0007936500793651)) x)
(if (<= z 125000000.0)
(+
(* x (+ (log x) -1.0))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
(* (+ y 0.0007936500793651) (/ (pow z 2.0) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.65e+17) {
tmp = (pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 125000000.0) {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = (y + 0.0007936500793651) * (pow(z, 2.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) :: tmp
if (z <= (-2.65d+17)) then
tmp = ((z ** 2.0d0) * (y + 0.0007936500793651d0)) / x
else if (z <= 125000000.0d0) then
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
else
tmp = (y + 0.0007936500793651d0) * ((z ** 2.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.65e+17) {
tmp = (Math.pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 125000000.0) {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = (y + 0.0007936500793651) * (Math.pow(z, 2.0) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.65e+17: tmp = (math.pow(z, 2.0) * (y + 0.0007936500793651)) / x elif z <= 125000000.0: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) else: tmp = (y + 0.0007936500793651) * (math.pow(z, 2.0) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.65e+17) tmp = Float64(Float64((z ^ 2.0) * Float64(y + 0.0007936500793651)) / x); elseif (z <= 125000000.0) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); else tmp = Float64(Float64(y + 0.0007936500793651) * Float64((z ^ 2.0) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.65e+17) tmp = ((z ^ 2.0) * (y + 0.0007936500793651)) / x; elseif (z <= 125000000.0) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); else tmp = (y + 0.0007936500793651) * ((z ^ 2.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.65e+17], N[(N[(N[Power[z, 2.0], $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 125000000.0], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{{z}^{2} \cdot \left(y + 0.0007936500793651\right)}{x}\\
\mathbf{elif}\;z \leq 125000000:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{{z}^{2}}{x}\\
\end{array}
\end{array}
if z < -2.65e17Initial program 96.2%
Taylor expanded in z around inf 96.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around 0 80.4%
+-commutative80.4%
Simplified80.4%
Taylor expanded in x around 0 80.7%
if -2.65e17 < z < 1.25e8Initial program 99.5%
Taylor expanded in x around inf 99.1%
sub-neg91.4%
mul-1-neg91.4%
log-rec91.4%
remove-double-neg91.4%
metadata-eval91.4%
Simplified99.1%
Taylor expanded in z around 0 91.6%
*-commutative91.6%
Simplified91.6%
if 1.25e8 < z Initial program 92.2%
Taylor expanded in z around inf 91.3%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around 0 79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 74.6%
+-commutative74.6%
associate-*l/79.5%
+-commutative79.5%
Simplified79.5%
Final simplification86.0%
(FPCore (x y z)
:precision binary64
(if (<= z -1.55e+19)
(/ (* (pow z 2.0) (+ y 0.0007936500793651)) x)
(if (<= z 13500000.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))
(* (+ y 0.0007936500793651) (/ (pow z 2.0) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+19) {
tmp = (pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 13500000.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = (y + 0.0007936500793651) * (pow(z, 2.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) :: tmp
if (z <= (-1.55d+19)) then
tmp = ((z ** 2.0d0) * (y + 0.0007936500793651d0)) / x
else if (z <= 13500000.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
else
tmp = (y + 0.0007936500793651d0) * ((z ** 2.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+19) {
tmp = (Math.pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 13500000.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = (y + 0.0007936500793651) * (Math.pow(z, 2.0) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.55e+19: tmp = (math.pow(z, 2.0) * (y + 0.0007936500793651)) / x elif z <= 13500000.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) else: tmp = (y + 0.0007936500793651) * (math.pow(z, 2.0) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.55e+19) tmp = Float64(Float64((z ^ 2.0) * Float64(y + 0.0007936500793651)) / x); elseif (z <= 13500000.0) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(y + 0.0007936500793651) * Float64((z ^ 2.0) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.55e+19) tmp = ((z ^ 2.0) * (y + 0.0007936500793651)) / x; elseif (z <= 13500000.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); else tmp = (y + 0.0007936500793651) * ((z ^ 2.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.55e+19], N[(N[(N[Power[z, 2.0], $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 13500000.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 + 0.0007936500793651), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+19}:\\
\;\;\;\;\frac{{z}^{2} \cdot \left(y + 0.0007936500793651\right)}{x}\\
\mathbf{elif}\;z \leq 13500000:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{{z}^{2}}{x}\\
\end{array}
\end{array}
if z < -1.55e19Initial program 96.2%
Taylor expanded in z around inf 96.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around 0 80.4%
+-commutative80.4%
Simplified80.4%
Taylor expanded in x around 0 80.7%
if -1.55e19 < z < 1.35e7Initial program 99.5%
Taylor expanded in z around 0 91.8%
if 1.35e7 < z Initial program 92.2%
Taylor expanded in z around inf 91.3%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around 0 79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 74.6%
+-commutative74.6%
associate-*l/79.5%
+-commutative79.5%
Simplified79.5%
Final simplification86.1%
(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 96.8%
Final simplification96.8%
(FPCore (x y z)
:precision binary64
(if (<= z -3.5e+19)
(/ (* (pow z 2.0) (+ y 0.0007936500793651)) x)
(if (<= z 140000.0)
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))
(* (+ y 0.0007936500793651) (/ (pow z 2.0) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e+19) {
tmp = (pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 140000.0) {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = (y + 0.0007936500793651) * (pow(z, 2.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) :: tmp
if (z <= (-3.5d+19)) then
tmp = ((z ** 2.0d0) * (y + 0.0007936500793651d0)) / x
else if (z <= 140000.0d0) then
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
else
tmp = (y + 0.0007936500793651d0) * ((z ** 2.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e+19) {
tmp = (Math.pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 140000.0) {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = (y + 0.0007936500793651) * (Math.pow(z, 2.0) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.5e+19: tmp = (math.pow(z, 2.0) * (y + 0.0007936500793651)) / x elif z <= 140000.0: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) else: tmp = (y + 0.0007936500793651) * (math.pow(z, 2.0) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.5e+19) tmp = Float64(Float64((z ^ 2.0) * Float64(y + 0.0007936500793651)) / x); elseif (z <= 140000.0) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(y + 0.0007936500793651) * Float64((z ^ 2.0) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.5e+19) tmp = ((z ^ 2.0) * (y + 0.0007936500793651)) / x; elseif (z <= 140000.0) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); else tmp = (y + 0.0007936500793651) * ((z ^ 2.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.5e+19], N[(N[(N[Power[z, 2.0], $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 140000.0], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+19}:\\
\;\;\;\;\frac{{z}^{2} \cdot \left(y + 0.0007936500793651\right)}{x}\\
\mathbf{elif}\;z \leq 140000:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{{z}^{2}}{x}\\
\end{array}
\end{array}
if z < -3.5e19Initial program 96.2%
Taylor expanded in z around inf 96.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around 0 80.4%
+-commutative80.4%
Simplified80.4%
Taylor expanded in x around 0 80.7%
if -3.5e19 < z < 1.4e5Initial program 99.5%
Taylor expanded in z around 0 91.8%
Taylor expanded in x around inf 91.4%
sub-neg91.4%
mul-1-neg91.4%
log-rec91.4%
remove-double-neg91.4%
metadata-eval91.4%
Simplified91.4%
if 1.4e5 < z Initial program 92.2%
Taylor expanded in z around inf 91.3%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around 0 79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 74.6%
+-commutative74.6%
associate-*l/79.5%
+-commutative79.5%
Simplified79.5%
Final simplification85.9%
(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 96.8%
Taylor expanded in x around inf 96.6%
sub-neg58.4%
mul-1-neg58.4%
log-rec58.4%
remove-double-neg58.4%
metadata-eval58.4%
Simplified96.6%
Final simplification96.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.1e-9) (not (<= z 2.3e-32))) (* (+ y 0.0007936500793651) (/ (pow z 2.0) x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.1e-9) || !(z <= 2.3e-32)) {
tmp = (y + 0.0007936500793651) * (pow(z, 2.0) / x);
} else {
tmp = 0.083333333333333 / 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) :: tmp
if ((z <= (-1.1d-9)) .or. (.not. (z <= 2.3d-32))) then
tmp = (y + 0.0007936500793651d0) * ((z ** 2.0d0) / x)
else
tmp = 0.083333333333333d0 / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.1e-9) || !(z <= 2.3e-32)) {
tmp = (y + 0.0007936500793651) * (Math.pow(z, 2.0) / x);
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.1e-9) or not (z <= 2.3e-32): tmp = (y + 0.0007936500793651) * (math.pow(z, 2.0) / x) else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.1e-9) || !(z <= 2.3e-32)) tmp = Float64(Float64(y + 0.0007936500793651) * Float64((z ^ 2.0) / x)); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.1e-9) || ~((z <= 2.3e-32))) tmp = (y + 0.0007936500793651) * ((z ^ 2.0) / x); else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.1e-9], N[Not[LessEqual[z, 2.3e-32]], $MachinePrecision]], N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-9} \lor \neg \left(z \leq 2.3 \cdot 10^{-32}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{{z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.0999999999999999e-9 or 2.3000000000000001e-32 < z Initial program 94.6%
Taylor expanded in z around inf 93.3%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in x around 0 71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in x around 0 69.5%
+-commutative69.5%
associate-*l/72.0%
+-commutative72.0%
Simplified72.0%
if -1.0999999999999999e-9 < z < 2.3000000000000001e-32Initial program 99.5%
Taylor expanded in z around 0 93.6%
Taylor expanded in x around inf 93.1%
sub-neg93.1%
mul-1-neg93.1%
log-rec93.1%
remove-double-neg93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in x around 0 46.4%
Final simplification60.5%
(FPCore (x y z)
:precision binary64
(if (<= z -1.15e-12)
(/ (* (pow z 2.0) (+ y 0.0007936500793651)) x)
(if (<= z 3e-32)
(/ 0.083333333333333 x)
(* (+ y 0.0007936500793651) (/ (pow z 2.0) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.15e-12) {
tmp = (pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 3e-32) {
tmp = 0.083333333333333 / x;
} else {
tmp = (y + 0.0007936500793651) * (pow(z, 2.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) :: tmp
if (z <= (-1.15d-12)) then
tmp = ((z ** 2.0d0) * (y + 0.0007936500793651d0)) / x
else if (z <= 3d-32) then
tmp = 0.083333333333333d0 / x
else
tmp = (y + 0.0007936500793651d0) * ((z ** 2.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.15e-12) {
tmp = (Math.pow(z, 2.0) * (y + 0.0007936500793651)) / x;
} else if (z <= 3e-32) {
tmp = 0.083333333333333 / x;
} else {
tmp = (y + 0.0007936500793651) * (Math.pow(z, 2.0) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.15e-12: tmp = (math.pow(z, 2.0) * (y + 0.0007936500793651)) / x elif z <= 3e-32: tmp = 0.083333333333333 / x else: tmp = (y + 0.0007936500793651) * (math.pow(z, 2.0) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.15e-12) tmp = Float64(Float64((z ^ 2.0) * Float64(y + 0.0007936500793651)) / x); elseif (z <= 3e-32) tmp = Float64(0.083333333333333 / x); else tmp = Float64(Float64(y + 0.0007936500793651) * Float64((z ^ 2.0) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.15e-12) tmp = ((z ^ 2.0) * (y + 0.0007936500793651)) / x; elseif (z <= 3e-32) tmp = 0.083333333333333 / x; else tmp = (y + 0.0007936500793651) * ((z ^ 2.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.15e-12], N[(N[(N[Power[z, 2.0], $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 3e-32], N[(0.083333333333333 / x), $MachinePrecision], N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-12}:\\
\;\;\;\;\frac{{z}^{2} \cdot \left(y + 0.0007936500793651\right)}{x}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-32}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{{z}^{2}}{x}\\
\end{array}
\end{array}
if z < -1.14999999999999995e-12Initial program 96.7%
Taylor expanded in z around inf 96.7%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around 0 70.2%
+-commutative70.2%
Simplified70.2%
Taylor expanded in x around 0 70.5%
if -1.14999999999999995e-12 < z < 3e-32Initial program 99.5%
Taylor expanded in z around 0 93.5%
Taylor expanded in x around inf 93.1%
sub-neg93.1%
mul-1-neg93.1%
log-rec93.1%
remove-double-neg93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in x around 0 46.7%
if 3e-32 < z Initial program 93.1%
Taylor expanded in z around inf 90.9%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in x around 0 72.1%
+-commutative72.1%
Simplified72.1%
Taylor expanded in x around 0 68.0%
+-commutative68.0%
associate-*l/72.3%
+-commutative72.3%
Simplified72.3%
Final simplification60.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -8.5e-10) (not (<= z 3e-32))) (* (pow z 2.0) (/ y x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e-10) || !(z <= 3e-32)) {
tmp = pow(z, 2.0) * (y / x);
} else {
tmp = 0.083333333333333 / 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) :: tmp
if ((z <= (-8.5d-10)) .or. (.not. (z <= 3d-32))) then
tmp = (z ** 2.0d0) * (y / x)
else
tmp = 0.083333333333333d0 / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e-10) || !(z <= 3e-32)) {
tmp = Math.pow(z, 2.0) * (y / x);
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8.5e-10) or not (z <= 3e-32): tmp = math.pow(z, 2.0) * (y / x) else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8.5e-10) || !(z <= 3e-32)) tmp = Float64((z ^ 2.0) * Float64(y / x)); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -8.5e-10) || ~((z <= 3e-32))) tmp = (z ^ 2.0) * (y / x); else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.5e-10], N[Not[LessEqual[z, 3e-32]], $MachinePrecision]], N[(N[Power[z, 2.0], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-10} \lor \neg \left(z \leq 3 \cdot 10^{-32}\right):\\
\;\;\;\;{z}^{2} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -8.4999999999999996e-10 or 3e-32 < z Initial program 94.6%
Taylor expanded in z around inf 93.3%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around 0 71.3%
+-commutative71.3%
Simplified71.3%
Taylor expanded in y around inf 47.1%
*-commutative47.1%
associate-*r/49.5%
Simplified49.5%
if -8.4999999999999996e-10 < z < 3e-32Initial program 99.5%
Taylor expanded in z around 0 93.5%
Taylor expanded in x around inf 93.1%
sub-neg93.1%
mul-1-neg93.1%
log-rec93.1%
remove-double-neg93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in x around 0 46.7%
Final simplification48.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.1e-9) (not (<= z 3e-32))) (/ y (/ x (pow z 2.0))) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.1e-9) || !(z <= 3e-32)) {
tmp = y / (x / pow(z, 2.0));
} else {
tmp = 0.083333333333333 / 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) :: tmp
if ((z <= (-1.1d-9)) .or. (.not. (z <= 3d-32))) then
tmp = y / (x / (z ** 2.0d0))
else
tmp = 0.083333333333333d0 / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.1e-9) || !(z <= 3e-32)) {
tmp = y / (x / Math.pow(z, 2.0));
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.1e-9) or not (z <= 3e-32): tmp = y / (x / math.pow(z, 2.0)) else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.1e-9) || !(z <= 3e-32)) tmp = Float64(y / Float64(x / (z ^ 2.0))); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.1e-9) || ~((z <= 3e-32))) tmp = y / (x / (z ^ 2.0)); else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.1e-9], N[Not[LessEqual[z, 3e-32]], $MachinePrecision]], N[(y / N[(x / N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-9} \lor \neg \left(z \leq 3 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{y}{\frac{x}{{z}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.0999999999999999e-9 or 3e-32 < z Initial program 94.6%
Taylor expanded in z around inf 93.3%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in x around 0 71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in y around inf 47.4%
associate-/l*52.5%
Simplified52.5%
if -1.0999999999999999e-9 < z < 3e-32Initial program 99.5%
Taylor expanded in z around 0 93.6%
Taylor expanded in x around inf 93.1%
sub-neg93.1%
mul-1-neg93.1%
log-rec93.1%
remove-double-neg93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in x around 0 46.4%
Final simplification49.8%
(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 96.8%
Taylor expanded in z around 0 58.5%
Taylor expanded in x around inf 58.4%
sub-neg58.4%
mul-1-neg58.4%
log-rec58.4%
remove-double-neg58.4%
metadata-eval58.4%
Simplified58.4%
Taylor expanded in x around 0 23.0%
Final simplification23.0%
(FPCore (x y z) :precision binary64 (- x))
double code(double x, double y, double z) {
return -x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = -x
end function
public static double code(double x, double y, double z) {
return -x;
}
def code(x, y, z): return -x
function code(x, y, z) return Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 96.8%
Taylor expanded in z around 0 58.5%
Taylor expanded in x around 0 22.1%
Taylor expanded in x around inf 1.2%
neg-mul-11.2%
Simplified1.2%
Final simplification1.2%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024018
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- 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)))