
(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 18 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 1.65e-38)
(+
t_0
(/
1.0
(/
x
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333))))
(+
t_0
(+
(*
z
(-
(* z (+ (/ 0.0007936500793651 x) (/ y x)))
(/ 0.0027777777777778 x)))
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 1.65e-38) {
tmp = t_0 + (1.0 / (x / fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333)));
} else {
tmp = t_0 + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 1.65e-38) tmp = Float64(t_0 + Float64(1.0 / Float64(x / fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333)))); else tmp = Float64(t_0 + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 / x) + Float64(y / x))) - Float64(0.0027777777777778 / x))) + Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 1.65e-38], N[(t$95$0 + N[(1.0 / N[(x / N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 1.65 \cdot 10^{-38}:\\
\;\;\;\;t\_0 + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \left(z \cdot \left(z \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) - \frac{0.0027777777777778}{x}\right) + \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 1.6500000000000001e-38Initial program 99.5%
fma-neg99.5%
metadata-eval99.5%
fma-define99.5%
clear-num99.6%
inv-pow99.6%
fma-define99.6%
*-commutative99.6%
fma-undefine99.6%
Applied egg-rr99.6%
unpow-199.6%
fma-define99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
Simplified99.6%
if 1.6500000000000001e-38 < x Initial program 92.0%
Taylor expanded in z around 0 99.5%
fma-define99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
fma-undefine99.6%
Applied egg-rr99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 5e-25)
(+
(* x (+ (log x) -1.0))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(+
(*
z
(- (* z (+ (/ 0.0007936500793651 x) (/ y x))) (/ 0.0027777777777778 x)))
(/ 1.0 (* x 12.000000000000048))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e-25) {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (1.0 / (x * 12.000000000000048)));
}
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 <= 5d-25) then
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((z * ((z * ((0.0007936500793651d0 / x) + (y / x))) - (0.0027777777777778d0 / x))) + (1.0d0 / (x * 12.000000000000048d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5e-25) {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (1.0 / (x * 12.000000000000048)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e-25: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (1.0 / (x * 12.000000000000048))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e-25) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 / x) + Float64(y / x))) - Float64(0.0027777777777778 / x))) + Float64(1.0 / Float64(x * 12.000000000000048)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5e-25) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (1.0 / (x * 12.000000000000048))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e-25], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(z \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) - \frac{0.0027777777777778}{x}\right) + \frac{1}{x \cdot 12.000000000000048}\right)\\
\end{array}
\end{array}
if x < 4.99999999999999962e-25Initial program 99.5%
add-sqr-sqrt99.5%
pow299.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 99.5%
sub-neg99.5%
mul-1-neg99.5%
log-rec99.5%
remove-double-neg99.5%
metadata-eval99.5%
Simplified99.5%
if 4.99999999999999962e-25 < x Initial program 91.8%
Taylor expanded in z around 0 99.5%
fma-define99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
fma-undefine99.5%
Applied egg-rr99.5%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(if (<= x 5e-37)
(+
(* x (+ (log x) -1.0))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(+
(*
z
(- (* z (+ (/ 0.0007936500793651 x) (/ y x))) (/ 0.0027777777777778 x)))
(/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e-37) {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / 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 (x <= 5d-37) then
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((z * ((z * ((0.0007936500793651d0 / x) + (y / x))) - (0.0027777777777778d0 / x))) + (0.083333333333333d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5e-37) {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (0.083333333333333 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e-37: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (0.083333333333333 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e-37) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 / x) + Float64(y / x))) - Float64(0.0027777777777778 / x))) + Float64(0.083333333333333 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5e-37) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 / x))) + (0.083333333333333 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e-37], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(z \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) - \frac{0.0027777777777778}{x}\right) + \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 4.9999999999999997e-37Initial program 99.5%
add-sqr-sqrt99.5%
pow299.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 99.5%
sub-neg99.5%
mul-1-neg99.5%
log-rec99.5%
remove-double-neg99.5%
metadata-eval99.5%
Simplified99.5%
if 4.9999999999999997e-37 < x Initial program 92.0%
Taylor expanded in z around 0 99.5%
fma-define99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
fma-undefine99.6%
Applied egg-rr99.6%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(if (<= z -6e+105)
(+
(*
z
(+
(/ (* y (* z (+ 1.0 (* 0.0007936500793651 (/ 1.0 y))))) x)
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))
(if (<= z 4.5e-12)
(+
(- (* (log x) (+ x -0.5)) x)
(+ 0.91893853320467 (/ 1.0 (/ x 0.083333333333333))))
(* (* z z) (+ (/ 0.0007936500793651 x) (/ 1.0 (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -6e+105) {
tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x));
} else if (z <= 4.5e-12) {
tmp = ((log(x) * (x + -0.5)) - x) + (0.91893853320467 + (1.0 / (x / 0.083333333333333)));
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
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 <= (-6d+105)) then
tmp = (z * (((y * (z * (1.0d0 + (0.0007936500793651d0 * (1.0d0 / y))))) / x) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + (0.083333333333333d0 * (1.0d0 / x))
else if (z <= 4.5d-12) then
tmp = ((log(x) * (x + (-0.5d0))) - x) + (0.91893853320467d0 + (1.0d0 / (x / 0.083333333333333d0)))
else
tmp = (z * z) * ((0.0007936500793651d0 / x) + (1.0d0 / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6e+105) {
tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x));
} else if (z <= 4.5e-12) {
tmp = ((Math.log(x) * (x + -0.5)) - x) + (0.91893853320467 + (1.0 / (x / 0.083333333333333)));
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6e+105: tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)) elif z <= 4.5e-12: tmp = ((math.log(x) * (x + -0.5)) - x) + (0.91893853320467 + (1.0 / (x / 0.083333333333333))) else: tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6e+105) tmp = Float64(Float64(z * Float64(Float64(Float64(y * Float64(z * Float64(1.0 + Float64(0.0007936500793651 * Float64(1.0 / y))))) / x) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x))); elseif (z <= 4.5e-12) tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - x) + Float64(0.91893853320467 + Float64(1.0 / Float64(x / 0.083333333333333)))); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(1.0 / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6e+105) tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)); elseif (z <= 4.5e-12) tmp = ((log(x) * (x + -0.5)) - x) + (0.91893853320467 + (1.0 / (x / 0.083333333333333))); else tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6e+105], N[(N[(z * N[(N[(N[(y * N[(z * N[(1.0 + N[(0.0007936500793651 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-12], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.91893853320467 + N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+105}:\\
\;\;\;\;z \cdot \left(\frac{y \cdot \left(z \cdot \left(1 + 0.0007936500793651 \cdot \frac{1}{y}\right)\right)}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-12}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - x\right) + \left(0.91893853320467 + \frac{1}{\frac{x}{0.083333333333333}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{1}{\frac{x}{y}}\right)\\
\end{array}
\end{array}
if z < -6.0000000000000001e105Initial program 88.8%
associate-+l+88.8%
fma-neg88.8%
sub-neg88.8%
metadata-eval88.8%
fma-define88.8%
fma-neg88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in y around inf 38.2%
Taylor expanded in x around 0 46.7%
Taylor expanded in z around 0 90.6%
if -6.0000000000000001e105 < z < 4.49999999999999981e-12Initial program 98.0%
associate-+l+98.0%
fma-neg98.0%
sub-neg98.0%
metadata-eval98.0%
fma-define98.0%
fma-neg98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in z around 0 88.8%
clear-num92.4%
inv-pow92.4%
Applied egg-rr88.8%
unpow-192.4%
Simplified88.8%
fma-neg88.8%
*-commutative88.8%
Applied egg-rr88.8%
if 4.49999999999999981e-12 < z Initial program 93.4%
associate-+l+93.4%
fma-neg93.5%
sub-neg93.5%
metadata-eval93.5%
fma-define93.5%
fma-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in z around inf 82.9%
associate-*r/82.9%
metadata-eval82.9%
Simplified82.9%
unpow282.9%
Applied egg-rr82.9%
clear-num83.0%
inv-pow83.0%
Applied egg-rr83.0%
unpow-183.0%
Simplified83.0%
Final simplification87.8%
(FPCore (x y z)
:precision binary64
(if (<= z -1.15e+106)
(+
(*
z
(+
(/ (* y (* z (+ 1.0 (* 0.0007936500793651 (/ 1.0 y))))) x)
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))
(if (<= z 2.3e-11)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))
(* (* z z) (+ (/ 0.0007936500793651 x) (/ 1.0 (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.15e+106) {
tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x));
} else if (z <= 2.3e-11) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
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+106)) then
tmp = (z * (((y * (z * (1.0d0 + (0.0007936500793651d0 * (1.0d0 / y))))) / x) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + (0.083333333333333d0 * (1.0d0 / x))
else if (z <= 2.3d-11) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
else
tmp = (z * z) * ((0.0007936500793651d0 / x) + (1.0d0 / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.15e+106) {
tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x));
} else if (z <= 2.3e-11) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.15e+106: tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)) elif z <= 2.3e-11: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) else: tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.15e+106) tmp = Float64(Float64(z * Float64(Float64(Float64(y * Float64(z * Float64(1.0 + Float64(0.0007936500793651 * Float64(1.0 / y))))) / x) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x))); elseif (z <= 2.3e-11) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(1.0 / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.15e+106) tmp = (z * (((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) / x) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)); elseif (z <= 2.3e-11) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); else tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.15e+106], N[(N[(z * N[(N[(N[(y * N[(z * N[(1.0 + N[(0.0007936500793651 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-11], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+106}:\\
\;\;\;\;z \cdot \left(\frac{y \cdot \left(z \cdot \left(1 + 0.0007936500793651 \cdot \frac{1}{y}\right)\right)}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-11}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{1}{\frac{x}{y}}\right)\\
\end{array}
\end{array}
if z < -1.1500000000000001e106Initial program 88.8%
associate-+l+88.8%
fma-neg88.8%
sub-neg88.8%
metadata-eval88.8%
fma-define88.8%
fma-neg88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in y around inf 38.2%
Taylor expanded in x around 0 46.7%
Taylor expanded in z around 0 90.6%
if -1.1500000000000001e106 < z < 2.30000000000000014e-11Initial program 98.0%
Taylor expanded in z around 0 88.7%
if 2.30000000000000014e-11 < z Initial program 93.4%
associate-+l+93.4%
fma-neg93.5%
sub-neg93.5%
metadata-eval93.5%
fma-define93.5%
fma-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in z around inf 82.9%
associate-*r/82.9%
metadata-eval82.9%
Simplified82.9%
unpow282.9%
Applied egg-rr82.9%
clear-num83.0%
inv-pow83.0%
Applied egg-rr83.0%
unpow-183.0%
Simplified83.0%
Final simplification87.8%
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 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 = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / 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[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 95.2%
Final simplification95.2%
(FPCore (x y z)
:precision binary64
(+
(* x (+ (log x) -1.0))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 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 = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 95.2%
add-sqr-sqrt94.6%
pow294.6%
sub-neg94.6%
metadata-eval94.6%
*-commutative94.6%
Applied egg-rr94.6%
Taylor expanded in x around inf 94.7%
sub-neg94.7%
mul-1-neg94.7%
log-rec94.7%
remove-double-neg94.7%
metadata-eval94.7%
Simplified94.7%
Final simplification94.7%
(FPCore (x y z)
:precision binary64
(if (<= x 1.46e+102)
(/
(+
0.083333333333333
(*
z
(-
(* y (* z (+ 1.0 (* 0.0007936500793651 (/ 1.0 y)))))
0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.46e+102) {
tmp = (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 0.0027777777777778))) / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.46d+102) then
tmp = (0.083333333333333d0 + (z * ((y * (z * (1.0d0 + (0.0007936500793651d0 * (1.0d0 / y))))) - 0.0027777777777778d0))) / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.46e+102) {
tmp = (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 0.0027777777777778))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.46e+102: tmp = (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 0.0027777777777778))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.46e+102) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(y * Float64(z * Float64(1.0 + Float64(0.0007936500793651 * Float64(1.0 / y))))) - 0.0027777777777778))) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.46e+102) tmp = (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 0.0027777777777778))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.46e+102], N[(N[(0.083333333333333 + N[(z * N[(N[(y * N[(z * N[(1.0 + N[(0.0007936500793651 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.46 \cdot 10^{+102}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(y \cdot \left(z \cdot \left(1 + 0.0007936500793651 \cdot \frac{1}{y}\right)\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.4599999999999999e102Initial program 99.0%
associate-+l+99.0%
fma-neg99.0%
sub-neg99.0%
metadata-eval99.0%
fma-define99.0%
fma-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around inf 67.4%
Taylor expanded in x around 0 73.1%
Taylor expanded in z around 0 86.9%
if 1.4599999999999999e102 < x Initial program 88.0%
associate-+l+88.0%
fma-neg88.0%
sub-neg88.0%
metadata-eval88.0%
fma-define88.0%
fma-neg88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in z around 0 82.4%
Taylor expanded in x around inf 82.4%
sub-neg82.4%
mul-1-neg82.4%
log-rec82.4%
remove-double-neg82.4%
metadata-eval82.4%
Simplified82.4%
(FPCore (x y z)
:precision binary64
(if (<= z -6500.0)
(* (+ (/ 0.0007936500793651 x) (/ y x)) (* z z))
(if (<= z 2.4e-25)
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)
(* (* z z) (+ (/ 0.0007936500793651 x) (/ 1.0 (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -6500.0) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (z <= 2.4e-25) {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
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 <= (-6500.0d0)) then
tmp = ((0.0007936500793651d0 / x) + (y / x)) * (z * z)
else if (z <= 2.4d-25) then
tmp = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
else
tmp = (z * z) * ((0.0007936500793651d0 / x) + (1.0d0 / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6500.0) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (z <= 2.4e-25) {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6500.0: tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z) elif z <= 2.4e-25: tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x else: tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6500.0) tmp = Float64(Float64(Float64(0.0007936500793651 / x) + Float64(y / x)) * Float64(z * z)); elseif (z <= 2.4e-25) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(1.0 / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6500.0) tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z); elseif (z <= 2.4e-25) tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; else tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6500.0], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-25], N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6500:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-25}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{1}{\frac{x}{y}}\right)\\
\end{array}
\end{array}
if z < -6500Initial program 88.9%
associate-+l+88.9%
fma-neg88.9%
sub-neg88.9%
metadata-eval88.9%
fma-define88.9%
fma-neg88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in z around inf 78.1%
associate-*r/78.1%
metadata-eval78.1%
Simplified78.1%
unpow278.1%
Applied egg-rr78.1%
if -6500 < z < 2.40000000000000009e-25Initial program 99.3%
associate-+l+99.3%
fma-neg99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
fma-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 72.2%
Taylor expanded in x around 0 46.7%
Taylor expanded in y around 0 43.9%
if 2.40000000000000009e-25 < z Initial program 93.7%
associate-+l+93.7%
fma-neg93.8%
sub-neg93.8%
metadata-eval93.8%
fma-define93.8%
fma-neg93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in z around inf 79.1%
associate-*r/79.1%
metadata-eval79.1%
Simplified79.1%
unpow279.1%
Applied egg-rr79.1%
clear-num79.1%
inv-pow79.1%
Applied egg-rr79.1%
unpow-179.1%
Simplified79.1%
Final simplification61.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ y x) (* z z))))
(if (<= z -6500.0)
t_0
(if (<= z 8.6)
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)
(if (<= z 1.22e+82) (* (/ 0.0007936500793651 x) (* z z)) t_0)))))
double code(double x, double y, double z) {
double t_0 = (y / x) * (z * z);
double tmp;
if (z <= -6500.0) {
tmp = t_0;
} else if (z <= 8.6) {
tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
} else if (z <= 1.22e+82) {
tmp = (0.0007936500793651 / x) * (z * z);
} else {
tmp = 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) :: tmp
t_0 = (y / x) * (z * z)
if (z <= (-6500.0d0)) then
tmp = t_0
else if (z <= 8.6d0) then
tmp = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
else if (z <= 1.22d+82) then
tmp = (0.0007936500793651d0 / x) * (z * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y / x) * (z * z);
double tmp;
if (z <= -6500.0) {
tmp = t_0;
} else if (z <= 8.6) {
tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
} else if (z <= 1.22e+82) {
tmp = (0.0007936500793651 / x) * (z * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y / x) * (z * z) tmp = 0 if z <= -6500.0: tmp = t_0 elif z <= 8.6: tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x elif z <= 1.22e+82: tmp = (0.0007936500793651 / x) * (z * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y / x) * Float64(z * z)) tmp = 0.0 if (z <= -6500.0) tmp = t_0; elseif (z <= 8.6) tmp = Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x); elseif (z <= 1.22e+82) tmp = Float64(Float64(0.0007936500793651 / x) * Float64(z * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / x) * (z * z); tmp = 0.0; if (z <= -6500.0) tmp = t_0; elseif (z <= 8.6) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; elseif (z <= 1.22e+82) tmp = (0.0007936500793651 / x) * (z * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6500.0], t$95$0, If[LessEqual[z, 8.6], N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 1.22e+82], N[(N[(0.0007936500793651 / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \left(z \cdot z\right)\\
\mathbf{if}\;z \leq -6500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8.6:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{+82}:\\
\;\;\;\;\frac{0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -6500 or 1.22000000000000008e82 < z Initial program 89.9%
associate-+l+89.9%
fma-neg89.9%
sub-neg89.9%
metadata-eval89.9%
fma-define89.9%
fma-neg89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in z around inf 80.7%
associate-*r/80.7%
metadata-eval80.7%
Simplified80.7%
unpow280.7%
Applied egg-rr80.7%
Taylor expanded in y around inf 64.4%
if -6500 < z < 8.59999999999999964Initial program 99.3%
associate-+l+99.3%
fma-neg99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
fma-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 72.5%
Taylor expanded in x around 0 46.8%
Taylor expanded in z around 0 41.8%
if 8.59999999999999964 < z < 1.22000000000000008e82Initial program 99.5%
associate-+l+99.5%
fma-neg99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.6%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 78.4%
associate-*r/78.4%
metadata-eval78.4%
Simplified78.4%
unpow278.4%
Applied egg-rr78.4%
Taylor expanded in y around 0 78.4%
Final simplification53.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ y x) (* z z))))
(if (<= z -6500.0)
t_0
(if (<= z 10.0)
(/ 1.0 (/ x 0.083333333333333))
(if (<= z 2.7e+68) (* (/ 0.0007936500793651 x) (* z z)) t_0)))))
double code(double x, double y, double z) {
double t_0 = (y / x) * (z * z);
double tmp;
if (z <= -6500.0) {
tmp = t_0;
} else if (z <= 10.0) {
tmp = 1.0 / (x / 0.083333333333333);
} else if (z <= 2.7e+68) {
tmp = (0.0007936500793651 / x) * (z * z);
} else {
tmp = 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) :: tmp
t_0 = (y / x) * (z * z)
if (z <= (-6500.0d0)) then
tmp = t_0
else if (z <= 10.0d0) then
tmp = 1.0d0 / (x / 0.083333333333333d0)
else if (z <= 2.7d+68) then
tmp = (0.0007936500793651d0 / x) * (z * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y / x) * (z * z);
double tmp;
if (z <= -6500.0) {
tmp = t_0;
} else if (z <= 10.0) {
tmp = 1.0 / (x / 0.083333333333333);
} else if (z <= 2.7e+68) {
tmp = (0.0007936500793651 / x) * (z * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y / x) * (z * z) tmp = 0 if z <= -6500.0: tmp = t_0 elif z <= 10.0: tmp = 1.0 / (x / 0.083333333333333) elif z <= 2.7e+68: tmp = (0.0007936500793651 / x) * (z * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y / x) * Float64(z * z)) tmp = 0.0 if (z <= -6500.0) tmp = t_0; elseif (z <= 10.0) tmp = Float64(1.0 / Float64(x / 0.083333333333333)); elseif (z <= 2.7e+68) tmp = Float64(Float64(0.0007936500793651 / x) * Float64(z * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / x) * (z * z); tmp = 0.0; if (z <= -6500.0) tmp = t_0; elseif (z <= 10.0) tmp = 1.0 / (x / 0.083333333333333); elseif (z <= 2.7e+68) tmp = (0.0007936500793651 / x) * (z * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6500.0], t$95$0, If[LessEqual[z, 10.0], N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+68], N[(N[(0.0007936500793651 / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \left(z \cdot z\right)\\
\mathbf{if}\;z \leq -6500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 10:\\
\;\;\;\;\frac{1}{\frac{x}{0.083333333333333}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+68}:\\
\;\;\;\;\frac{0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -6500 or 2.69999999999999991e68 < z Initial program 89.9%
associate-+l+89.9%
fma-neg89.9%
sub-neg89.9%
metadata-eval89.9%
fma-define89.9%
fma-neg89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in z around inf 80.7%
associate-*r/80.7%
metadata-eval80.7%
Simplified80.7%
unpow280.7%
Applied egg-rr80.7%
Taylor expanded in y around inf 64.4%
if -6500 < z < 10Initial program 99.3%
associate-+l+99.3%
fma-neg99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
fma-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 93.1%
Taylor expanded in x around 0 40.0%
Taylor expanded in x around 0 41.4%
clear-num91.4%
inv-pow91.4%
Applied egg-rr41.4%
unpow-191.4%
Simplified41.4%
if 10 < z < 2.69999999999999991e68Initial program 99.5%
associate-+l+99.5%
fma-neg99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.6%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 78.4%
associate-*r/78.4%
metadata-eval78.4%
Simplified78.4%
unpow278.4%
Applied egg-rr78.4%
Taylor expanded in y around 0 78.4%
Final simplification53.3%
(FPCore (x y z)
:precision binary64
(if (<= z -6500.0)
(* (+ (/ 0.0007936500793651 x) (/ y x)) (* z z))
(if (<= z 9.5e-26)
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)
(* (* z z) (/ (+ 0.0007936500793651 y) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -6500.0) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (z <= 9.5e-26) {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
} else {
tmp = (z * z) * ((0.0007936500793651 + y) / 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 <= (-6500.0d0)) then
tmp = ((0.0007936500793651d0 / x) + (y / x)) * (z * z)
else if (z <= 9.5d-26) then
tmp = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
else
tmp = (z * z) * ((0.0007936500793651d0 + y) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6500.0) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (z <= 9.5e-26) {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
} else {
tmp = (z * z) * ((0.0007936500793651 + y) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6500.0: tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z) elif z <= 9.5e-26: tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x else: tmp = (z * z) * ((0.0007936500793651 + y) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6500.0) tmp = Float64(Float64(Float64(0.0007936500793651 / x) + Float64(y / x)) * Float64(z * z)); elseif (z <= 9.5e-26) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6500.0) tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z); elseif (z <= 9.5e-26) tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; else tmp = (z * z) * ((0.0007936500793651 + y) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6500.0], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-26], N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6500:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\
\end{array}
\end{array}
if z < -6500Initial program 88.9%
associate-+l+88.9%
fma-neg88.9%
sub-neg88.9%
metadata-eval88.9%
fma-define88.9%
fma-neg88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in z around inf 78.1%
associate-*r/78.1%
metadata-eval78.1%
Simplified78.1%
unpow278.1%
Applied egg-rr78.1%
if -6500 < z < 9.4999999999999995e-26Initial program 99.3%
associate-+l+99.3%
fma-neg99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
fma-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 72.2%
Taylor expanded in x around 0 46.7%
Taylor expanded in y around 0 43.9%
if 9.4999999999999995e-26 < z Initial program 93.7%
associate-+l+93.7%
fma-neg93.8%
sub-neg93.8%
metadata-eval93.8%
fma-define93.8%
fma-neg93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in z around inf 79.1%
associate-*r/79.1%
metadata-eval79.1%
Simplified79.1%
unpow279.1%
Applied egg-rr79.1%
Taylor expanded in x around 0 79.1%
Final simplification61.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.216) (not (<= z 1e-26))) (* (* z z) (/ (+ 0.0007936500793651 y) x)) (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.216) || !(z <= 1e-26)) {
tmp = (z * z) * ((0.0007936500793651 + y) / x);
} else {
tmp = (0.083333333333333 + (z * -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 <= (-0.216d0)) .or. (.not. (z <= 1d-26))) then
tmp = (z * z) * ((0.0007936500793651d0 + y) / x)
else
tmp = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.216) || !(z <= 1e-26)) {
tmp = (z * z) * ((0.0007936500793651 + y) / x);
} else {
tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.216) or not (z <= 1e-26): tmp = (z * z) * ((0.0007936500793651 + y) / x) else: tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.216) || !(z <= 1e-26)) tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x)); else tmp = Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.216) || ~((z <= 1e-26))) tmp = (z * z) * ((0.0007936500793651 + y) / x); else tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.216], N[Not[LessEqual[z, 1e-26]], $MachinePrecision]], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.216 \lor \neg \left(z \leq 10^{-26}\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\end{array}
\end{array}
if z < -0.215999999999999998 or 1e-26 < z Initial program 91.3%
associate-+l+91.3%
fma-neg91.3%
sub-neg91.3%
metadata-eval91.3%
fma-define91.3%
fma-neg91.3%
metadata-eval91.3%
Simplified91.3%
Taylor expanded in z around inf 77.7%
associate-*r/77.7%
metadata-eval77.7%
Simplified77.7%
unpow277.7%
Applied egg-rr77.7%
Taylor expanded in x around 0 77.7%
if -0.215999999999999998 < z < 1e-26Initial program 99.3%
associate-+l+99.3%
fma-neg99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
fma-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 72.4%
Taylor expanded in x around 0 46.6%
Taylor expanded in z around 0 43.8%
Final simplification61.3%
(FPCore (x y z)
:precision binary64
(if (<= z -0.216)
(* (+ (/ 0.0007936500793651 x) (/ y x)) (* z z))
(if (<= z 1.35e-25)
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)
(* (* z z) (/ (+ 0.0007936500793651 y) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.216) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (z <= 1.35e-25) {
tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
} else {
tmp = (z * z) * ((0.0007936500793651 + y) / 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 <= (-0.216d0)) then
tmp = ((0.0007936500793651d0 / x) + (y / x)) * (z * z)
else if (z <= 1.35d-25) then
tmp = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
else
tmp = (z * z) * ((0.0007936500793651d0 + y) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.216) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (z <= 1.35e-25) {
tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
} else {
tmp = (z * z) * ((0.0007936500793651 + y) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.216: tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z) elif z <= 1.35e-25: tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x else: tmp = (z * z) * ((0.0007936500793651 + y) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.216) tmp = Float64(Float64(Float64(0.0007936500793651 / x) + Float64(y / x)) * Float64(z * z)); elseif (z <= 1.35e-25) tmp = Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.216) tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z); elseif (z <= 1.35e-25) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; else tmp = (z * z) * ((0.0007936500793651 + y) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.216], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-25], N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.216:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-25}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x}\\
\end{array}
\end{array}
if z < -0.215999999999999998Initial program 89.2%
associate-+l+89.2%
fma-neg89.2%
sub-neg89.2%
metadata-eval89.2%
fma-define89.2%
fma-neg89.2%
metadata-eval89.2%
Simplified89.2%
Taylor expanded in z around inf 76.6%
associate-*r/76.6%
metadata-eval76.6%
Simplified76.6%
unpow276.6%
Applied egg-rr76.6%
if -0.215999999999999998 < z < 1.35000000000000008e-25Initial program 99.3%
associate-+l+99.3%
fma-neg99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
fma-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 72.4%
Taylor expanded in x around 0 46.6%
Taylor expanded in z around 0 43.8%
if 1.35000000000000008e-25 < z Initial program 93.7%
associate-+l+93.7%
fma-neg93.8%
sub-neg93.8%
metadata-eval93.8%
fma-define93.8%
fma-neg93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in z around inf 79.1%
associate-*r/79.1%
metadata-eval79.1%
Simplified79.1%
unpow279.1%
Applied egg-rr79.1%
Taylor expanded in x around 0 79.1%
Final simplification61.3%
(FPCore (x y z)
:precision binary64
(/
(+
0.083333333333333
(*
z
(-
(* y (* z (+ 1.0 (* 0.0007936500793651 (/ 1.0 y)))))
0.0027777777777778)))
x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 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.083333333333333d0 + (z * ((y * (z * (1.0d0 + (0.0007936500793651d0 * (1.0d0 / y))))) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(y * Float64(z * Float64(1.0 + Float64(0.0007936500793651 * Float64(1.0 / y))))) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((y * (z * (1.0 + (0.0007936500793651 * (1.0 / y))))) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(y * N[(z * N[(1.0 + N[(0.0007936500793651 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(y \cdot \left(z \cdot \left(1 + 0.0007936500793651 \cdot \frac{1}{y}\right)\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 95.2%
associate-+l+95.2%
fma-neg95.2%
sub-neg95.2%
metadata-eval95.2%
fma-define95.2%
fma-neg95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in y around inf 63.3%
Taylor expanded in x around 0 51.0%
Taylor expanded in z around 0 62.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -10.5) (not (<= z 10.0))) (* (/ 0.0007936500793651 x) (* z z)) (/ 1.0 (/ x 0.083333333333333))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -10.5) || !(z <= 10.0)) {
tmp = (0.0007936500793651 / x) * (z * z);
} else {
tmp = 1.0 / (x / 0.083333333333333);
}
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 <= (-10.5d0)) .or. (.not. (z <= 10.0d0))) then
tmp = (0.0007936500793651d0 / x) * (z * z)
else
tmp = 1.0d0 / (x / 0.083333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -10.5) || !(z <= 10.0)) {
tmp = (0.0007936500793651 / x) * (z * z);
} else {
tmp = 1.0 / (x / 0.083333333333333);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -10.5) or not (z <= 10.0): tmp = (0.0007936500793651 / x) * (z * z) else: tmp = 1.0 / (x / 0.083333333333333) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -10.5) || !(z <= 10.0)) tmp = Float64(Float64(0.0007936500793651 / x) * Float64(z * z)); else tmp = Float64(1.0 / Float64(x / 0.083333333333333)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -10.5) || ~((z <= 10.0))) tmp = (0.0007936500793651 / x) * (z * z); else tmp = 1.0 / (x / 0.083333333333333); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -10.5], N[Not[LessEqual[z, 10.0]], $MachinePrecision]], N[(N[(0.0007936500793651 / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10.5 \lor \neg \left(z \leq 10\right):\\
\;\;\;\;\frac{0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{0.083333333333333}}\\
\end{array}
\end{array}
if z < -10.5 or 10 < z Initial program 90.9%
associate-+l+90.9%
fma-neg91.0%
sub-neg91.0%
metadata-eval91.0%
fma-define91.0%
fma-neg91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in z around inf 79.5%
associate-*r/79.5%
metadata-eval79.5%
Simplified79.5%
unpow279.5%
Applied egg-rr79.5%
Taylor expanded in y around 0 49.1%
if -10.5 < z < 10Initial program 99.3%
associate-+l+99.3%
fma-neg99.3%
sub-neg99.3%
metadata-eval99.3%
fma-define99.3%
fma-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 93.7%
Taylor expanded in x around 0 40.5%
Taylor expanded in x around 0 41.9%
clear-num91.3%
inv-pow91.3%
Applied egg-rr41.9%
unpow-191.3%
Simplified41.9%
Final simplification45.5%
(FPCore (x y z) :precision binary64 (/ 1.0 (/ x 0.083333333333333)))
double code(double x, double y, double z) {
return 1.0 / (x / 0.083333333333333);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / (x / 0.083333333333333d0)
end function
public static double code(double x, double y, double z) {
return 1.0 / (x / 0.083333333333333);
}
def code(x, y, z): return 1.0 / (x / 0.083333333333333)
function code(x, y, z) return Float64(1.0 / Float64(x / 0.083333333333333)) end
function tmp = code(x, y, z) tmp = 1.0 / (x / 0.083333333333333); end
code[x_, y_, z_] := N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{x}{0.083333333333333}}
\end{array}
Initial program 95.2%
associate-+l+95.2%
fma-neg95.2%
sub-neg95.2%
metadata-eval95.2%
fma-define95.2%
fma-neg95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in z around 0 57.9%
Taylor expanded in x around 0 21.8%
Taylor expanded in x around 0 22.9%
clear-num95.5%
inv-pow95.5%
Applied egg-rr22.9%
unpow-195.5%
Simplified22.9%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 95.2%
associate-+l+95.2%
fma-neg95.2%
sub-neg95.2%
metadata-eval95.2%
fma-define95.2%
fma-neg95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in z around 0 57.9%
Taylor expanded in x around 0 21.8%
Taylor expanded in x around 0 22.9%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024116
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))