
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 3e+85)
(+
(fma (log x) (+ x -0.5) (- 0.91893853320467 x))
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ z (/ x (+ y 0.0007936500793651)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3e+85) {
tmp = fma(log(x), (x + -0.5), (0.91893853320467 - x)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651))));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3e+85) tmp = Float64(fma(log(x), Float64(x + -0.5), Float64(0.91893853320467 - x)) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z / Float64(x / Float64(y + 0.0007936500793651))))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3e+85], N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467 - x\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if x < 3e85Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
Applied egg-rr99.7%
sub-neg99.7%
*-commutative99.7%
fma-udef99.7%
neg-sub099.7%
+-commutative99.7%
associate--r+99.7%
metadata-eval99.7%
Simplified99.7%
if 3e85 < x Initial program 88.3%
Taylor expanded in z around inf 88.3%
+-commutative88.3%
associate-/l*92.7%
+-commutative92.7%
Simplified92.7%
unpow292.7%
*-un-lft-identity92.7%
times-frac99.5%
Applied egg-rr99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 3.8e+55)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (- (/ (log x) (/ 1.0 (+ x -0.5))) x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ z (/ x (+ y 0.0007936500793651)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.8e+55) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) / (1.0 / (x + -0.5))) - x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 3.8d+55) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + ((log(x) / (1.0d0 / (x + (-0.5d0)))) - x))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (z * (z / (x / (y + 0.0007936500793651d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.8e+55) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((Math.log(x) / (1.0 / (x + -0.5))) - x));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.8e+55: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((math.log(x) / (1.0 / (x + -0.5))) - x)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.8e+55) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) / Float64(1.0 / Float64(x + -0.5))) - x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z / Float64(x / Float64(y + 0.0007936500793651))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.8e+55) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) / (1.0 / (x + -0.5))) - x)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.8e+55], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] / N[(1.0 / N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{+55}:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\frac{\log x}{\frac{1}{x + -0.5}} - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if x < 3.8e55Initial program 99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
flip3-+99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
sub-neg99.7%
associate-/l*99.7%
*-un-lft-identity99.7%
associate-/l*99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 3.8e55 < x Initial program 89.0%
Taylor expanded in z around inf 89.0%
+-commutative89.0%
associate-/l*93.1%
+-commutative93.1%
Simplified93.1%
unpow293.1%
*-un-lft-identity93.1%
times-frac99.5%
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 176000000.0)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
t_0)
(+ t_0 (* z (/ z (/ x (+ y 0.0007936500793651))))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 176000000.0) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (z * (z / (x / (y + 0.0007936500793651))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 176000000.0d0) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + t_0
else
tmp = t_0 + (z * (z / (x / (y + 0.0007936500793651d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 176000000.0) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (z * (z / (x / (y + 0.0007936500793651))));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 176000000.0: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0 else: tmp = t_0 + (z * (z / (x / (y + 0.0007936500793651)))) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 176000000.0) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0); else tmp = Float64(t_0 + Float64(z * Float64(z / Float64(x / Float64(y + 0.0007936500793651))))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 176000000.0) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0; else tmp = t_0 + (z * (z / (x / (y + 0.0007936500793651)))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 176000000.0], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(z * N[(z / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 176000000:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + z \cdot \frac{z}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if x < 1.76e8Initial program 99.7%
if 1.76e8 < x Initial program 90.9%
Taylor expanded in z around inf 90.9%
+-commutative90.9%
associate-/l*94.3%
+-commutative94.3%
Simplified94.3%
unpow294.3%
*-un-lft-identity94.3%
times-frac99.5%
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 9e+143)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
t_0)
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 9e+143) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (x <= 9d+143) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + t_0
else
tmp = t_0 + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (x <= 9e+143) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 9e+143: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0 else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 9e+143) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0); else tmp = Float64(t_0 + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 9e+143) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0; else tmp = t_0 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 9e+143], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 9 \cdot 10^{+143}:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 8.9999999999999993e143Initial program 99.2%
associate-+l-99.2%
sub-neg99.2%
sub-neg99.2%
metadata-eval99.2%
metadata-eval99.2%
Applied egg-rr99.2%
sub-neg99.2%
*-commutative99.2%
fma-udef99.3%
neg-sub099.3%
+-commutative99.3%
associate--r+99.3%
metadata-eval99.3%
Simplified99.3%
fma-udef99.2%
*-commutative99.2%
associate-+r-99.2%
*-commutative99.2%
Applied egg-rr99.2%
Taylor expanded in x around inf 97.4%
sub-neg97.4%
log-rec97.4%
mul-1-neg97.4%
associate-*r*97.4%
metadata-eval97.4%
*-lft-identity97.4%
metadata-eval97.4%
Simplified97.4%
if 8.9999999999999993e143 < x Initial program 85.7%
Taylor expanded in z around 0 92.2%
Taylor expanded in x around inf 92.3%
Taylor expanded in x around 0 92.3%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (<= x 0.29)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ z (/ x (+ y 0.0007936500793651)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.29) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.29d0) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (z * (z / (x / (y + 0.0007936500793651d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.29) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.29: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.29) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z / Float64(x / Float64(y + 0.0007936500793651))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.29) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z / (x / (y + 0.0007936500793651)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.29], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.29:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if x < 0.28999999999999998Initial program 99.8%
Taylor expanded in x around 0 99.1%
if 0.28999999999999998 < x Initial program 91.4%
Taylor expanded in z around inf 90.5%
+-commutative90.5%
associate-/l*93.7%
+-commutative93.7%
Simplified93.7%
unpow293.7%
*-un-lft-identity93.7%
times-frac98.5%
Applied egg-rr98.5%
Final simplification98.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (/ 0.083333333333333 x) (* x (- -1.0 (log1p (+ x -1.0)))))))
(if (<= z -1.65e+114)
t_0
(if (<= z 1.15e+65)
(+ (/ 0.083333333333333 x) (* x (- -1.0 (log (/ 1.0 x)))))
(if (or (<= z 4.5e+132) (not (<= z 4.8e+210)))
t_0
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))))))
double code(double x, double y, double z) {
double t_0 = (0.083333333333333 / x) + (x * (-1.0 - log1p((x + -1.0))));
double tmp;
if (z <= -1.65e+114) {
tmp = t_0;
} else if (z <= 1.15e+65) {
tmp = (0.083333333333333 / x) + (x * (-1.0 - log((1.0 / x))));
} else if ((z <= 4.5e+132) || !(z <= 4.8e+210)) {
tmp = t_0;
} else {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (0.083333333333333 / x) + (x * (-1.0 - Math.log1p((x + -1.0))));
double tmp;
if (z <= -1.65e+114) {
tmp = t_0;
} else if (z <= 1.15e+65) {
tmp = (0.083333333333333 / x) + (x * (-1.0 - Math.log((1.0 / x))));
} else if ((z <= 4.5e+132) || !(z <= 4.8e+210)) {
tmp = t_0;
} else {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = (0.083333333333333 / x) + (x * (-1.0 - math.log1p((x + -1.0)))) tmp = 0 if z <= -1.65e+114: tmp = t_0 elif z <= 1.15e+65: tmp = (0.083333333333333 / x) + (x * (-1.0 - math.log((1.0 / x)))) elif (z <= 4.5e+132) or not (z <= 4.8e+210): tmp = t_0 else: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log1p(Float64(x + -1.0))))) tmp = 0.0 if (z <= -1.65e+114) tmp = t_0; elseif (z <= 1.15e+65) tmp = Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log(Float64(1.0 / x))))); elseif ((z <= 4.5e+132) || !(z <= 4.8e+210)) tmp = t_0; else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+114], t$95$0, If[LessEqual[z, 1.15e+65], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.5e+132], N[Not[LessEqual[z, 4.8e+210]], $MachinePrecision]], t$95$0, N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+114}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+65}:\\
\;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \log \left(\frac{1}{x}\right)\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+132} \lor \neg \left(z \leq 4.8 \cdot 10^{+210}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.65e114 or 1.15e65 < z < 4.49999999999999972e132 or 4.79999999999999977e210 < z Initial program 95.3%
Taylor expanded in z around 0 8.5%
Taylor expanded in x around inf 8.5%
add-sqr-sqrt2.7%
log1p-expm1-u2.7%
sqrt-unprod3.0%
log-rec3.0%
log-rec3.0%
sqr-neg3.0%
sqrt-unprod0.3%
add-sqr-sqrt43.8%
expm1-udef43.8%
add-exp-log43.8%
Applied egg-rr43.8%
if -1.65e114 < z < 1.15e65Initial program 98.3%
Taylor expanded in z around 0 82.6%
Taylor expanded in x around inf 80.3%
if 4.49999999999999972e132 < z < 4.79999999999999977e210Initial program 78.7%
Taylor expanded in z around 0 35.0%
Taylor expanded in x around inf 35.2%
Taylor expanded in x around 0 35.2%
Final simplification65.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (/ 0.083333333333333 x) (* x (- -1.0 (log1p (+ x -1.0)))))))
(if (<= z -1.25e+114)
t_0
(if (<= z 2.3e+69)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))
(if (or (<= z 5.6e+132) (not (<= z 1.9e+210)))
t_0
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))))))
double code(double x, double y, double z) {
double t_0 = (0.083333333333333 / x) + (x * (-1.0 - log1p((x + -1.0))));
double tmp;
if (z <= -1.25e+114) {
tmp = t_0;
} else if (z <= 2.3e+69) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else if ((z <= 5.6e+132) || !(z <= 1.9e+210)) {
tmp = t_0;
} else {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (0.083333333333333 / x) + (x * (-1.0 - Math.log1p((x + -1.0))));
double tmp;
if (z <= -1.25e+114) {
tmp = t_0;
} else if (z <= 2.3e+69) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else if ((z <= 5.6e+132) || !(z <= 1.9e+210)) {
tmp = t_0;
} else {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = (0.083333333333333 / x) + (x * (-1.0 - math.log1p((x + -1.0)))) tmp = 0 if z <= -1.25e+114: tmp = t_0 elif z <= 2.3e+69: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) elif (z <= 5.6e+132) or not (z <= 1.9e+210): tmp = t_0 else: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log1p(Float64(x + -1.0))))) tmp = 0.0 if (z <= -1.25e+114) tmp = t_0; elseif (z <= 2.3e+69) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); elseif ((z <= 5.6e+132) || !(z <= 1.9e+210)) tmp = t_0; else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+114], t$95$0, If[LessEqual[z, 2.3e+69], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 5.6e+132], N[Not[LessEqual[z, 1.9e+210]], $MachinePrecision]], t$95$0, N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+114}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+69}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+132} \lor \neg \left(z \leq 1.9 \cdot 10^{+210}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.25e114 or 2.30000000000000017e69 < z < 5.5999999999999998e132 or 1.90000000000000014e210 < z Initial program 95.3%
Taylor expanded in z around 0 8.5%
Taylor expanded in x around inf 8.5%
add-sqr-sqrt2.7%
log1p-expm1-u2.7%
sqrt-unprod3.0%
log-rec3.0%
log-rec3.0%
sqr-neg3.0%
sqrt-unprod0.3%
add-sqr-sqrt43.8%
expm1-udef43.8%
add-exp-log43.8%
Applied egg-rr43.8%
if -1.25e114 < z < 2.30000000000000017e69Initial program 98.3%
Taylor expanded in z around 0 82.6%
if 5.5999999999999998e132 < z < 1.90000000000000014e210Initial program 78.7%
Taylor expanded in z around 0 35.0%
Taylor expanded in x around inf 35.2%
Taylor expanded in x around 0 35.2%
Final simplification66.7%
(FPCore (x y z)
:precision binary64
(if (<= x 1.45e-267)
(+ (/ 0.083333333333333 x) (* x (- -1.0 (log1p (+ x -1.0)))))
(+
(- (+ 0.91893853320467 (* (log x) (+ x -0.5))) x)
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.45e-267) {
tmp = (0.083333333333333 / x) + (x * (-1.0 - log1p((x + -1.0))));
} else {
tmp = ((0.91893853320467 + (log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
return tmp;
}
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.45e-267) {
tmp = (0.083333333333333 / x) + (x * (-1.0 - Math.log1p((x + -1.0))));
} else {
tmp = ((0.91893853320467 + (Math.log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.45e-267: tmp = (0.083333333333333 / x) + (x * (-1.0 - math.log1p((x + -1.0)))) else: tmp = ((0.91893853320467 + (math.log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.45e-267) tmp = Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log1p(Float64(x + -1.0))))); else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(log(x) * Float64(x + -0.5))) - x) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.45e-267], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.45 \cdot 10^{-267}:\\
\;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \log x \cdot \left(x + -0.5\right)\right) - x\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\end{array}
\end{array}
if x < 1.45000000000000011e-267Initial program 100.0%
Taylor expanded in z around 0 24.9%
Taylor expanded in x around inf 24.9%
add-sqr-sqrt24.9%
log1p-expm1-u24.9%
sqrt-unprod24.9%
log-rec24.9%
log-rec24.9%
sqr-neg24.9%
sqrt-unprod0.0%
add-sqr-sqrt60.0%
expm1-udef60.0%
add-exp-log60.0%
Applied egg-rr60.0%
if 1.45000000000000011e-267 < x Initial program 95.5%
associate-+l-95.5%
sub-neg95.5%
sub-neg95.5%
metadata-eval95.5%
metadata-eval95.5%
Applied egg-rr95.5%
sub-neg95.5%
*-commutative95.5%
fma-udef95.6%
neg-sub095.6%
+-commutative95.6%
associate--r+95.6%
metadata-eval95.6%
Simplified95.6%
fma-udef95.5%
*-commutative95.5%
associate-+r-95.5%
*-commutative95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 65.1%
*-commutative65.1%
Simplified65.1%
Final simplification64.6%
(FPCore (x y z) :precision binary64 (+ (/ 0.083333333333333 x) (* x (- -1.0 (log (/ 1.0 x))))))
double code(double x, double y, double z) {
return (0.083333333333333 / x) + (x * (-1.0 - log((1.0 / 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) + (x * ((-1.0d0) - log((1.0d0 / x))))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) + (x * (-1.0 - Math.log((1.0 / x))));
}
def code(x, y, z): return (0.083333333333333 / x) + (x * (-1.0 - math.log((1.0 / x))))
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log(Float64(1.0 / x))))) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) + (x * (-1.0 - log((1.0 / x)))); end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} + x \cdot \left(-1 - \log \left(\frac{1}{x}\right)\right)
\end{array}
Initial program 96.0%
Taylor expanded in z around 0 55.2%
Taylor expanded in x around inf 53.9%
Final simplification53.9%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + (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 * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 96.0%
Taylor expanded in z around 0 55.2%
Taylor expanded in x around inf 53.9%
Taylor expanded in x around 0 53.9%
Final simplification53.9%
(FPCore (x y z) :precision binary64 (if (<= x 2.5) (pow (* x 12.000000000000048) -1.0) (* x (+ (log x) -0.916666666666667))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.5) {
tmp = pow((x * 12.000000000000048), -1.0);
} else {
tmp = x * (log(x) + -0.916666666666667);
}
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 <= 2.5d0) then
tmp = (x * 12.000000000000048d0) ** (-1.0d0)
else
tmp = x * (log(x) + (-0.916666666666667d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2.5) {
tmp = Math.pow((x * 12.000000000000048), -1.0);
} else {
tmp = x * (Math.log(x) + -0.916666666666667);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.5: tmp = math.pow((x * 12.000000000000048), -1.0) else: tmp = x * (math.log(x) + -0.916666666666667) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.5) tmp = Float64(x * 12.000000000000048) ^ -1.0; else tmp = Float64(x * Float64(log(x) + -0.916666666666667)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.5) tmp = (x * 12.000000000000048) ^ -1.0; else tmp = x * (log(x) + -0.916666666666667); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.5], N[Power[N[(x * 12.000000000000048), $MachinePrecision], -1.0], $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -0.916666666666667), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5:\\
\;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -0.916666666666667\right)\\
\end{array}
\end{array}
if x < 2.5Initial program 99.8%
fma-neg99.8%
sub-neg99.8%
metadata-eval99.8%
fma-def99.8%
fma-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 39.2%
Taylor expanded in x around 0 38.1%
clear-num38.0%
inv-pow38.0%
div-inv38.1%
metadata-eval38.1%
Applied egg-rr38.1%
if 2.5 < x Initial program 91.4%
Taylor expanded in z around 0 74.3%
Taylor expanded in x around inf 72.6%
add-sqr-sqrt72.6%
sqrt-unprod72.6%
frac-times72.6%
metadata-eval72.6%
metadata-eval72.6%
frac-times72.6%
sqrt-unprod0.0%
add-sqr-sqrt72.6%
div-inv72.6%
metadata-eval72.6%
cancel-sign-sub-inv72.6%
div-inv72.6%
sub-neg72.6%
mul-1-neg72.6%
log-rec72.6%
remove-double-neg72.6%
metadata-eval72.6%
add-sqr-sqrt72.6%
sqrt-unprod72.6%
frac-times72.6%
metadata-eval72.6%
metadata-eval72.6%
Applied egg-rr27.9%
distribute-lft-out--27.9%
associate--l+27.9%
metadata-eval27.9%
Simplified27.9%
Final simplification33.5%
(FPCore (x y z) :precision binary64 (if (<= x 0.88) (pow (* x 12.000000000000048) -1.0) (* x 0.083333333333333)))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.88) {
tmp = pow((x * 12.000000000000048), -1.0);
} else {
tmp = 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 (x <= 0.88d0) then
tmp = (x * 12.000000000000048d0) ** (-1.0d0)
else
tmp = x * 0.083333333333333d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.88) {
tmp = Math.pow((x * 12.000000000000048), -1.0);
} else {
tmp = x * 0.083333333333333;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.88: tmp = math.pow((x * 12.000000000000048), -1.0) else: tmp = x * 0.083333333333333 return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.88) tmp = Float64(x * 12.000000000000048) ^ -1.0; else tmp = Float64(x * 0.083333333333333); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.88) tmp = (x * 12.000000000000048) ^ -1.0; else tmp = x * 0.083333333333333; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.88], N[Power[N[(x * 12.000000000000048), $MachinePrecision], -1.0], $MachinePrecision], N[(x * 0.083333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.88:\\
\;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.083333333333333\\
\end{array}
\end{array}
if x < 0.880000000000000004Initial program 99.8%
fma-neg99.8%
sub-neg99.8%
metadata-eval99.8%
fma-def99.8%
fma-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 39.2%
Taylor expanded in x around 0 38.1%
clear-num38.0%
inv-pow38.0%
div-inv38.1%
metadata-eval38.1%
Applied egg-rr38.1%
if 0.880000000000000004 < x Initial program 91.4%
fma-neg91.5%
sub-neg91.5%
metadata-eval91.5%
fma-def91.5%
fma-neg91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in z around 0 74.4%
Taylor expanded in x around 0 3.2%
frac-2neg3.2%
div-inv3.2%
add-sqr-sqrt0.0%
sqrt-unprod1.7%
sqr-neg1.7%
sqrt-unprod1.5%
add-sqr-sqrt1.5%
metadata-eval1.5%
Applied egg-rr1.5%
associate-*r/1.5%
metadata-eval1.5%
Simplified1.5%
add-sqr-sqrt0.0%
sqrt-unprod3.0%
frac-times3.0%
metadata-eval3.0%
metadata-eval3.0%
frac-times3.0%
sqrt-unprod3.2%
add-sqr-sqrt3.2%
div-inv3.2%
*-commutative3.2%
add-exp-log3.2%
add-sqr-sqrt0.0%
sqrt-unprod10.9%
log-rec10.9%
log-rec10.9%
sqr-neg10.9%
sqrt-unprod10.9%
add-sqr-sqrt10.9%
add-exp-log10.9%
Applied egg-rr10.9%
Final simplification25.7%
(FPCore (x y z) :precision binary64 (if (<= x 0.88) (/ 0.083333333333333 x) (* x 0.083333333333333)))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.88) {
tmp = 0.083333333333333 / x;
} else {
tmp = 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 (x <= 0.88d0) then
tmp = 0.083333333333333d0 / x
else
tmp = x * 0.083333333333333d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.88) {
tmp = 0.083333333333333 / x;
} else {
tmp = x * 0.083333333333333;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.88: tmp = 0.083333333333333 / x else: tmp = x * 0.083333333333333 return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.88) tmp = Float64(0.083333333333333 / x); else tmp = Float64(x * 0.083333333333333); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.88) tmp = 0.083333333333333 / x; else tmp = x * 0.083333333333333; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.88], N[(0.083333333333333 / x), $MachinePrecision], N[(x * 0.083333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.88:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.083333333333333\\
\end{array}
\end{array}
if x < 0.880000000000000004Initial program 99.8%
fma-neg99.8%
sub-neg99.8%
metadata-eval99.8%
fma-def99.8%
fma-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 39.2%
Taylor expanded in x around 0 38.1%
if 0.880000000000000004 < x Initial program 91.4%
fma-neg91.5%
sub-neg91.5%
metadata-eval91.5%
fma-def91.5%
fma-neg91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in z around 0 74.4%
Taylor expanded in x around 0 3.2%
frac-2neg3.2%
div-inv3.2%
add-sqr-sqrt0.0%
sqrt-unprod1.7%
sqr-neg1.7%
sqrt-unprod1.5%
add-sqr-sqrt1.5%
metadata-eval1.5%
Applied egg-rr1.5%
associate-*r/1.5%
metadata-eval1.5%
Simplified1.5%
add-sqr-sqrt0.0%
sqrt-unprod3.0%
frac-times3.0%
metadata-eval3.0%
metadata-eval3.0%
frac-times3.0%
sqrt-unprod3.2%
add-sqr-sqrt3.2%
div-inv3.2%
*-commutative3.2%
add-exp-log3.2%
add-sqr-sqrt0.0%
sqrt-unprod10.9%
log-rec10.9%
log-rec10.9%
sqr-neg10.9%
sqrt-unprod10.9%
add-sqr-sqrt10.9%
add-exp-log10.9%
Applied egg-rr10.9%
Final simplification25.7%
(FPCore (x y z) :precision binary64 (* x -0.083333333333333))
double code(double x, double y, double z) {
return 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 = x * (-0.083333333333333d0)
end function
public static double code(double x, double y, double z) {
return x * -0.083333333333333;
}
def code(x, y, z): return x * -0.083333333333333
function code(x, y, z) return Float64(x * -0.083333333333333) end
function tmp = code(x, y, z) tmp = x * -0.083333333333333; end
code[x_, y_, z_] := N[(x * -0.083333333333333), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -0.083333333333333
\end{array}
Initial program 96.0%
fma-neg96.0%
sub-neg96.0%
metadata-eval96.0%
fma-def96.0%
fma-neg96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in z around 0 55.3%
Taylor expanded in x around 0 22.1%
frac-2neg22.1%
div-inv22.1%
add-sqr-sqrt0.0%
sqrt-unprod6.4%
sqr-neg6.4%
sqrt-unprod1.6%
add-sqr-sqrt1.6%
metadata-eval1.6%
Applied egg-rr1.6%
associate-*r/1.6%
metadata-eval1.6%
Simplified1.6%
add-sqr-sqrt0.0%
sqrt-unprod25.7%
frac-times25.7%
metadata-eval25.7%
metadata-eval25.7%
frac-times25.7%
sqrt-unprod22.1%
add-sqr-sqrt22.1%
expm1-log1p-u20.5%
expm1-udef20.1%
Applied egg-rr1.0%
expm1-def0.9%
expm1-log1p1.2%
Simplified1.2%
Final simplification1.2%
(FPCore (x y z) :precision binary64 (* x 0.083333333333333))
double code(double x, double y, double z) {
return 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 = x * 0.083333333333333d0
end function
public static double code(double x, double y, double z) {
return x * 0.083333333333333;
}
def code(x, y, z): return x * 0.083333333333333
function code(x, y, z) return Float64(x * 0.083333333333333) end
function tmp = code(x, y, z) tmp = x * 0.083333333333333; end
code[x_, y_, z_] := N[(x * 0.083333333333333), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.083333333333333
\end{array}
Initial program 96.0%
fma-neg96.0%
sub-neg96.0%
metadata-eval96.0%
fma-def96.0%
fma-neg96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in z around 0 55.3%
Taylor expanded in x around 0 22.1%
frac-2neg22.1%
div-inv22.1%
add-sqr-sqrt0.0%
sqrt-unprod6.4%
sqr-neg6.4%
sqrt-unprod1.6%
add-sqr-sqrt1.6%
metadata-eval1.6%
Applied egg-rr1.6%
associate-*r/1.6%
metadata-eval1.6%
Simplified1.6%
add-sqr-sqrt0.0%
sqrt-unprod25.7%
frac-times25.7%
metadata-eval25.7%
metadata-eval25.7%
frac-times25.7%
sqrt-unprod22.1%
add-sqr-sqrt22.1%
div-inv22.1%
*-commutative22.1%
add-exp-log20.5%
add-sqr-sqrt18.7%
sqrt-unprod24.0%
log-rec24.0%
log-rec24.0%
sqr-neg24.0%
sqrt-unprod5.0%
add-sqr-sqrt6.4%
add-exp-log6.4%
Applied egg-rr6.4%
Final simplification6.4%
(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 2023301
(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)))