
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= (exp z) 0.0) (+ x (/ -1.0 x)) (- x (/ y (fma x y (* (exp z) -1.1283791670955126))))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x - (y / fma(x, y, (exp(z) * -1.1283791670955126)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); else tmp = Float64(x - Float64(y / fma(x, y, Float64(exp(z) * -1.1283791670955126)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(x * y + N[(N[Exp[z], $MachinePrecision] * -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 86.0%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
unsub-neg97.4%
distribute-frac-neg97.4%
distribute-neg-frac297.4%
neg-sub097.4%
associate--r-97.4%
neg-sub097.4%
+-commutative97.4%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= (exp z) 0.0)
(+ x (/ -1.0 x))
(if (<= (exp z) 1.00000002)
(+
x
(/
y
(-
1.1283791670955126
(+ (* x y) (* z (- (* z -0.5641895835477563) 1.1283791670955126))))))
x)))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (exp(z) <= 1.00000002) {
tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * ((z * -0.5641895835477563) - 1.1283791670955126)))));
} else {
tmp = 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 (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else if (exp(z) <= 1.00000002d0) then
tmp = x + (y / (1.1283791670955126d0 - ((x * y) + (z * ((z * (-0.5641895835477563d0)) - 1.1283791670955126d0)))))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (Math.exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (Math.exp(z) <= 1.00000002) {
tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * ((z * -0.5641895835477563) - 1.1283791670955126)))));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) elif math.exp(z) <= 1.00000002: tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * ((z * -0.5641895835477563) - 1.1283791670955126))))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (exp(z) <= 1.00000002) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(Float64(x * y) + Float64(z * Float64(Float64(z * -0.5641895835477563) - 1.1283791670955126)))))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); elseif (exp(z) <= 1.00000002) tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * ((z * -0.5641895835477563) - 1.1283791670955126))))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 1.00000002], N[(x + N[(y / N[(1.1283791670955126 - N[(N[(x * y), $MachinePrecision] + N[(z * N[(N[(z * -0.5641895835477563), $MachinePrecision] - 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 1.00000002:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - \left(x \cdot y + z \cdot \left(z \cdot -0.5641895835477563 - 1.1283791670955126\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 86.0%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) < 1.0000000200000001Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
if 1.0000000200000001 < (exp.f64 z) Initial program 92.2%
Taylor expanded in x around inf 100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= x -5.2e-102)
x
(if (<= x -3.4e-204)
(/ -1.0 x)
(if (<= x 1.15e-283)
(* y 0.8862269254527579)
(if (<= x 7.5e-12) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.2e-102) {
tmp = x;
} else if (x <= -3.4e-204) {
tmp = -1.0 / x;
} else if (x <= 1.15e-283) {
tmp = y * 0.8862269254527579;
} else if (x <= 7.5e-12) {
tmp = -1.0 / x;
} else {
tmp = 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 <= (-5.2d-102)) then
tmp = x
else if (x <= (-3.4d-204)) then
tmp = (-1.0d0) / x
else if (x <= 1.15d-283) then
tmp = y * 0.8862269254527579d0
else if (x <= 7.5d-12) then
tmp = (-1.0d0) / x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.2e-102) {
tmp = x;
} else if (x <= -3.4e-204) {
tmp = -1.0 / x;
} else if (x <= 1.15e-283) {
tmp = y * 0.8862269254527579;
} else if (x <= 7.5e-12) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.2e-102: tmp = x elif x <= -3.4e-204: tmp = -1.0 / x elif x <= 1.15e-283: tmp = y * 0.8862269254527579 elif x <= 7.5e-12: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.2e-102) tmp = x; elseif (x <= -3.4e-204) tmp = Float64(-1.0 / x); elseif (x <= 1.15e-283) tmp = Float64(y * 0.8862269254527579); elseif (x <= 7.5e-12) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.2e-102) tmp = x; elseif (x <= -3.4e-204) tmp = -1.0 / x; elseif (x <= 1.15e-283) tmp = y * 0.8862269254527579; elseif (x <= 7.5e-12) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.2e-102], x, If[LessEqual[x, -3.4e-204], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 1.15e-283], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 7.5e-12], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{-102}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-204}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-283}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.19999999999999973e-102 or 7.5e-12 < x Initial program 96.7%
Taylor expanded in x around inf 93.5%
if -5.19999999999999973e-102 < x < -3.4000000000000002e-204 or 1.1499999999999999e-283 < x < 7.5e-12Initial program 91.7%
Taylor expanded in y around inf 51.9%
Taylor expanded in x around 0 51.9%
if -3.4000000000000002e-204 < x < 1.1499999999999999e-283Initial program 91.5%
remove-double-neg91.5%
distribute-frac-neg91.5%
unsub-neg91.5%
distribute-frac-neg91.5%
distribute-neg-frac291.5%
neg-sub091.2%
associate--r-91.2%
neg-sub091.7%
+-commutative91.7%
fma-define91.7%
*-commutative91.7%
distribute-rgt-neg-in91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around 0 52.7%
Taylor expanded in x around 0 51.5%
*-commutative51.5%
Simplified51.5%
Final simplification76.4%
(FPCore (x y z)
:precision binary64
(if (<= x -6.5e-100)
x
(if (<= x -9.5e-201)
(/ -1.0 x)
(if (<= x 1.15e-283)
(/ y 1.1283791670955126)
(if (<= x 5e-22) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.5e-100) {
tmp = x;
} else if (x <= -9.5e-201) {
tmp = -1.0 / x;
} else if (x <= 1.15e-283) {
tmp = y / 1.1283791670955126;
} else if (x <= 5e-22) {
tmp = -1.0 / x;
} else {
tmp = 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 <= (-6.5d-100)) then
tmp = x
else if (x <= (-9.5d-201)) then
tmp = (-1.0d0) / x
else if (x <= 1.15d-283) then
tmp = y / 1.1283791670955126d0
else if (x <= 5d-22) then
tmp = (-1.0d0) / x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -6.5e-100) {
tmp = x;
} else if (x <= -9.5e-201) {
tmp = -1.0 / x;
} else if (x <= 1.15e-283) {
tmp = y / 1.1283791670955126;
} else if (x <= 5e-22) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.5e-100: tmp = x elif x <= -9.5e-201: tmp = -1.0 / x elif x <= 1.15e-283: tmp = y / 1.1283791670955126 elif x <= 5e-22: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.5e-100) tmp = x; elseif (x <= -9.5e-201) tmp = Float64(-1.0 / x); elseif (x <= 1.15e-283) tmp = Float64(y / 1.1283791670955126); elseif (x <= 5e-22) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.5e-100) tmp = x; elseif (x <= -9.5e-201) tmp = -1.0 / x; elseif (x <= 1.15e-283) tmp = y / 1.1283791670955126; elseif (x <= 5e-22) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.5e-100], x, If[LessEqual[x, -9.5e-201], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 1.15e-283], N[(y / 1.1283791670955126), $MachinePrecision], If[LessEqual[x, 5e-22], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-100}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-201}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-283}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.50000000000000013e-100 or 4.99999999999999954e-22 < x Initial program 96.7%
Taylor expanded in x around inf 93.5%
if -6.50000000000000013e-100 < x < -9.5000000000000001e-201 or 1.1499999999999999e-283 < x < 4.99999999999999954e-22Initial program 91.7%
Taylor expanded in y around inf 51.9%
Taylor expanded in x around 0 51.9%
if -9.5000000000000001e-201 < x < 1.1499999999999999e-283Initial program 91.5%
remove-double-neg91.5%
distribute-frac-neg91.5%
unsub-neg91.5%
distribute-frac-neg91.5%
distribute-neg-frac291.5%
neg-sub091.2%
associate--r-91.2%
neg-sub091.7%
+-commutative91.7%
fma-define91.7%
*-commutative91.7%
distribute-rgt-neg-in91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around 0 52.7%
Taylor expanded in x around 0 51.5%
*-commutative51.5%
Simplified51.5%
metadata-eval51.6%
div-inv51.8%
Applied egg-rr51.8%
Final simplification76.4%
(FPCore (x y z)
:precision binary64
(if (<= z -820000.0)
(+ x (/ -1.0 x))
(if (<= z 2.4e-8)
(+ x (/ y (- 1.1283791670955126 (+ (* x y) (* z -1.1283791670955126)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -820000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-8) {
tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -1.1283791670955126))));
} else {
tmp = 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 <= (-820000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.4d-8) then
tmp = x + (y / (1.1283791670955126d0 - ((x * y) + (z * (-1.1283791670955126d0)))))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -820000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-8) {
tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -1.1283791670955126))));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -820000.0: tmp = x + (-1.0 / x) elif z <= 2.4e-8: tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -1.1283791670955126)))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -820000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.4e-8) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(Float64(x * y) + Float64(z * -1.1283791670955126))))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -820000.0) tmp = x + (-1.0 / x); elseif (z <= 2.4e-8) tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -1.1283791670955126)))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -820000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-8], N[(x + N[(y / N[(1.1283791670955126 - N[(N[(x * y), $MachinePrecision] + N[(z * -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -820000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - \left(x \cdot y + z \cdot -1.1283791670955126\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.2e5Initial program 85.8%
Taylor expanded in y around inf 100.0%
if -8.2e5 < z < 2.39999999999999998e-8Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.7%
if 2.39999999999999998e-8 < z Initial program 92.2%
Taylor expanded in x around inf 100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -8.2e+106)
(/ -1.0 x)
(if (<= z -1.6e-48)
x
(if (<= z 5.8e-205) (- x (* y -0.8862269254527579)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -8.2e+106) {
tmp = -1.0 / x;
} else if (z <= -1.6e-48) {
tmp = x;
} else if (z <= 5.8e-205) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-8.2d+106)) then
tmp = (-1.0d0) / x
else if (z <= (-1.6d-48)) then
tmp = x
else if (z <= 5.8d-205) then
tmp = x - (y * (-0.8862269254527579d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -8.2e+106) {
tmp = -1.0 / x;
} else if (z <= -1.6e-48) {
tmp = x;
} else if (z <= 5.8e-205) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8.2e+106: tmp = -1.0 / x elif z <= -1.6e-48: tmp = x elif z <= 5.8e-205: tmp = x - (y * -0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8.2e+106) tmp = Float64(-1.0 / x); elseif (z <= -1.6e-48) tmp = x; elseif (z <= 5.8e-205) tmp = Float64(x - Float64(y * -0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -8.2e+106) tmp = -1.0 / x; elseif (z <= -1.6e-48) tmp = x; elseif (z <= 5.8e-205) tmp = x - (y * -0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8.2e+106], N[(-1.0 / x), $MachinePrecision], If[LessEqual[z, -1.6e-48], x, If[LessEqual[z, 5.8e-205], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+106}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-48}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-205}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.2000000000000005e106Initial program 84.7%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around 0 62.9%
if -8.2000000000000005e106 < z < -1.5999999999999999e-48 or 5.80000000000000036e-205 < z Initial program 94.8%
Taylor expanded in x around inf 84.9%
if -1.5999999999999999e-48 < z < 5.80000000000000036e-205Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 72.1%
*-commutative72.1%
Simplified72.1%
Taylor expanded in z around 0 72.1%
*-commutative72.1%
Simplified72.1%
Final simplification77.2%
(FPCore (x y z) :precision binary64 (if (<= z -820000.0) (+ x (/ -1.0 x)) (if (<= z 2.4e-8) (+ x (/ 1.0 (- (/ 1.1283791670955126 y) x))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -820000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-8) {
tmp = x + (1.0 / ((1.1283791670955126 / y) - x));
} else {
tmp = 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 <= (-820000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.4d-8) then
tmp = x + (1.0d0 / ((1.1283791670955126d0 / y) - x))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -820000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-8) {
tmp = x + (1.0 / ((1.1283791670955126 / y) - x));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -820000.0: tmp = x + (-1.0 / x) elif z <= 2.4e-8: tmp = x + (1.0 / ((1.1283791670955126 / y) - x)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -820000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.4e-8) tmp = Float64(x + Float64(1.0 / Float64(Float64(1.1283791670955126 / y) - x))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -820000.0) tmp = x + (-1.0 / x); elseif (z <= 2.4e-8) tmp = x + (1.0 / ((1.1283791670955126 / y) - x)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -820000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-8], N[(x + N[(1.0 / N[(N[(1.1283791670955126 / y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -820000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{1}{\frac{1.1283791670955126}{y} - x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.2e5Initial program 85.8%
Taylor expanded in y around inf 100.0%
if -8.2e5 < z < 2.39999999999999998e-8Initial program 99.9%
clear-num99.8%
inv-pow99.8%
*-commutative99.8%
Applied egg-rr99.8%
unpow-199.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 99.4%
Taylor expanded in y around 0 99.4%
associate-*r*99.4%
neg-mul-199.4%
cancel-sign-sub-inv99.4%
*-commutative99.4%
div-sub99.4%
*-commutative99.4%
associate-*r/99.4%
*-inverses99.4%
*-rgt-identity99.4%
Simplified99.4%
if 2.39999999999999998e-8 < z Initial program 92.2%
Taylor expanded in x around inf 100.0%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (<= z -820000.0) (+ x (/ -1.0 x)) (if (<= z 2.4e-8) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -820000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-8) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = 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 <= (-820000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.4d-8) then
tmp = x + (y / (1.1283791670955126d0 - (x * y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -820000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-8) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -820000.0: tmp = x + (-1.0 / x) elif z <= 2.4e-8: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -820000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.4e-8) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -820000.0) tmp = x + (-1.0 / x); elseif (z <= 2.4e-8) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -820000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-8], N[(x + N[(y / N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -820000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.2e5Initial program 85.8%
Taylor expanded in y around inf 100.0%
if -8.2e5 < z < 2.39999999999999998e-8Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.5%
if 2.39999999999999998e-8 < z Initial program 92.2%
Taylor expanded in x around inf 100.0%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (<= z -1.6e-172) (+ x (/ -1.0 x)) (if (<= z 2.4e-205) (- x (* y -0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.6e-172) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-205) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.6d-172)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.4d-205) then
tmp = x - (y * (-0.8862269254527579d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.6e-172) {
tmp = x + (-1.0 / x);
} else if (z <= 2.4e-205) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.6e-172: tmp = x + (-1.0 / x) elif z <= 2.4e-205: tmp = x - (y * -0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.6e-172) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.4e-205) tmp = Float64(x - Float64(y * -0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.6e-172) tmp = x + (-1.0 / x); elseif (z <= 2.4e-205) tmp = x - (y * -0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.6e-172], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-205], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-172}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-205}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.6000000000000001e-172Initial program 91.1%
Taylor expanded in y around inf 91.1%
if -1.6000000000000001e-172 < z < 2.4000000000000002e-205Initial program 99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in z around 0 76.6%
*-commutative76.6%
Simplified76.6%
if 2.4000000000000002e-205 < z Initial program 95.3%
Taylor expanded in x around inf 87.3%
Final simplification86.6%
(FPCore (x y z) :precision binary64 (if (<= z -4.3e-169) (+ x (/ -1.0 x)) (if (<= z 5.1e-204) (- x (/ y -1.1283791670955126)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.3e-169) {
tmp = x + (-1.0 / x);
} else if (z <= 5.1e-204) {
tmp = x - (y / -1.1283791670955126);
} else {
tmp = 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 <= (-4.3d-169)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 5.1d-204) then
tmp = x - (y / (-1.1283791670955126d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.3e-169) {
tmp = x + (-1.0 / x);
} else if (z <= 5.1e-204) {
tmp = x - (y / -1.1283791670955126);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.3e-169: tmp = x + (-1.0 / x) elif z <= 5.1e-204: tmp = x - (y / -1.1283791670955126) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.3e-169) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 5.1e-204) tmp = Float64(x - Float64(y / -1.1283791670955126)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.3e-169) tmp = x + (-1.0 / x); elseif (z <= 5.1e-204) tmp = x - (y / -1.1283791670955126); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.3e-169], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e-204], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-169}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-204}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.29999999999999984e-169Initial program 91.1%
Taylor expanded in y around inf 91.1%
if -4.29999999999999984e-169 < z < 5.10000000000000027e-204Initial program 99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 76.8%
if 5.10000000000000027e-204 < z Initial program 95.3%
Taylor expanded in x around inf 87.3%
Final simplification86.7%
(FPCore (x y z) :precision binary64 (if (<= x -3.6e-176) x (if (<= x 2.4e-105) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.6e-176) {
tmp = x;
} else if (x <= 2.4e-105) {
tmp = y * 0.8862269254527579;
} else {
tmp = 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 <= (-3.6d-176)) then
tmp = x
else if (x <= 2.4d-105) then
tmp = y * 0.8862269254527579d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.6e-176) {
tmp = x;
} else if (x <= 2.4e-105) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.6e-176: tmp = x elif x <= 2.4e-105: tmp = y * 0.8862269254527579 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.6e-176) tmp = x; elseif (x <= 2.4e-105) tmp = Float64(y * 0.8862269254527579); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.6e-176) tmp = x; elseif (x <= 2.4e-105) tmp = y * 0.8862269254527579; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.6e-176], x, If[LessEqual[x, 2.4e-105], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-176}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-105}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.6000000000000003e-176 or 2.40000000000000015e-105 < x Initial program 95.7%
Taylor expanded in x around inf 82.9%
if -3.6000000000000003e-176 < x < 2.40000000000000015e-105Initial program 91.9%
remove-double-neg91.9%
distribute-frac-neg91.9%
unsub-neg91.9%
distribute-frac-neg91.9%
distribute-neg-frac291.9%
neg-sub091.5%
associate--r-91.5%
neg-sub092.0%
+-commutative92.0%
fma-define92.0%
*-commutative92.0%
distribute-rgt-neg-in92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in z around 0 56.4%
Taylor expanded in x around 0 41.6%
*-commutative41.6%
Simplified41.6%
Final simplification71.3%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.6%
Taylor expanded in x around inf 67.2%
Final simplification67.2%
(FPCore (x y z) :precision binary64 (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x))))
double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - 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 + (1.0d0 / (((1.1283791670955126d0 / y) * exp(z)) - x))
end function
public static double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * Math.exp(z)) - x));
}
def code(x, y, z): return x + (1.0 / (((1.1283791670955126 / y) * math.exp(z)) - x))
function code(x, y, z) return Float64(x + Float64(1.0 / Float64(Float64(Float64(1.1283791670955126 / y) * exp(z)) - x))) end
function tmp = code(x, y, z) tmp = x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x)); end
code[x_, y_, z_] := N[(x + N[(1.0 / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] * N[Exp[z], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x}
\end{array}
herbie shell --seed 2024066
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))