
(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
(let* ((t_0 (- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))))
(if (<= x 5.3e+35)
(+
t_0
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x))
(+ t_0 (* z (* z (+ (/ y x) (/ 0.0007936500793651 x))))))))
double code(double x, double y, double z) {
double t_0 = ((x + -0.5) * log(x)) - (x + -0.91893853320467);
double tmp;
if (x <= 5.3e+35) {
tmp = t_0 + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))
if (x <= 5.3d+35) then
tmp = t_0 + (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
else
tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((x + -0.5) * Math.log(x)) - (x + -0.91893853320467);
double tmp;
if (x <= 5.3e+35) {
tmp = t_0 + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
def code(x, y, z): t_0 = ((x + -0.5) * math.log(x)) - (x + -0.91893853320467) tmp = 0 if x <= 5.3e+35: tmp = t_0 + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) else: tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / x)))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) tmp = 0.0 if (x <= 5.3e+35) tmp = Float64(t_0 + Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(t_0 + Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((x + -0.5) * log(x)) - (x + -0.91893853320467); tmp = 0.0; if (x <= 5.3e+35) tmp = t_0 + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x); else tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5.3e+35], N[(t$95$0 + N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\\
\mathbf{if}\;x \leq 5.3 \cdot 10^{+35}:\\
\;\;\;\;t_0 + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if x < 5.30000000000000009e35Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 5.30000000000000009e35 < x Initial program 89.4%
associate-+l-89.4%
sub-neg89.4%
metadata-eval89.4%
sub-neg89.4%
metadata-eval89.4%
Applied egg-rr89.4%
Taylor expanded in z around inf 89.4%
+-commutative89.4%
associate-+r+89.4%
+-commutative89.4%
fma-def89.4%
associate-*r/89.4%
metadata-eval89.4%
associate-/l*92.6%
+-commutative92.6%
associate-/r/92.6%
unpow292.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in z around inf 92.6%
*-commutative92.6%
unpow292.6%
associate-*l*99.6%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))))
(if (<= t_0 -1e+150)
(- (/ y (/ (/ x z) z)) x)
(if (<= t_0 5e+88)
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))
(* z (* z (+ (/ y x) (/ 0.0007936500793651 x))))))))
double code(double x, double y, double z) {
double t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778);
double tmp;
if (t_0 <= -1e+150) {
tmp = (y / ((x / z) / z)) - x;
} else if (t_0 <= 5e+88) {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = z * (z * ((y / x) + (0.0007936500793651 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)
if (t_0 <= (-1d+150)) then
tmp = (y / ((x / z) / z)) - x
else if (t_0 <= 5d+88) then
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
else
tmp = z * (z * ((y / x) + (0.0007936500793651d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778);
double tmp;
if (t_0 <= -1e+150) {
tmp = (y / ((x / z) / z)) - x;
} else if (t_0 <= 5e+88) {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = z * (z * ((y / x) + (0.0007936500793651 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778) tmp = 0 if t_0 <= -1e+150: tmp = (y / ((x / z) / z)) - x elif t_0 <= 5e+88: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) else: tmp = z * (z * ((y / x) + (0.0007936500793651 / x))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -1e+150) tmp = Float64(Float64(y / Float64(Float64(x / z) / z)) - x); elseif (t_0 <= 5e+88) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); else tmp = Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -1e+150) tmp = (y / ((x / z) / z)) - x; elseif (t_0 <= 5e+88) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); else tmp = z * (z * ((y / x) + (0.0007936500793651 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+150], N[(N[(y / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[t$95$0, 5e+88], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+150}:\\
\;\;\;\;\frac{y}{\frac{\frac{x}{z}}{z}} - x\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -9.99999999999999981e149Initial program 85.7%
add-sqr-sqrt85.6%
pow285.6%
sub-neg85.6%
metadata-eval85.6%
Applied egg-rr85.6%
Taylor expanded in x around inf 76.7%
neg-mul-176.7%
Simplified76.7%
Taylor expanded in y around inf 76.6%
associate-/l*85.0%
unpow285.0%
associate-/r*87.8%
Simplified87.8%
if -9.99999999999999981e149 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 4.99999999999999997e88Initial program 99.5%
Taylor expanded in z around 0 93.9%
Taylor expanded in x around inf 91.0%
*-commutative91.0%
sub-neg91.0%
mul-1-neg91.0%
log-rec91.0%
remove-double-neg91.0%
metadata-eval91.0%
Simplified91.0%
if 4.99999999999999997e88 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 92.9%
add-sqr-sqrt92.8%
pow292.8%
sub-neg92.8%
metadata-eval92.8%
Applied egg-rr92.8%
Taylor expanded in x around inf 79.7%
neg-mul-179.7%
Simplified79.7%
Taylor expanded in z around inf 79.7%
unpow279.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in z around inf 80.2%
unpow280.2%
*-commutative80.2%
associate-*l*82.7%
associate-*r/82.7%
metadata-eval82.7%
Simplified82.7%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(if (<= x 15500000.0)
(+
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
(+ (- (* (log x) (- x 0.5)) x) 0.91893853320467))
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(* z (* z (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 15500000.0) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (((log(x) * (x - 0.5)) - x) + 0.91893853320467);
} else {
tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 15500000.0d0) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (((log(x) * (x - 0.5d0)) - x) + 0.91893853320467d0)
else
tmp = (((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))) + (z * (z * ((y / x) + (0.0007936500793651d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 15500000.0) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (((Math.log(x) * (x - 0.5)) - x) + 0.91893853320467);
} else {
tmp = (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 15500000.0: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (((math.log(x) * (x - 0.5)) - x) + 0.91893853320467) else: tmp = (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 15500000.0) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) + 0.91893853320467)); else tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 15500000.0) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (((log(x) * (x - 0.5)) - x) + 0.91893853320467); else tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 15500000.0], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 15500000:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(\left(\log x \cdot \left(x - 0.5\right) - x\right) + 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if x < 1.55e7Initial program 99.7%
if 1.55e7 < x Initial program 90.7%
associate-+l-90.7%
sub-neg90.7%
metadata-eval90.7%
sub-neg90.7%
metadata-eval90.7%
Applied egg-rr90.7%
Taylor expanded in z around inf 90.7%
+-commutative90.7%
associate-+r+90.7%
+-commutative90.7%
fma-def90.7%
associate-*r/90.7%
metadata-eval90.7%
associate-/l*93.5%
+-commutative93.5%
associate-/r/93.5%
unpow293.5%
+-commutative93.5%
Simplified93.5%
Taylor expanded in z around inf 93.5%
*-commutative93.5%
unpow293.5%
associate-*l*99.6%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 0.035)
(-
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
x)
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(* z (* z (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.035) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else {
tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.035d0) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) - x
else
tmp = (((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))) + (z * (z * ((y / x) + (0.0007936500793651d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.035) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else {
tmp = (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.035: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x else: tmp = (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.035) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x); else tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.035) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x; else tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.035], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.035:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} - x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if x < 0.035000000000000003Initial program 99.7%
add-sqr-sqrt99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 97.5%
neg-mul-197.5%
Simplified97.5%
if 0.035000000000000003 < x Initial program 90.8%
associate-+l-90.8%
sub-neg90.8%
metadata-eval90.8%
sub-neg90.8%
metadata-eval90.8%
Applied egg-rr90.8%
Taylor expanded in z around inf 90.8%
+-commutative90.8%
associate-+r+90.8%
+-commutative90.8%
fma-def90.8%
associate-*r/90.8%
metadata-eval90.8%
associate-/l*93.6%
+-commutative93.6%
associate-/r/93.6%
unpow293.6%
+-commutative93.6%
Simplified93.6%
Taylor expanded in z around inf 93.3%
*-commutative93.3%
unpow293.3%
associate-*l*99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))) (t_1 (* (+ y 0.0007936500793651) z)))
(if (<= x 1e+36)
(+ (/ (+ (* z (- t_1 0.0027777777777778)) 0.083333333333333) x) t_0)
(+ (* t_1 (/ z x)) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double t_1 = (y + 0.0007936500793651) * z;
double tmp;
if (x <= 1e+36) {
tmp = (((z * (t_1 - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = (t_1 * (z / x)) + t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
t_1 = (y + 0.0007936500793651d0) * z
if (x <= 1d+36) then
tmp = (((z * (t_1 - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + t_0
else
tmp = (t_1 * (z / x)) + t_0
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 t_1 = (y + 0.0007936500793651) * z;
double tmp;
if (x <= 1e+36) {
tmp = (((z * (t_1 - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = (t_1 * (z / x)) + t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) t_1 = (y + 0.0007936500793651) * z tmp = 0 if x <= 1e+36: tmp = (((z * (t_1 - 0.0027777777777778)) + 0.083333333333333) / x) + t_0 else: tmp = (t_1 * (z / x)) + t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) t_1 = Float64(Float64(y + 0.0007936500793651) * z) tmp = 0.0 if (x <= 1e+36) tmp = Float64(Float64(Float64(Float64(z * Float64(t_1 - 0.0027777777777778)) + 0.083333333333333) / x) + t_0); else tmp = Float64(Float64(t_1 * Float64(z / x)) + t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); t_1 = (y + 0.0007936500793651) * z; tmp = 0.0; if (x <= 1e+36) tmp = (((z * (t_1 - 0.0027777777777778)) + 0.083333333333333) / x) + t_0; else tmp = (t_1 * (z / x)) + t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, 1e+36], N[(N[(N[(N[(z * N[(t$95$1 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(t$95$1 * N[(z / x), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
t_1 := \left(y + 0.0007936500793651\right) \cdot z\\
\mathbf{if}\;x \leq 10^{+36}:\\
\;\;\;\;\frac{z \cdot \left(t_1 - 0.0027777777777778\right) + 0.083333333333333}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{z}{x} + t_0\\
\end{array}
\end{array}
if x < 1.00000000000000004e36Initial program 99.7%
Taylor expanded in x around inf 97.2%
*-commutative37.5%
sub-neg37.5%
mul-1-neg37.5%
log-rec37.5%
remove-double-neg37.5%
metadata-eval37.5%
Simplified97.2%
if 1.00000000000000004e36 < x Initial program 89.3%
associate-+l-89.3%
sub-neg89.3%
metadata-eval89.3%
sub-neg89.3%
metadata-eval89.3%
Applied egg-rr89.3%
*-un-lft-identity89.3%
add-sqr-sqrt89.3%
times-frac89.4%
*-commutative89.4%
fma-udef89.4%
fma-neg89.4%
metadata-eval89.4%
Applied egg-rr89.4%
associate-*l/89.4%
*-lft-identity89.4%
fma-def89.4%
*-commutative89.4%
fma-def89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in z around inf 89.4%
associate-/l*92.6%
associate-/r/92.6%
unpow292.6%
associate-*l/99.6%
associate-*l*98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around inf 99.0%
*-commutative99.0%
sub-neg99.0%
mul-1-neg99.0%
log-rec99.0%
remove-double-neg99.0%
metadata-eval99.0%
Simplified99.0%
Final simplification98.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (+ y 0.0007936500793651) z)))
(if (<= x 0.031)
(- (/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x) x)
(+ (- (* (+ x -0.5) (log x)) (+ x -0.91893853320467)) (* t_0 (/ z x))))))
double code(double x, double y, double z) {
double t_0 = (y + 0.0007936500793651) * z;
double tmp;
if (x <= 0.031) {
tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else {
tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (t_0 * (z / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (y + 0.0007936500793651d0) * z
if (x <= 0.031d0) then
tmp = (((z * (t_0 - 0.0027777777777778d0)) + 0.083333333333333d0) / x) - x
else
tmp = (((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))) + (t_0 * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y + 0.0007936500793651) * z;
double tmp;
if (x <= 0.031) {
tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else {
tmp = (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467)) + (t_0 * (z / x));
}
return tmp;
}
def code(x, y, z): t_0 = (y + 0.0007936500793651) * z tmp = 0 if x <= 0.031: tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x else: tmp = (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (t_0 * (z / x)) return tmp
function code(x, y, z) t_0 = Float64(Float64(y + 0.0007936500793651) * z) tmp = 0.0 if (x <= 0.031) tmp = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x); else tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(t_0 * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y + 0.0007936500793651) * z; tmp = 0.0; if (x <= 0.031) tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x; else tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (t_0 * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, 0.031], N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot z\\
\mathbf{if}\;x \leq 0.031:\\
\;\;\;\;\frac{z \cdot \left(t_0 - 0.0027777777777778\right) + 0.083333333333333}{x} - x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + t_0 \cdot \frac{z}{x}\\
\end{array}
\end{array}
if x < 0.031Initial program 99.7%
add-sqr-sqrt99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 97.5%
neg-mul-197.5%
Simplified97.5%
if 0.031 < x Initial program 90.8%
associate-+l-90.8%
sub-neg90.8%
metadata-eval90.8%
sub-neg90.8%
metadata-eval90.8%
Applied egg-rr90.8%
*-un-lft-identity90.8%
add-sqr-sqrt90.7%
times-frac90.8%
*-commutative90.8%
fma-udef90.8%
fma-neg90.8%
metadata-eval90.8%
Applied egg-rr90.8%
associate-*l/90.8%
*-lft-identity90.8%
fma-def90.8%
*-commutative90.8%
fma-def90.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in z around inf 90.6%
associate-/l*93.3%
associate-/r/93.3%
unpow293.3%
associate-*l/99.4%
associate-*l*98.7%
+-commutative98.7%
Simplified98.7%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (+ y 0.0007936500793651) z)))
(if (<= x 1.12)
(- (/ (+ (* z (- t_0 0.0027777777777778)) 0.083333333333333) x) x)
(+ (* t_0 (/ z x)) (* x (+ (log x) -1.0))))))
double code(double x, double y, double z) {
double t_0 = (y + 0.0007936500793651) * z;
double tmp;
if (x <= 1.12) {
tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else {
tmp = (t_0 * (z / x)) + (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) :: t_0
real(8) :: tmp
t_0 = (y + 0.0007936500793651d0) * z
if (x <= 1.12d0) then
tmp = (((z * (t_0 - 0.0027777777777778d0)) + 0.083333333333333d0) / x) - x
else
tmp = (t_0 * (z / x)) + (x * (log(x) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y + 0.0007936500793651) * z;
double tmp;
if (x <= 1.12) {
tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else {
tmp = (t_0 * (z / x)) + (x * (Math.log(x) + -1.0));
}
return tmp;
}
def code(x, y, z): t_0 = (y + 0.0007936500793651) * z tmp = 0 if x <= 1.12: tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x else: tmp = (t_0 * (z / x)) + (x * (math.log(x) + -1.0)) return tmp
function code(x, y, z) t_0 = Float64(Float64(y + 0.0007936500793651) * z) tmp = 0.0 if (x <= 1.12) tmp = Float64(Float64(Float64(Float64(z * Float64(t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x); else tmp = Float64(Float64(t_0 * Float64(z / x)) + Float64(x * Float64(log(x) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y + 0.0007936500793651) * z; tmp = 0.0; if (x <= 1.12) tmp = (((z * (t_0 - 0.0027777777777778)) + 0.083333333333333) / x) - x; else tmp = (t_0 * (z / x)) + (x * (log(x) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, 1.12], N[(N[(N[(N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], N[(N[(t$95$0 * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot z\\
\mathbf{if}\;x \leq 1.12:\\
\;\;\;\;\frac{z \cdot \left(t_0 - 0.0027777777777778\right) + 0.083333333333333}{x} - x\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{z}{x} + x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.1200000000000001Initial program 99.7%
add-sqr-sqrt99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 97.5%
neg-mul-197.5%
Simplified97.5%
if 1.1200000000000001 < x Initial program 90.8%
associate-+l-90.8%
sub-neg90.8%
metadata-eval90.8%
sub-neg90.8%
metadata-eval90.8%
Applied egg-rr90.8%
*-un-lft-identity90.8%
add-sqr-sqrt90.7%
times-frac90.8%
*-commutative90.8%
fma-udef90.8%
fma-neg90.8%
metadata-eval90.8%
Applied egg-rr90.8%
associate-*l/90.8%
*-lft-identity90.8%
fma-def90.8%
*-commutative90.8%
fma-def90.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in z around inf 90.6%
associate-/l*93.3%
associate-/r/93.3%
unpow293.3%
associate-*l/99.4%
associate-*l*98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in x around inf 98.4%
*-commutative98.4%
sub-neg98.4%
mul-1-neg98.4%
log-rec98.4%
remove-double-neg98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (<= x 1.2e+39) (+ x (/ (fma z (* (+ y 0.0007936500793651) z) 0.083333333333333) x)) (+ (* x (+ (log x) -1.0)) (* (/ y x) (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.2e+39) {
tmp = x + (fma(z, ((y + 0.0007936500793651) * z), 0.083333333333333) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((y / x) * (z * z));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.2e+39) tmp = Float64(x + Float64(fma(z, Float64(Float64(y + 0.0007936500793651) * z), 0.083333333333333) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y / x) * Float64(z * z))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.2e+39], N[(x + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2 \cdot 10^{+39}:\\
\;\;\;\;x + \frac{\mathsf{fma}\left(z, \left(y + 0.0007936500793651\right) \cdot z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{x} \cdot \left(z \cdot z\right)\\
\end{array}
\end{array}
if x < 1.2e39Initial program 99.7%
add-sqr-sqrt99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 93.3%
neg-mul-193.3%
Simplified93.3%
Taylor expanded in z around inf 92.7%
unpow292.7%
+-commutative92.7%
Simplified92.7%
expm1-log1p-u72.9%
expm1-udef72.9%
add-sqr-sqrt0.0%
sqrt-unprod73.6%
sqr-neg73.6%
sqrt-unprod73.6%
add-sqr-sqrt73.6%
associate-*l*73.6%
fma-def73.6%
Applied egg-rr73.6%
expm1-def73.6%
expm1-log1p93.3%
Simplified93.3%
if 1.2e39 < x Initial program 89.2%
add-cbrt-cube83.3%
pow383.3%
*-commutative83.3%
fma-udef83.3%
fma-neg83.3%
metadata-eval83.3%
Applied egg-rr83.3%
Taylor expanded in y around inf 81.2%
associate-/l*84.5%
associate-/r/82.7%
unpow282.7%
Simplified82.7%
Taylor expanded in x around inf 82.7%
*-commutative72.0%
sub-neg72.0%
mul-1-neg72.0%
log-rec72.0%
remove-double-neg72.0%
metadata-eval72.0%
Simplified82.7%
Final simplification88.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))))
(if (<= t_0 -20000.0)
(- (/ y (/ (/ x z) z)) x)
(if (<= t_0 2e+40)
(+ x (/ 0.083333333333333 x))
(* z (* z (+ (/ y x) (/ 0.0007936500793651 x))))))))
double code(double x, double y, double z) {
double t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778);
double tmp;
if (t_0 <= -20000.0) {
tmp = (y / ((x / z) / z)) - x;
} else if (t_0 <= 2e+40) {
tmp = x + (0.083333333333333 / x);
} else {
tmp = z * (z * ((y / x) + (0.0007936500793651 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)
if (t_0 <= (-20000.0d0)) then
tmp = (y / ((x / z) / z)) - x
else if (t_0 <= 2d+40) then
tmp = x + (0.083333333333333d0 / x)
else
tmp = z * (z * ((y / x) + (0.0007936500793651d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778);
double tmp;
if (t_0 <= -20000.0) {
tmp = (y / ((x / z) / z)) - x;
} else if (t_0 <= 2e+40) {
tmp = x + (0.083333333333333 / x);
} else {
tmp = z * (z * ((y / x) + (0.0007936500793651 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778) tmp = 0 if t_0 <= -20000.0: tmp = (y / ((x / z) / z)) - x elif t_0 <= 2e+40: tmp = x + (0.083333333333333 / x) else: tmp = z * (z * ((y / x) + (0.0007936500793651 / x))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -20000.0) tmp = Float64(Float64(y / Float64(Float64(x / z) / z)) - x); elseif (t_0 <= 2e+40) tmp = Float64(x + Float64(0.083333333333333 / x)); else tmp = Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -20000.0) tmp = (y / ((x / z) / z)) - x; elseif (t_0 <= 2e+40) tmp = x + (0.083333333333333 / x); else tmp = z * (z * ((y / x) + (0.0007936500793651 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -20000.0], N[(N[(y / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[t$95$0, 2e+40], N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)\\
\mathbf{if}\;t_0 \leq -20000:\\
\;\;\;\;\frac{y}{\frac{\frac{x}{z}}{z}} - x\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -2e4Initial program 87.2%
add-sqr-sqrt87.1%
pow287.1%
sub-neg87.1%
metadata-eval87.1%
Applied egg-rr87.1%
Taylor expanded in x around inf 73.8%
neg-mul-173.8%
Simplified73.8%
Taylor expanded in y around inf 72.3%
associate-/l*79.8%
unpow279.8%
associate-/r*82.3%
Simplified82.3%
if -2e4 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 2.00000000000000006e40Initial program 99.5%
add-sqr-sqrt99.1%
pow299.1%
sub-neg99.1%
metadata-eval99.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 43.3%
neg-mul-143.3%
Simplified43.3%
Taylor expanded in z around 0 42.3%
expm1-log1p-u38.5%
expm1-udef38.5%
add-sqr-sqrt0.0%
sqrt-unprod45.0%
sqr-neg45.0%
sqrt-unprod46.2%
add-sqr-sqrt46.2%
Applied egg-rr46.2%
expm1-def46.2%
expm1-log1p49.6%
Simplified49.6%
if 2.00000000000000006e40 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 93.4%
add-sqr-sqrt93.3%
pow293.3%
sub-neg93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Taylor expanded in x around inf 76.4%
neg-mul-176.4%
Simplified76.4%
Taylor expanded in z around inf 76.3%
unpow276.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in z around inf 77.0%
unpow277.0%
*-commutative77.0%
associate-*l*79.3%
associate-*r/79.3%
metadata-eval79.3%
Simplified79.3%
Final simplification67.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -6.2e-46) (not (<= z 2.2e-54))) (- (/ y (/ x (* z z))) x) (+ x (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.2e-46) || !(z <= 2.2e-54)) {
tmp = (y / (x / (z * z))) - x;
} else {
tmp = x + (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 <= (-6.2d-46)) .or. (.not. (z <= 2.2d-54))) then
tmp = (y / (x / (z * z))) - x
else
tmp = x + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6.2e-46) || !(z <= 2.2e-54)) {
tmp = (y / (x / (z * z))) - x;
} else {
tmp = x + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.2e-46) or not (z <= 2.2e-54): tmp = (y / (x / (z * z))) - x else: tmp = x + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.2e-46) || !(z <= 2.2e-54)) tmp = Float64(Float64(y / Float64(x / Float64(z * z))) - x); else tmp = Float64(x + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.2e-46) || ~((z <= 2.2e-54))) tmp = (y / (x / (z * z))) - x; else tmp = x + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.2e-46], N[Not[LessEqual[z, 2.2e-54]], $MachinePrecision]], N[(N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-46} \lor \neg \left(z \leq 2.2 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{y}{\frac{x}{z \cdot z}} - x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -6.2000000000000002e-46 or 2.2e-54 < z Initial program 92.3%
add-sqr-sqrt92.2%
pow292.2%
sub-neg92.2%
metadata-eval92.2%
Applied egg-rr92.2%
Taylor expanded in x around inf 74.0%
neg-mul-174.0%
Simplified74.0%
Taylor expanded in y around inf 45.7%
associate-/l*48.7%
unpow248.7%
Simplified48.7%
if -6.2000000000000002e-46 < z < 2.2e-54Initial program 99.4%
add-sqr-sqrt99.1%
pow299.1%
sub-neg99.1%
metadata-eval99.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 43.2%
neg-mul-143.2%
Simplified43.2%
Taylor expanded in z around 0 42.2%
expm1-log1p-u38.2%
expm1-udef38.2%
add-sqr-sqrt0.0%
sqrt-unprod44.1%
sqr-neg44.1%
sqrt-unprod45.9%
add-sqr-sqrt45.9%
Applied egg-rr45.9%
expm1-def45.9%
expm1-log1p49.4%
Simplified49.4%
Final simplification49.0%
(FPCore (x y z) :precision binary64 (if (<= z -2e-42) (- (/ y (/ x (* z z))) x) (if (<= z 5e-55) (+ x (/ 0.083333333333333 x)) (- (/ y (/ (/ x z) z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-42) {
tmp = (y / (x / (z * z))) - x;
} else if (z <= 5e-55) {
tmp = x + (0.083333333333333 / x);
} else {
tmp = (y / ((x / z) / z)) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2d-42)) then
tmp = (y / (x / (z * z))) - x
else if (z <= 5d-55) then
tmp = x + (0.083333333333333d0 / x)
else
tmp = (y / ((x / z) / z)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2e-42) {
tmp = (y / (x / (z * z))) - x;
} else if (z <= 5e-55) {
tmp = x + (0.083333333333333 / x);
} else {
tmp = (y / ((x / z) / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2e-42: tmp = (y / (x / (z * z))) - x elif z <= 5e-55: tmp = x + (0.083333333333333 / x) else: tmp = (y / ((x / z) / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2e-42) tmp = Float64(Float64(y / Float64(x / Float64(z * z))) - x); elseif (z <= 5e-55) tmp = Float64(x + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(y / Float64(Float64(x / z) / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2e-42) tmp = (y / (x / (z * z))) - x; elseif (z <= 5e-55) tmp = x + (0.083333333333333 / x); else tmp = (y / ((x / z) / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2e-42], N[(N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[z, 5e-55], N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-42}:\\
\;\;\;\;\frac{y}{\frac{x}{z \cdot z}} - x\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-55}:\\
\;\;\;\;x + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{x}{z}}{z}} - x\\
\end{array}
\end{array}
if z < -2.00000000000000008e-42Initial program 93.1%
add-sqr-sqrt93.0%
pow293.0%
sub-neg93.0%
metadata-eval93.0%
Applied egg-rr93.0%
Taylor expanded in x around inf 73.5%
neg-mul-173.5%
Simplified73.5%
Taylor expanded in y around inf 46.4%
associate-/l*50.8%
unpow250.8%
Simplified50.8%
if -2.00000000000000008e-42 < z < 5.0000000000000002e-55Initial program 99.4%
add-sqr-sqrt99.1%
pow299.1%
sub-neg99.1%
metadata-eval99.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 43.2%
neg-mul-143.2%
Simplified43.2%
Taylor expanded in z around 0 42.2%
expm1-log1p-u38.2%
expm1-udef38.2%
add-sqr-sqrt0.0%
sqrt-unprod44.1%
sqr-neg44.1%
sqrt-unprod45.9%
add-sqr-sqrt45.9%
Applied egg-rr45.9%
expm1-def45.9%
expm1-log1p49.4%
Simplified49.4%
if 5.0000000000000002e-55 < z Initial program 91.5%
add-sqr-sqrt91.4%
pow291.4%
sub-neg91.4%
metadata-eval91.4%
Applied egg-rr91.4%
Taylor expanded in x around inf 74.5%
neg-mul-174.5%
Simplified74.5%
Taylor expanded in y around inf 45.0%
associate-/l*46.3%
unpow246.3%
associate-/r*47.1%
Simplified47.1%
Final simplification49.2%
(FPCore (x y z) :precision binary64 (+ x (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return x + (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.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return x + (0.083333333333333 / x);
}
def code(x, y, z): return x + (0.083333333333333 / x)
function code(x, y, z) return Float64(x + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = x + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.083333333333333}{x}
\end{array}
Initial program 95.0%
add-sqr-sqrt94.8%
pow294.8%
sub-neg94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Taylor expanded in x around inf 62.4%
neg-mul-162.4%
Simplified62.4%
Taylor expanded in z around 0 18.9%
expm1-log1p-u16.9%
expm1-udef16.9%
add-sqr-sqrt0.0%
sqrt-unprod23.0%
sqr-neg23.0%
sqrt-unprod22.5%
add-sqr-sqrt22.5%
Applied egg-rr22.5%
expm1-def22.5%
expm1-log1p23.9%
Simplified23.9%
Final simplification23.9%
(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 95.0%
add-sqr-sqrt94.8%
pow294.8%
sub-neg94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Taylor expanded in x around inf 62.4%
neg-mul-162.4%
Simplified62.4%
Taylor expanded in z around 0 18.9%
Taylor expanded in x around inf 1.3%
mul-1-neg1.3%
Simplified1.3%
Final simplification1.3%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2023224
(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)))