
(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 11 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 (+ x (/ -1.0 (fma (exp z) (/ -1.1283791670955126 y) x))))
double code(double x, double y, double z) {
return x + (-1.0 / fma(exp(z), (-1.1283791670955126 / y), x));
}
function code(x, y, z) return Float64(x + Float64(-1.0 / fma(exp(z), Float64(-1.1283791670955126 / y), x))) end
code[x_, y_, z_] := N[(x + N[(-1.0 / N[(N[Exp[z], $MachinePrecision] * N[(-1.1283791670955126 / y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-1}{\mathsf{fma}\left(e^{z}, \frac{-1.1283791670955126}{y}, x\right)}
\end{array}
Initial program 95.3%
remove-double-neg95.3%
neg-mul-195.3%
associate-/l*95.4%
neg-mul-195.4%
associate-/r*95.4%
div-sub95.5%
metadata-eval95.5%
associate-/l*95.5%
*-commutative95.5%
neg-mul-195.5%
distribute-lft-neg-out95.5%
/-rgt-identity95.5%
div-sub95.4%
associate-/r*95.4%
neg-mul-195.4%
*-rgt-identity95.4%
times-frac95.4%
/-rgt-identity95.4%
*-commutative95.4%
associate-*r/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= (exp z) 0.0)
(+ x (/ -1.0 x))
(if (<= (exp z) 5000.0)
(+
x
(/ -1.0 (+ x (/ (- (* z -1.1283791670955126) 1.1283791670955126) y))))
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) <= 5000.0) {
tmp = x + (-1.0 / (x + (((z * -1.1283791670955126) - 1.1283791670955126) / 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 (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else if (exp(z) <= 5000.0d0) then
tmp = x + ((-1.0d0) / (x + (((z * (-1.1283791670955126d0)) - 1.1283791670955126d0) / y)))
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) <= 5000.0) {
tmp = x + (-1.0 / (x + (((z * -1.1283791670955126) - 1.1283791670955126) / y)));
} 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) <= 5000.0: tmp = x + (-1.0 / (x + (((z * -1.1283791670955126) - 1.1283791670955126) / y))) 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) <= 5000.0) tmp = Float64(x + Float64(-1.0 / Float64(x + Float64(Float64(Float64(z * -1.1283791670955126) - 1.1283791670955126) / y)))); 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) <= 5000.0) tmp = x + (-1.0 / (x + (((z * -1.1283791670955126) - 1.1283791670955126) / y))); 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], 5000.0], N[(x + N[(-1.0 / N[(x + N[(N[(N[(z * -1.1283791670955126), $MachinePrecision] - 1.1283791670955126), $MachinePrecision] / y), $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 5000:\\
\;\;\;\;x + \frac{-1}{x + \frac{z \cdot -1.1283791670955126 - 1.1283791670955126}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 90.3%
remove-double-neg90.3%
neg-mul-190.3%
associate-/l*90.5%
neg-mul-190.5%
associate-/r*90.5%
div-sub90.9%
metadata-eval90.9%
associate-/l*90.9%
*-commutative90.9%
neg-mul-190.9%
distribute-lft-neg-out90.9%
/-rgt-identity90.9%
div-sub90.7%
associate-/r*90.7%
neg-mul-190.7%
*-rgt-identity90.7%
times-frac90.7%
/-rgt-identity90.7%
*-commutative90.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 0.0 < (exp.f64 z) < 5e3Initial program 99.8%
remove-double-neg99.8%
neg-mul-199.8%
associate-/l*99.9%
neg-mul-199.9%
associate-/r*99.9%
div-sub99.9%
metadata-eval99.9%
associate-/l*99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-lft-neg-out99.9%
/-rgt-identity99.9%
div-sub99.9%
associate-/r*99.9%
neg-mul-199.9%
*-rgt-identity99.9%
times-frac99.9%
/-rgt-identity99.9%
*-commutative99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 99.6%
Taylor expanded in y around 0 99.6%
div-inv99.6%
mul-1-neg99.6%
associate--l+99.6%
associate-*r/99.6%
sub-div99.6%
Applied egg-rr99.6%
if 5e3 < (exp.f64 z) Initial program 92.7%
remove-double-neg92.7%
neg-mul-192.7%
associate-/l*92.7%
neg-mul-192.7%
associate-/r*92.7%
div-sub92.7%
metadata-eval92.7%
associate-/l*92.7%
*-commutative92.7%
neg-mul-192.7%
distribute-lft-neg-out92.7%
/-rgt-identity92.7%
div-sub92.7%
associate-/r*92.7%
neg-mul-192.7%
*-rgt-identity92.7%
times-frac92.7%
/-rgt-identity92.7%
*-commutative92.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 63.0%
cancel-sign-sub-inv63.0%
metadata-eval63.0%
associate-*r/63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in x around inf 100.0%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= (exp z) 0.0) (+ x (/ -1.0 x)) (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x + (y / ((exp(z) * 1.1283791670955126) - (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 (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else
tmp = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
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 {
tmp = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) else: tmp = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y))) 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 / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); else tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y))); 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], N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $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}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 90.3%
remove-double-neg90.3%
neg-mul-190.3%
associate-/l*90.5%
neg-mul-190.5%
associate-/r*90.5%
div-sub90.9%
metadata-eval90.9%
associate-/l*90.9%
*-commutative90.9%
neg-mul-190.9%
distribute-lft-neg-out90.9%
/-rgt-identity90.9%
div-sub90.7%
associate-/r*90.7%
neg-mul-190.7%
*-rgt-identity90.7%
times-frac90.7%
/-rgt-identity90.7%
*-commutative90.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 97.6%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(if (<= z -19000000000.0)
(+ x (/ -1.0 x))
(if (<= z 92.0)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -19000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 92.0) {
tmp = x + (y / ((1.1283791670955126 + (z * 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 <= (-19000000000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 92.0d0) then
tmp = x + (y / ((1.1283791670955126d0 + (z * 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 <= -19000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 92.0) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -19000000000.0: tmp = x + (-1.0 / x) elif z <= 92.0: tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -19000000000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 92.0) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)) - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -19000000000.0) tmp = x + (-1.0 / x); elseif (z <= 92.0) tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -19000000000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 92.0], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -19000000000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 92:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.9e10Initial program 89.6%
remove-double-neg89.6%
neg-mul-189.6%
associate-/l*89.8%
neg-mul-189.8%
associate-/r*89.8%
div-sub90.2%
metadata-eval90.2%
associate-/l*90.2%
*-commutative90.2%
neg-mul-190.2%
distribute-lft-neg-out90.2%
/-rgt-identity90.2%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.9e10 < z < 92Initial program 99.8%
Taylor expanded in z around 0 99.6%
if 92 < z Initial program 92.7%
remove-double-neg92.7%
neg-mul-192.7%
associate-/l*92.7%
neg-mul-192.7%
associate-/r*92.7%
div-sub92.7%
metadata-eval92.7%
associate-/l*92.7%
*-commutative92.7%
neg-mul-192.7%
distribute-lft-neg-out92.7%
/-rgt-identity92.7%
div-sub92.7%
associate-/r*92.7%
neg-mul-192.7%
*-rgt-identity92.7%
times-frac92.7%
/-rgt-identity92.7%
*-commutative92.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 63.0%
cancel-sign-sub-inv63.0%
metadata-eval63.0%
associate-*r/63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in x around inf 100.0%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (<= x -5.9e-93)
x
(if (<= x -2e-250)
(/ -1.0 x)
(if (<= x 3.6e-308)
(* y 0.8862269254527579)
(if (<= x 8.2e-163)
(/ -1.0 x)
(if (<= x 3e-113) x (if (<= x 2.7e-6) (/ -1.0 x) x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.9e-93) {
tmp = x;
} else if (x <= -2e-250) {
tmp = -1.0 / x;
} else if (x <= 3.6e-308) {
tmp = y * 0.8862269254527579;
} else if (x <= 8.2e-163) {
tmp = -1.0 / x;
} else if (x <= 3e-113) {
tmp = x;
} else if (x <= 2.7e-6) {
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.9d-93)) then
tmp = x
else if (x <= (-2d-250)) then
tmp = (-1.0d0) / x
else if (x <= 3.6d-308) then
tmp = y * 0.8862269254527579d0
else if (x <= 8.2d-163) then
tmp = (-1.0d0) / x
else if (x <= 3d-113) then
tmp = x
else if (x <= 2.7d-6) 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.9e-93) {
tmp = x;
} else if (x <= -2e-250) {
tmp = -1.0 / x;
} else if (x <= 3.6e-308) {
tmp = y * 0.8862269254527579;
} else if (x <= 8.2e-163) {
tmp = -1.0 / x;
} else if (x <= 3e-113) {
tmp = x;
} else if (x <= 2.7e-6) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.9e-93: tmp = x elif x <= -2e-250: tmp = -1.0 / x elif x <= 3.6e-308: tmp = y * 0.8862269254527579 elif x <= 8.2e-163: tmp = -1.0 / x elif x <= 3e-113: tmp = x elif x <= 2.7e-6: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.9e-93) tmp = x; elseif (x <= -2e-250) tmp = Float64(-1.0 / x); elseif (x <= 3.6e-308) tmp = Float64(y * 0.8862269254527579); elseif (x <= 8.2e-163) tmp = Float64(-1.0 / x); elseif (x <= 3e-113) tmp = x; elseif (x <= 2.7e-6) 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.9e-93) tmp = x; elseif (x <= -2e-250) tmp = -1.0 / x; elseif (x <= 3.6e-308) tmp = y * 0.8862269254527579; elseif (x <= 8.2e-163) tmp = -1.0 / x; elseif (x <= 3e-113) tmp = x; elseif (x <= 2.7e-6) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.9e-93], x, If[LessEqual[x, -2e-250], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 3.6e-308], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 8.2e-163], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 3e-113], x, If[LessEqual[x, 2.7e-6], N[(-1.0 / x), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{-93}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-250}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-308}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-163}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-113}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.9e-93 or 8.19999999999999965e-163 < x < 3.0000000000000001e-113 or 2.69999999999999998e-6 < x Initial program 97.5%
remove-double-neg97.5%
neg-mul-197.5%
associate-/l*97.5%
neg-mul-197.5%
associate-/r*97.5%
div-sub97.5%
metadata-eval97.5%
associate-/l*97.5%
*-commutative97.5%
neg-mul-197.5%
distribute-lft-neg-out97.5%
/-rgt-identity97.5%
div-sub97.5%
associate-/r*97.5%
neg-mul-197.5%
*-rgt-identity97.5%
times-frac97.5%
/-rgt-identity97.5%
*-commutative97.5%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 95.8%
cancel-sign-sub-inv95.8%
metadata-eval95.8%
associate-*r/95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in x around inf 92.6%
if -5.9e-93 < x < -2.0000000000000001e-250 or 3.5999999999999999e-308 < x < 8.19999999999999965e-163 or 3.0000000000000001e-113 < x < 2.69999999999999998e-6Initial program 92.0%
remove-double-neg92.0%
neg-mul-192.0%
associate-/l*92.2%
neg-mul-192.2%
associate-/r*92.2%
div-sub92.4%
metadata-eval92.4%
associate-/l*92.4%
*-commutative92.4%
neg-mul-192.4%
distribute-lft-neg-out92.4%
/-rgt-identity92.4%
div-sub92.4%
associate-/r*92.4%
neg-mul-192.4%
*-rgt-identity92.4%
times-frac92.4%
/-rgt-identity92.4%
*-commutative92.4%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in x around inf 56.8%
Taylor expanded in x around 0 56.8%
if -2.0000000000000001e-250 < x < 3.5999999999999999e-308Initial program 89.7%
remove-double-neg89.7%
neg-mul-189.7%
associate-/l*89.9%
neg-mul-189.9%
associate-/r*89.9%
div-sub90.6%
metadata-eval90.6%
associate-/l*90.6%
*-commutative90.6%
neg-mul-190.6%
distribute-lft-neg-out90.6%
/-rgt-identity90.6%
div-sub89.9%
associate-/r*89.9%
neg-mul-189.9%
*-rgt-identity89.9%
times-frac89.9%
/-rgt-identity89.9%
*-commutative89.9%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around 0 70.7%
cancel-sign-sub-inv70.7%
metadata-eval70.7%
associate-*r/70.5%
metadata-eval70.5%
Simplified70.5%
Taylor expanded in x around 0 61.1%
*-commutative61.1%
Simplified61.1%
Final simplification79.1%
(FPCore (x y z)
:precision binary64
(if (<= x -4.6e-93)
x
(if (<= x -2.6e-263)
(/ -1.0 x)
(if (<= x 6.8e-307)
(/ y 1.1283791670955126)
(if (<= x 5.6e-160)
(/ -1.0 x)
(if (<= x 3.9e-114) x (if (<= x 3.2e-9) (/ -1.0 x) x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e-93) {
tmp = x;
} else if (x <= -2.6e-263) {
tmp = -1.0 / x;
} else if (x <= 6.8e-307) {
tmp = y / 1.1283791670955126;
} else if (x <= 5.6e-160) {
tmp = -1.0 / x;
} else if (x <= 3.9e-114) {
tmp = x;
} else if (x <= 3.2e-9) {
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 <= (-4.6d-93)) then
tmp = x
else if (x <= (-2.6d-263)) then
tmp = (-1.0d0) / x
else if (x <= 6.8d-307) then
tmp = y / 1.1283791670955126d0
else if (x <= 5.6d-160) then
tmp = (-1.0d0) / x
else if (x <= 3.9d-114) then
tmp = x
else if (x <= 3.2d-9) 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 <= -4.6e-93) {
tmp = x;
} else if (x <= -2.6e-263) {
tmp = -1.0 / x;
} else if (x <= 6.8e-307) {
tmp = y / 1.1283791670955126;
} else if (x <= 5.6e-160) {
tmp = -1.0 / x;
} else if (x <= 3.9e-114) {
tmp = x;
} else if (x <= 3.2e-9) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.6e-93: tmp = x elif x <= -2.6e-263: tmp = -1.0 / x elif x <= 6.8e-307: tmp = y / 1.1283791670955126 elif x <= 5.6e-160: tmp = -1.0 / x elif x <= 3.9e-114: tmp = x elif x <= 3.2e-9: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.6e-93) tmp = x; elseif (x <= -2.6e-263) tmp = Float64(-1.0 / x); elseif (x <= 6.8e-307) tmp = Float64(y / 1.1283791670955126); elseif (x <= 5.6e-160) tmp = Float64(-1.0 / x); elseif (x <= 3.9e-114) tmp = x; elseif (x <= 3.2e-9) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.6e-93) tmp = x; elseif (x <= -2.6e-263) tmp = -1.0 / x; elseif (x <= 6.8e-307) tmp = y / 1.1283791670955126; elseif (x <= 5.6e-160) tmp = -1.0 / x; elseif (x <= 3.9e-114) tmp = x; elseif (x <= 3.2e-9) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.6e-93], x, If[LessEqual[x, -2.6e-263], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 6.8e-307], N[(y / 1.1283791670955126), $MachinePrecision], If[LessEqual[x, 5.6e-160], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 3.9e-114], x, If[LessEqual[x, 3.2e-9], N[(-1.0 / x), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-93}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-263}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-307}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-160}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-114}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.5999999999999996e-93 or 5.60000000000000032e-160 < x < 3.90000000000000002e-114 or 3.20000000000000012e-9 < x Initial program 97.5%
remove-double-neg97.5%
neg-mul-197.5%
associate-/l*97.5%
neg-mul-197.5%
associate-/r*97.5%
div-sub97.5%
metadata-eval97.5%
associate-/l*97.5%
*-commutative97.5%
neg-mul-197.5%
distribute-lft-neg-out97.5%
/-rgt-identity97.5%
div-sub97.5%
associate-/r*97.5%
neg-mul-197.5%
*-rgt-identity97.5%
times-frac97.5%
/-rgt-identity97.5%
*-commutative97.5%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 95.8%
cancel-sign-sub-inv95.8%
metadata-eval95.8%
associate-*r/95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in x around inf 92.6%
if -4.5999999999999996e-93 < x < -2.6e-263 or 6.79999999999999978e-307 < x < 5.60000000000000032e-160 or 3.90000000000000002e-114 < x < 3.20000000000000012e-9Initial program 92.0%
remove-double-neg92.0%
neg-mul-192.0%
associate-/l*92.2%
neg-mul-192.2%
associate-/r*92.2%
div-sub92.4%
metadata-eval92.4%
associate-/l*92.4%
*-commutative92.4%
neg-mul-192.4%
distribute-lft-neg-out92.4%
/-rgt-identity92.4%
div-sub92.4%
associate-/r*92.4%
neg-mul-192.4%
*-rgt-identity92.4%
times-frac92.4%
/-rgt-identity92.4%
*-commutative92.4%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in x around inf 56.8%
Taylor expanded in x around 0 56.8%
if -2.6e-263 < x < 6.79999999999999978e-307Initial program 89.7%
remove-double-neg89.7%
neg-mul-189.7%
associate-/l*89.9%
neg-mul-189.9%
associate-/r*89.9%
div-sub90.6%
metadata-eval90.6%
associate-/l*90.6%
*-commutative90.6%
neg-mul-190.6%
distribute-lft-neg-out90.6%
/-rgt-identity90.6%
div-sub89.9%
associate-/r*89.9%
neg-mul-189.9%
*-rgt-identity89.9%
times-frac89.9%
/-rgt-identity89.9%
*-commutative89.9%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around 0 70.7%
cancel-sign-sub-inv70.7%
metadata-eval70.7%
associate-*r/70.5%
metadata-eval70.5%
Simplified70.5%
Taylor expanded in x around 0 61.1%
*-commutative61.1%
Simplified61.1%
metadata-eval61.2%
div-inv61.2%
Applied egg-rr61.2%
Final simplification79.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x))))
(if (<= z -7.3e-56)
t_0
(if (<= z -7.5e-248)
(+ x (/ y 1.1283791670955126))
(if (<= z 7.1e-246)
t_0
(if (<= z 4.4e-107)
(- x (* y -0.8862269254527579))
(if (<= z 19.0) t_0 x)))))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= -7.3e-56) {
tmp = t_0;
} else if (z <= -7.5e-248) {
tmp = x + (y / 1.1283791670955126);
} else if (z <= 7.1e-246) {
tmp = t_0;
} else if (z <= 4.4e-107) {
tmp = x - (y * -0.8862269254527579);
} else if (z <= 19.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x + ((-1.0d0) / x)
if (z <= (-7.3d-56)) then
tmp = t_0
else if (z <= (-7.5d-248)) then
tmp = x + (y / 1.1283791670955126d0)
else if (z <= 7.1d-246) then
tmp = t_0
else if (z <= 4.4d-107) then
tmp = x - (y * (-0.8862269254527579d0))
else if (z <= 19.0d0) then
tmp = t_0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= -7.3e-56) {
tmp = t_0;
} else if (z <= -7.5e-248) {
tmp = x + (y / 1.1283791670955126);
} else if (z <= 7.1e-246) {
tmp = t_0;
} else if (z <= 4.4e-107) {
tmp = x - (y * -0.8862269254527579);
} else if (z <= 19.0) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) tmp = 0 if z <= -7.3e-56: tmp = t_0 elif z <= -7.5e-248: tmp = x + (y / 1.1283791670955126) elif z <= 7.1e-246: tmp = t_0 elif z <= 4.4e-107: tmp = x - (y * -0.8862269254527579) elif z <= 19.0: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) tmp = 0.0 if (z <= -7.3e-56) tmp = t_0; elseif (z <= -7.5e-248) tmp = Float64(x + Float64(y / 1.1283791670955126)); elseif (z <= 7.1e-246) tmp = t_0; elseif (z <= 4.4e-107) tmp = Float64(x - Float64(y * -0.8862269254527579)); elseif (z <= 19.0) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); tmp = 0.0; if (z <= -7.3e-56) tmp = t_0; elseif (z <= -7.5e-248) tmp = x + (y / 1.1283791670955126); elseif (z <= 7.1e-246) tmp = t_0; elseif (z <= 4.4e-107) tmp = x - (y * -0.8862269254527579); elseif (z <= 19.0) tmp = t_0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.3e-56], t$95$0, If[LessEqual[z, -7.5e-248], N[(x + N[(y / 1.1283791670955126), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.1e-246], t$95$0, If[LessEqual[z, 4.4e-107], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 19.0], t$95$0, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
\mathbf{if}\;z \leq -7.3 \cdot 10^{-56}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-248}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126}\\
\mathbf{elif}\;z \leq 7.1 \cdot 10^{-246}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-107}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{elif}\;z \leq 19:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.30000000000000045e-56 or -7.4999999999999994e-248 < z < 7.10000000000000036e-246 or 4.40000000000000025e-107 < z < 19Initial program 94.3%
remove-double-neg94.3%
neg-mul-194.3%
associate-/l*94.5%
neg-mul-194.5%
associate-/r*94.5%
div-sub94.7%
metadata-eval94.7%
associate-/l*94.7%
*-commutative94.7%
neg-mul-194.7%
distribute-lft-neg-out94.7%
/-rgt-identity94.7%
div-sub94.6%
associate-/r*94.6%
neg-mul-194.6%
*-rgt-identity94.6%
times-frac94.6%
/-rgt-identity94.6%
*-commutative94.6%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 92.2%
if -7.30000000000000045e-56 < z < -7.4999999999999994e-248Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 72.8%
if 7.10000000000000036e-246 < z < 4.40000000000000025e-107Initial program 99.8%
remove-double-neg99.8%
neg-mul-199.8%
associate-/l*99.7%
neg-mul-199.7%
associate-/r*99.7%
div-sub99.7%
metadata-eval99.7%
associate-/l*99.7%
*-commutative99.7%
neg-mul-199.7%
distribute-lft-neg-out99.7%
/-rgt-identity99.7%
div-sub99.7%
associate-/r*99.7%
neg-mul-199.7%
*-rgt-identity99.7%
times-frac99.7%
/-rgt-identity99.7%
*-commutative99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in z around 0 99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 77.9%
if 19 < z Initial program 92.7%
remove-double-neg92.7%
neg-mul-192.7%
associate-/l*92.7%
neg-mul-192.7%
associate-/r*92.7%
div-sub92.7%
metadata-eval92.7%
associate-/l*92.7%
*-commutative92.7%
neg-mul-192.7%
distribute-lft-neg-out92.7%
/-rgt-identity92.7%
div-sub92.7%
associate-/r*92.7%
neg-mul-192.7%
*-rgt-identity92.7%
times-frac92.7%
/-rgt-identity92.7%
*-commutative92.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 63.0%
cancel-sign-sub-inv63.0%
metadata-eval63.0%
associate-*r/63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in x around inf 100.0%
Final simplification89.9%
(FPCore (x y z) :precision binary64 (if (<= z -19000000000.0) (+ x (/ -1.0 x)) (if (<= z 210.0) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -19000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 210.0) {
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 <= (-19000000000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 210.0d0) 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 <= -19000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 210.0) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -19000000000.0: tmp = x + (-1.0 / x) elif z <= 210.0: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -19000000000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 210.0) 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 <= -19000000000.0) tmp = x + (-1.0 / x); elseif (z <= 210.0) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -19000000000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 210.0], 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 -19000000000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 210:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.9e10Initial program 89.6%
remove-double-neg89.6%
neg-mul-189.6%
associate-/l*89.8%
neg-mul-189.8%
associate-/r*89.8%
div-sub90.2%
metadata-eval90.2%
associate-/l*90.2%
*-commutative90.2%
neg-mul-190.2%
distribute-lft-neg-out90.2%
/-rgt-identity90.2%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.9e10 < z < 210Initial program 99.8%
Taylor expanded in z around 0 99.4%
if 210 < z Initial program 92.7%
remove-double-neg92.7%
neg-mul-192.7%
associate-/l*92.7%
neg-mul-192.7%
associate-/r*92.7%
div-sub92.7%
metadata-eval92.7%
associate-/l*92.7%
*-commutative92.7%
neg-mul-192.7%
distribute-lft-neg-out92.7%
/-rgt-identity92.7%
div-sub92.7%
associate-/r*92.7%
neg-mul-192.7%
*-rgt-identity92.7%
times-frac92.7%
/-rgt-identity92.7%
*-commutative92.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 63.0%
cancel-sign-sub-inv63.0%
metadata-eval63.0%
associate-*r/63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in x around inf 100.0%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (<= z -19000000000.0) (+ x (/ -1.0 x)) (if (<= z 190.0) (+ x (/ -1.0 (+ x (/ -1.1283791670955126 y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -19000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 190.0) {
tmp = x + (-1.0 / (x + (-1.1283791670955126 / 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 <= (-19000000000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 190.0d0) then
tmp = x + ((-1.0d0) / (x + ((-1.1283791670955126d0) / y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -19000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 190.0) {
tmp = x + (-1.0 / (x + (-1.1283791670955126 / y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -19000000000.0: tmp = x + (-1.0 / x) elif z <= 190.0: tmp = x + (-1.0 / (x + (-1.1283791670955126 / y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -19000000000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 190.0) tmp = Float64(x + Float64(-1.0 / Float64(x + Float64(-1.1283791670955126 / y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -19000000000.0) tmp = x + (-1.0 / x); elseif (z <= 190.0) tmp = x + (-1.0 / (x + (-1.1283791670955126 / y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -19000000000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 190.0], N[(x + N[(-1.0 / N[(x + N[(-1.1283791670955126 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -19000000000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 190:\\
\;\;\;\;x + \frac{-1}{x + \frac{-1.1283791670955126}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.9e10Initial program 89.6%
remove-double-neg89.6%
neg-mul-189.6%
associate-/l*89.8%
neg-mul-189.8%
associate-/r*89.8%
div-sub90.2%
metadata-eval90.2%
associate-/l*90.2%
*-commutative90.2%
neg-mul-190.2%
distribute-lft-neg-out90.2%
/-rgt-identity90.2%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.9e10 < z < 190Initial program 99.8%
remove-double-neg99.8%
neg-mul-199.8%
associate-/l*99.9%
neg-mul-199.9%
associate-/r*99.9%
div-sub99.9%
metadata-eval99.9%
associate-/l*99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-lft-neg-out99.9%
/-rgt-identity99.9%
div-sub99.9%
associate-/r*99.9%
neg-mul-199.9%
*-rgt-identity99.9%
times-frac99.9%
/-rgt-identity99.9%
*-commutative99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 99.4%
cancel-sign-sub-inv99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
if 190 < z Initial program 92.7%
remove-double-neg92.7%
neg-mul-192.7%
associate-/l*92.7%
neg-mul-192.7%
associate-/r*92.7%
div-sub92.7%
metadata-eval92.7%
associate-/l*92.7%
*-commutative92.7%
neg-mul-192.7%
distribute-lft-neg-out92.7%
/-rgt-identity92.7%
div-sub92.7%
associate-/r*92.7%
neg-mul-192.7%
*-rgt-identity92.7%
times-frac92.7%
/-rgt-identity92.7%
*-commutative92.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 63.0%
cancel-sign-sub-inv63.0%
metadata-eval63.0%
associate-*r/63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in x around inf 100.0%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x -8.6e-96)
x
(if (<= x -8e-253)
(/ -1.0 x)
(if (<= x 4.3e-114)
(+ x (/ y 1.1283791670955126))
(if (<= x 2.6e-6) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -8.6e-96) {
tmp = x;
} else if (x <= -8e-253) {
tmp = -1.0 / x;
} else if (x <= 4.3e-114) {
tmp = x + (y / 1.1283791670955126);
} else if (x <= 2.6e-6) {
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 <= (-8.6d-96)) then
tmp = x
else if (x <= (-8d-253)) then
tmp = (-1.0d0) / x
else if (x <= 4.3d-114) then
tmp = x + (y / 1.1283791670955126d0)
else if (x <= 2.6d-6) 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 <= -8.6e-96) {
tmp = x;
} else if (x <= -8e-253) {
tmp = -1.0 / x;
} else if (x <= 4.3e-114) {
tmp = x + (y / 1.1283791670955126);
} else if (x <= 2.6e-6) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8.6e-96: tmp = x elif x <= -8e-253: tmp = -1.0 / x elif x <= 4.3e-114: tmp = x + (y / 1.1283791670955126) elif x <= 2.6e-6: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8.6e-96) tmp = x; elseif (x <= -8e-253) tmp = Float64(-1.0 / x); elseif (x <= 4.3e-114) tmp = Float64(x + Float64(y / 1.1283791670955126)); elseif (x <= 2.6e-6) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -8.6e-96) tmp = x; elseif (x <= -8e-253) tmp = -1.0 / x; elseif (x <= 4.3e-114) tmp = x + (y / 1.1283791670955126); elseif (x <= 2.6e-6) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8.6e-96], x, If[LessEqual[x, -8e-253], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 4.3e-114], N[(x + N[(y / 1.1283791670955126), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-6], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{-96}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-253}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-114}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126}\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -8.59999999999999961e-96 or 2.60000000000000009e-6 < x Initial program 97.3%
remove-double-neg97.3%
neg-mul-197.3%
associate-/l*97.3%
neg-mul-197.3%
associate-/r*97.3%
div-sub97.3%
metadata-eval97.3%
associate-/l*97.3%
*-commutative97.3%
neg-mul-197.3%
distribute-lft-neg-out97.3%
/-rgt-identity97.3%
div-sub97.3%
associate-/r*97.3%
neg-mul-197.3%
*-rgt-identity97.3%
times-frac97.3%
/-rgt-identity97.3%
*-commutative97.3%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 96.4%
cancel-sign-sub-inv96.4%
metadata-eval96.4%
associate-*r/96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in x around inf 94.2%
if -8.59999999999999961e-96 < x < -8.0000000000000005e-253 or 4.3e-114 < x < 2.60000000000000009e-6Initial program 94.9%
remove-double-neg94.9%
neg-mul-194.9%
associate-/l*95.1%
neg-mul-195.1%
associate-/r*95.1%
div-sub95.2%
metadata-eval95.2%
associate-/l*95.2%
*-commutative95.2%
neg-mul-195.2%
distribute-lft-neg-out95.2%
/-rgt-identity95.2%
div-sub95.1%
associate-/r*95.1%
neg-mul-195.1%
*-rgt-identity95.1%
times-frac95.1%
/-rgt-identity95.1%
*-commutative95.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in x around inf 61.3%
Taylor expanded in x around 0 61.3%
if -8.0000000000000005e-253 < x < 4.3e-114Initial program 89.1%
Taylor expanded in z around 0 59.8%
Taylor expanded in x around 0 50.2%
Final simplification78.6%
(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 95.3%
remove-double-neg95.3%
neg-mul-195.3%
associate-/l*95.4%
neg-mul-195.4%
associate-/r*95.4%
div-sub95.5%
metadata-eval95.5%
associate-/l*95.5%
*-commutative95.5%
neg-mul-195.5%
distribute-lft-neg-out95.5%
/-rgt-identity95.5%
div-sub95.4%
associate-/r*95.4%
neg-mul-195.4%
*-rgt-identity95.4%
times-frac95.4%
/-rgt-identity95.4%
*-commutative95.4%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 81.4%
cancel-sign-sub-inv81.4%
metadata-eval81.4%
associate-*r/81.4%
metadata-eval81.4%
Simplified81.4%
Taylor expanded in x around inf 68.9%
Final simplification68.9%
(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 2023290
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))