
(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 87.3%
remove-double-neg87.3%
distribute-frac-neg87.3%
unsub-neg87.3%
distribute-frac-neg87.3%
distribute-neg-frac287.3%
neg-sub087.3%
associate--r-87.3%
neg-sub087.7%
+-commutative87.7%
fma-define87.7%
*-commutative87.7%
distribute-rgt-neg-in87.7%
metadata-eval87.7%
Simplified87.7%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 96.2%
remove-double-neg96.2%
distribute-frac-neg96.2%
unsub-neg96.2%
distribute-frac-neg96.2%
distribute-neg-frac296.2%
neg-sub096.2%
associate--r-96.2%
neg-sub096.2%
+-commutative96.2%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y)))))) (if (<= t_0 5e+240) t_0 (+ x (/ -1.0 x)))))
double code(double x, double y, double z) {
double t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 5e+240) {
tmp = t_0;
} else {
tmp = x + (-1.0 / 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 + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
if (t_0 <= 5d+240) then
tmp = t_0
else
tmp = x + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 5e+240) {
tmp = t_0;
} else {
tmp = x + (-1.0 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y))) tmp = 0 if t_0 <= 5e+240: tmp = t_0 else: tmp = x + (-1.0 / x) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y)))) tmp = 0.0 if (t_0 <= 5e+240) tmp = t_0; else tmp = Float64(x + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y))); tmp = 0.0; if (t_0 <= 5e+240) tmp = t_0; else tmp = x + (-1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+240], t$95$0, N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+240}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{x}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 5.0000000000000003e240Initial program 99.3%
if 5.0000000000000003e240 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) Initial program 45.0%
remove-double-neg45.0%
distribute-frac-neg45.0%
unsub-neg45.0%
distribute-frac-neg45.0%
distribute-neg-frac245.0%
neg-sub045.0%
associate--r-45.0%
neg-sub045.9%
+-commutative45.9%
fma-define73.9%
*-commutative73.9%
distribute-rgt-neg-in73.9%
metadata-eval73.9%
Simplified73.9%
Taylor expanded in y around inf 100.0%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x))) (t_1 (- x (/ y -1.1283791670955126))))
(if (<= z -8e-90)
t_0
(if (<= z -5.3e-225)
t_1
(if (<= z -2.4e-237)
x
(if (<= z -1.1e-289)
t_1
(if (<= z -8.4e-290)
x
(if (<= z 6.4e-268)
t_1
(if (<= z 3.25e-230)
t_0
(if (<= z 2.25e-187)
t_1
(if (<= z 1.7e-173)
x
(if (<= z 2.05e-101)
t_1
(if (<= z 5.2e-84) t_0 x)))))))))))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double t_1 = x - (y / -1.1283791670955126);
double tmp;
if (z <= -8e-90) {
tmp = t_0;
} else if (z <= -5.3e-225) {
tmp = t_1;
} else if (z <= -2.4e-237) {
tmp = x;
} else if (z <= -1.1e-289) {
tmp = t_1;
} else if (z <= -8.4e-290) {
tmp = x;
} else if (z <= 6.4e-268) {
tmp = t_1;
} else if (z <= 3.25e-230) {
tmp = t_0;
} else if (z <= 2.25e-187) {
tmp = t_1;
} else if (z <= 1.7e-173) {
tmp = x;
} else if (z <= 2.05e-101) {
tmp = t_1;
} else if (z <= 5.2e-84) {
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) :: t_1
real(8) :: tmp
t_0 = x + ((-1.0d0) / x)
t_1 = x - (y / (-1.1283791670955126d0))
if (z <= (-8d-90)) then
tmp = t_0
else if (z <= (-5.3d-225)) then
tmp = t_1
else if (z <= (-2.4d-237)) then
tmp = x
else if (z <= (-1.1d-289)) then
tmp = t_1
else if (z <= (-8.4d-290)) then
tmp = x
else if (z <= 6.4d-268) then
tmp = t_1
else if (z <= 3.25d-230) then
tmp = t_0
else if (z <= 2.25d-187) then
tmp = t_1
else if (z <= 1.7d-173) then
tmp = x
else if (z <= 2.05d-101) then
tmp = t_1
else if (z <= 5.2d-84) 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 t_1 = x - (y / -1.1283791670955126);
double tmp;
if (z <= -8e-90) {
tmp = t_0;
} else if (z <= -5.3e-225) {
tmp = t_1;
} else if (z <= -2.4e-237) {
tmp = x;
} else if (z <= -1.1e-289) {
tmp = t_1;
} else if (z <= -8.4e-290) {
tmp = x;
} else if (z <= 6.4e-268) {
tmp = t_1;
} else if (z <= 3.25e-230) {
tmp = t_0;
} else if (z <= 2.25e-187) {
tmp = t_1;
} else if (z <= 1.7e-173) {
tmp = x;
} else if (z <= 2.05e-101) {
tmp = t_1;
} else if (z <= 5.2e-84) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) t_1 = x - (y / -1.1283791670955126) tmp = 0 if z <= -8e-90: tmp = t_0 elif z <= -5.3e-225: tmp = t_1 elif z <= -2.4e-237: tmp = x elif z <= -1.1e-289: tmp = t_1 elif z <= -8.4e-290: tmp = x elif z <= 6.4e-268: tmp = t_1 elif z <= 3.25e-230: tmp = t_0 elif z <= 2.25e-187: tmp = t_1 elif z <= 1.7e-173: tmp = x elif z <= 2.05e-101: tmp = t_1 elif z <= 5.2e-84: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) t_1 = Float64(x - Float64(y / -1.1283791670955126)) tmp = 0.0 if (z <= -8e-90) tmp = t_0; elseif (z <= -5.3e-225) tmp = t_1; elseif (z <= -2.4e-237) tmp = x; elseif (z <= -1.1e-289) tmp = t_1; elseif (z <= -8.4e-290) tmp = x; elseif (z <= 6.4e-268) tmp = t_1; elseif (z <= 3.25e-230) tmp = t_0; elseif (z <= 2.25e-187) tmp = t_1; elseif (z <= 1.7e-173) tmp = x; elseif (z <= 2.05e-101) tmp = t_1; elseif (z <= 5.2e-84) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); t_1 = x - (y / -1.1283791670955126); tmp = 0.0; if (z <= -8e-90) tmp = t_0; elseif (z <= -5.3e-225) tmp = t_1; elseif (z <= -2.4e-237) tmp = x; elseif (z <= -1.1e-289) tmp = t_1; elseif (z <= -8.4e-290) tmp = x; elseif (z <= 6.4e-268) tmp = t_1; elseif (z <= 3.25e-230) tmp = t_0; elseif (z <= 2.25e-187) tmp = t_1; elseif (z <= 1.7e-173) tmp = x; elseif (z <= 2.05e-101) tmp = t_1; elseif (z <= 5.2e-84) 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]}, Block[{t$95$1 = N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e-90], t$95$0, If[LessEqual[z, -5.3e-225], t$95$1, If[LessEqual[z, -2.4e-237], x, If[LessEqual[z, -1.1e-289], t$95$1, If[LessEqual[z, -8.4e-290], x, If[LessEqual[z, 6.4e-268], t$95$1, If[LessEqual[z, 3.25e-230], t$95$0, If[LessEqual[z, 2.25e-187], t$95$1, If[LessEqual[z, 1.7e-173], x, If[LessEqual[z, 2.05e-101], t$95$1, If[LessEqual[z, 5.2e-84], t$95$0, x]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
t_1 := x - \frac{y}{-1.1283791670955126}\\
\mathbf{if}\;z \leq -8 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{-225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-237}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-289}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.4 \cdot 10^{-290}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-268}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{-230}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-173}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.99999999999999996e-90 or 6.3999999999999997e-268 < z < 3.2500000000000002e-230 or 2.05000000000000013e-101 < z < 5.2e-84Initial program 91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
unsub-neg91.6%
distribute-frac-neg91.6%
distribute-neg-frac291.6%
neg-sub091.6%
associate--r-91.6%
neg-sub091.9%
+-commutative91.9%
fma-define91.9%
*-commutative91.9%
distribute-rgt-neg-in91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in y around inf 93.6%
if -7.99999999999999996e-90 < z < -5.30000000000000005e-225 or -2.4e-237 < z < -1.1e-289 or -8.4000000000000005e-290 < z < 6.3999999999999997e-268 or 3.2500000000000002e-230 < z < 2.2499999999999999e-187 or 1.6999999999999999e-173 < z < 2.05000000000000013e-101Initial 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 84.9%
if -5.30000000000000005e-225 < z < -2.4e-237 or -1.1e-289 < z < -8.4000000000000005e-290 or 2.2499999999999999e-187 < z < 1.6999999999999999e-173 or 5.2e-84 < z Initial program 92.1%
remove-double-neg92.1%
distribute-frac-neg92.1%
unsub-neg92.1%
distribute-frac-neg92.1%
distribute-neg-frac292.1%
neg-sub092.1%
associate--r-92.1%
neg-sub092.1%
+-commutative92.1%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 53.6%
Taylor expanded in x around inf 90.5%
Final simplification90.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x))) (t_1 (- x (/ y -1.1283791670955126))))
(if (<= z -2.3e-90)
t_0
(if (<= z -4.9e-173)
(- x (* (* y (- 1.0 z)) -0.8862269254527579))
(if (<= z -2.55e-191)
t_0
(if (<= z 1.45e-256)
t_1
(if (<= z 4.6e-230)
t_0
(if (<= z 3.3e-187)
(+ x (* -0.8862269254527579 (- (* z y) y)))
(if (<= z 2.3e-166)
x
(if (<= z 1.4e-122)
t_1
(if (<= z 4.5e-83) t_0 (if (<= z 5e-21) t_1 x))))))))))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double t_1 = x - (y / -1.1283791670955126);
double tmp;
if (z <= -2.3e-90) {
tmp = t_0;
} else if (z <= -4.9e-173) {
tmp = x - ((y * (1.0 - z)) * -0.8862269254527579);
} else if (z <= -2.55e-191) {
tmp = t_0;
} else if (z <= 1.45e-256) {
tmp = t_1;
} else if (z <= 4.6e-230) {
tmp = t_0;
} else if (z <= 3.3e-187) {
tmp = x + (-0.8862269254527579 * ((z * y) - y));
} else if (z <= 2.3e-166) {
tmp = x;
} else if (z <= 1.4e-122) {
tmp = t_1;
} else if (z <= 4.5e-83) {
tmp = t_0;
} else if (z <= 5e-21) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x + ((-1.0d0) / x)
t_1 = x - (y / (-1.1283791670955126d0))
if (z <= (-2.3d-90)) then
tmp = t_0
else if (z <= (-4.9d-173)) then
tmp = x - ((y * (1.0d0 - z)) * (-0.8862269254527579d0))
else if (z <= (-2.55d-191)) then
tmp = t_0
else if (z <= 1.45d-256) then
tmp = t_1
else if (z <= 4.6d-230) then
tmp = t_0
else if (z <= 3.3d-187) then
tmp = x + ((-0.8862269254527579d0) * ((z * y) - y))
else if (z <= 2.3d-166) then
tmp = x
else if (z <= 1.4d-122) then
tmp = t_1
else if (z <= 4.5d-83) then
tmp = t_0
else if (z <= 5d-21) then
tmp = t_1
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 t_1 = x - (y / -1.1283791670955126);
double tmp;
if (z <= -2.3e-90) {
tmp = t_0;
} else if (z <= -4.9e-173) {
tmp = x - ((y * (1.0 - z)) * -0.8862269254527579);
} else if (z <= -2.55e-191) {
tmp = t_0;
} else if (z <= 1.45e-256) {
tmp = t_1;
} else if (z <= 4.6e-230) {
tmp = t_0;
} else if (z <= 3.3e-187) {
tmp = x + (-0.8862269254527579 * ((z * y) - y));
} else if (z <= 2.3e-166) {
tmp = x;
} else if (z <= 1.4e-122) {
tmp = t_1;
} else if (z <= 4.5e-83) {
tmp = t_0;
} else if (z <= 5e-21) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) t_1 = x - (y / -1.1283791670955126) tmp = 0 if z <= -2.3e-90: tmp = t_0 elif z <= -4.9e-173: tmp = x - ((y * (1.0 - z)) * -0.8862269254527579) elif z <= -2.55e-191: tmp = t_0 elif z <= 1.45e-256: tmp = t_1 elif z <= 4.6e-230: tmp = t_0 elif z <= 3.3e-187: tmp = x + (-0.8862269254527579 * ((z * y) - y)) elif z <= 2.3e-166: tmp = x elif z <= 1.4e-122: tmp = t_1 elif z <= 4.5e-83: tmp = t_0 elif z <= 5e-21: tmp = t_1 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) t_1 = Float64(x - Float64(y / -1.1283791670955126)) tmp = 0.0 if (z <= -2.3e-90) tmp = t_0; elseif (z <= -4.9e-173) tmp = Float64(x - Float64(Float64(y * Float64(1.0 - z)) * -0.8862269254527579)); elseif (z <= -2.55e-191) tmp = t_0; elseif (z <= 1.45e-256) tmp = t_1; elseif (z <= 4.6e-230) tmp = t_0; elseif (z <= 3.3e-187) tmp = Float64(x + Float64(-0.8862269254527579 * Float64(Float64(z * y) - y))); elseif (z <= 2.3e-166) tmp = x; elseif (z <= 1.4e-122) tmp = t_1; elseif (z <= 4.5e-83) tmp = t_0; elseif (z <= 5e-21) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); t_1 = x - (y / -1.1283791670955126); tmp = 0.0; if (z <= -2.3e-90) tmp = t_0; elseif (z <= -4.9e-173) tmp = x - ((y * (1.0 - z)) * -0.8862269254527579); elseif (z <= -2.55e-191) tmp = t_0; elseif (z <= 1.45e-256) tmp = t_1; elseif (z <= 4.6e-230) tmp = t_0; elseif (z <= 3.3e-187) tmp = x + (-0.8862269254527579 * ((z * y) - y)); elseif (z <= 2.3e-166) tmp = x; elseif (z <= 1.4e-122) tmp = t_1; elseif (z <= 4.5e-83) tmp = t_0; elseif (z <= 5e-21) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e-90], t$95$0, If[LessEqual[z, -4.9e-173], N[(x - N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.55e-191], t$95$0, If[LessEqual[z, 1.45e-256], t$95$1, If[LessEqual[z, 4.6e-230], t$95$0, If[LessEqual[z, 3.3e-187], N[(x + N[(-0.8862269254527579 * N[(N[(z * y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-166], x, If[LessEqual[z, 1.4e-122], t$95$1, If[LessEqual[z, 4.5e-83], t$95$0, If[LessEqual[z, 5e-21], t$95$1, x]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
t_1 := x - \frac{y}{-1.1283791670955126}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-173}:\\
\;\;\;\;x - \left(y \cdot \left(1 - z\right)\right) \cdot -0.8862269254527579\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{-191}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-256}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-230}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-187}:\\
\;\;\;\;x + -0.8862269254527579 \cdot \left(z \cdot y - y\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-166}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.2999999999999998e-90 or -4.89999999999999991e-173 < z < -2.5500000000000001e-191 or 1.44999999999999986e-256 < z < 4.5999999999999995e-230 or 1.3999999999999999e-122 < z < 4.49999999999999997e-83Initial program 92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
unsub-neg92.0%
distribute-frac-neg92.0%
distribute-neg-frac292.0%
neg-sub092.0%
associate--r-92.0%
neg-sub092.3%
+-commutative92.3%
fma-define92.3%
*-commutative92.3%
distribute-rgt-neg-in92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in y around inf 94.0%
if -2.2999999999999998e-90 < z < -4.89999999999999991e-173Initial program 99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
unsub-neg99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
fma-define99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in z around 0 92.8%
mul-1-neg92.8%
unsub-neg92.8%
Simplified92.8%
Taylor expanded in y around 0 92.8%
if -2.5500000000000001e-191 < z < 1.44999999999999986e-256 or 2.29999999999999999e-166 < z < 1.3999999999999999e-122 or 4.49999999999999997e-83 < z < 4.99999999999999973e-21Initial 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 81.0%
if 4.5999999999999995e-230 < z < 3.3e-187Initial program 99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
unsub-neg99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
fma-define99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in z around 0 94.5%
mul-1-neg94.5%
unsub-neg94.5%
Simplified94.5%
if 3.3e-187 < z < 2.29999999999999999e-166 or 4.99999999999999973e-21 < z Initial program 89.8%
remove-double-neg89.8%
distribute-frac-neg89.8%
unsub-neg89.8%
distribute-frac-neg89.8%
distribute-neg-frac289.8%
neg-sub089.8%
associate--r-89.8%
neg-sub089.8%
+-commutative89.8%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 52.9%
Taylor expanded in x around inf 98.6%
Final simplification92.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x)))
(t_1 (- x (/ y -1.1283791670955126)))
(t_2 (- x (* (* y (- 1.0 z)) -0.8862269254527579))))
(if (<= z -1.8e-86)
t_0
(if (<= z -4.7e-172)
t_2
(if (<= z -1.1e-189)
t_0
(if (<= z 2.9e-257)
t_1
(if (<= z 6e-230)
t_0
(if (<= z 1.75e-187)
t_2
(if (<= z 2.6e-168)
x
(if (<= z 6.2e-123)
t_1
(if (<= z 8.5e-79) t_0 (if (<= z 1.45e-21) t_1 x))))))))))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double t_1 = x - (y / -1.1283791670955126);
double t_2 = x - ((y * (1.0 - z)) * -0.8862269254527579);
double tmp;
if (z <= -1.8e-86) {
tmp = t_0;
} else if (z <= -4.7e-172) {
tmp = t_2;
} else if (z <= -1.1e-189) {
tmp = t_0;
} else if (z <= 2.9e-257) {
tmp = t_1;
} else if (z <= 6e-230) {
tmp = t_0;
} else if (z <= 1.75e-187) {
tmp = t_2;
} else if (z <= 2.6e-168) {
tmp = x;
} else if (z <= 6.2e-123) {
tmp = t_1;
} else if (z <= 8.5e-79) {
tmp = t_0;
} else if (z <= 1.45e-21) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x + ((-1.0d0) / x)
t_1 = x - (y / (-1.1283791670955126d0))
t_2 = x - ((y * (1.0d0 - z)) * (-0.8862269254527579d0))
if (z <= (-1.8d-86)) then
tmp = t_0
else if (z <= (-4.7d-172)) then
tmp = t_2
else if (z <= (-1.1d-189)) then
tmp = t_0
else if (z <= 2.9d-257) then
tmp = t_1
else if (z <= 6d-230) then
tmp = t_0
else if (z <= 1.75d-187) then
tmp = t_2
else if (z <= 2.6d-168) then
tmp = x
else if (z <= 6.2d-123) then
tmp = t_1
else if (z <= 8.5d-79) then
tmp = t_0
else if (z <= 1.45d-21) then
tmp = t_1
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 t_1 = x - (y / -1.1283791670955126);
double t_2 = x - ((y * (1.0 - z)) * -0.8862269254527579);
double tmp;
if (z <= -1.8e-86) {
tmp = t_0;
} else if (z <= -4.7e-172) {
tmp = t_2;
} else if (z <= -1.1e-189) {
tmp = t_0;
} else if (z <= 2.9e-257) {
tmp = t_1;
} else if (z <= 6e-230) {
tmp = t_0;
} else if (z <= 1.75e-187) {
tmp = t_2;
} else if (z <= 2.6e-168) {
tmp = x;
} else if (z <= 6.2e-123) {
tmp = t_1;
} else if (z <= 8.5e-79) {
tmp = t_0;
} else if (z <= 1.45e-21) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) t_1 = x - (y / -1.1283791670955126) t_2 = x - ((y * (1.0 - z)) * -0.8862269254527579) tmp = 0 if z <= -1.8e-86: tmp = t_0 elif z <= -4.7e-172: tmp = t_2 elif z <= -1.1e-189: tmp = t_0 elif z <= 2.9e-257: tmp = t_1 elif z <= 6e-230: tmp = t_0 elif z <= 1.75e-187: tmp = t_2 elif z <= 2.6e-168: tmp = x elif z <= 6.2e-123: tmp = t_1 elif z <= 8.5e-79: tmp = t_0 elif z <= 1.45e-21: tmp = t_1 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) t_1 = Float64(x - Float64(y / -1.1283791670955126)) t_2 = Float64(x - Float64(Float64(y * Float64(1.0 - z)) * -0.8862269254527579)) tmp = 0.0 if (z <= -1.8e-86) tmp = t_0; elseif (z <= -4.7e-172) tmp = t_2; elseif (z <= -1.1e-189) tmp = t_0; elseif (z <= 2.9e-257) tmp = t_1; elseif (z <= 6e-230) tmp = t_0; elseif (z <= 1.75e-187) tmp = t_2; elseif (z <= 2.6e-168) tmp = x; elseif (z <= 6.2e-123) tmp = t_1; elseif (z <= 8.5e-79) tmp = t_0; elseif (z <= 1.45e-21) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); t_1 = x - (y / -1.1283791670955126); t_2 = x - ((y * (1.0 - z)) * -0.8862269254527579); tmp = 0.0; if (z <= -1.8e-86) tmp = t_0; elseif (z <= -4.7e-172) tmp = t_2; elseif (z <= -1.1e-189) tmp = t_0; elseif (z <= 2.9e-257) tmp = t_1; elseif (z <= 6e-230) tmp = t_0; elseif (z <= 1.75e-187) tmp = t_2; elseif (z <= 2.6e-168) tmp = x; elseif (z <= 6.2e-123) tmp = t_1; elseif (z <= 8.5e-79) tmp = t_0; elseif (z <= 1.45e-21) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * -0.8862269254527579), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e-86], t$95$0, If[LessEqual[z, -4.7e-172], t$95$2, If[LessEqual[z, -1.1e-189], t$95$0, If[LessEqual[z, 2.9e-257], t$95$1, If[LessEqual[z, 6e-230], t$95$0, If[LessEqual[z, 1.75e-187], t$95$2, If[LessEqual[z, 2.6e-168], x, If[LessEqual[z, 6.2e-123], t$95$1, If[LessEqual[z, 8.5e-79], t$95$0, If[LessEqual[z, 1.45e-21], t$95$1, x]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
t_1 := x - \frac{y}{-1.1283791670955126}\\
t_2 := x - \left(y \cdot \left(1 - z\right)\right) \cdot -0.8862269254527579\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{-86}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-172}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-189}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-230}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-168}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-79}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.79999999999999983e-86 or -4.69999999999999976e-172 < z < -1.1000000000000001e-189 or 2.9000000000000002e-257 < z < 6e-230 or 6.19999999999999996e-123 < z < 8.50000000000000029e-79Initial program 92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
unsub-neg92.0%
distribute-frac-neg92.0%
distribute-neg-frac292.0%
neg-sub092.0%
associate--r-92.0%
neg-sub092.3%
+-commutative92.3%
fma-define92.3%
*-commutative92.3%
distribute-rgt-neg-in92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in y around inf 94.0%
if -1.79999999999999983e-86 < z < -4.69999999999999976e-172 or 6e-230 < z < 1.74999999999999989e-187Initial program 99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
unsub-neg99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
fma-define99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in z around 0 93.4%
mul-1-neg93.4%
unsub-neg93.4%
Simplified93.4%
Taylor expanded in y around 0 93.4%
if -1.1000000000000001e-189 < z < 2.9000000000000002e-257 or 2.6000000000000001e-168 < z < 6.19999999999999996e-123 or 8.50000000000000029e-79 < z < 1.45e-21Initial 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 81.0%
if 1.74999999999999989e-187 < z < 2.6000000000000001e-168 or 1.45e-21 < z Initial program 89.8%
remove-double-neg89.8%
distribute-frac-neg89.8%
unsub-neg89.8%
distribute-frac-neg89.8%
distribute-neg-frac289.8%
neg-sub089.8%
associate--r-89.8%
neg-sub089.8%
+-commutative89.8%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 52.9%
Taylor expanded in x around inf 98.6%
Final simplification92.1%
(FPCore (x y z)
:precision binary64
(if (<= z -100.0)
(+ x (/ -1.0 x))
(if (<= z 2.6)
(-
x
(/
y
(-
(+
(* x y)
(*
z
(-
(* z (- (* z -0.18806319451591877) 0.5641895835477563))
1.1283791670955126)))
1.1283791670955126)))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -100.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.6) {
tmp = x - (y / (((x * y) + (z * ((z * ((z * -0.18806319451591877) - 0.5641895835477563)) - 1.1283791670955126))) - 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 <= (-100.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.6d0) then
tmp = x - (y / (((x * y) + (z * ((z * ((z * (-0.18806319451591877d0)) - 0.5641895835477563d0)) - 1.1283791670955126d0))) - 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 <= -100.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.6) {
tmp = x - (y / (((x * y) + (z * ((z * ((z * -0.18806319451591877) - 0.5641895835477563)) - 1.1283791670955126))) - 1.1283791670955126));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -100.0: tmp = x + (-1.0 / x) elif z <= 2.6: tmp = x - (y / (((x * y) + (z * ((z * ((z * -0.18806319451591877) - 0.5641895835477563)) - 1.1283791670955126))) - 1.1283791670955126)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -100.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.6) tmp = Float64(x - Float64(y / Float64(Float64(Float64(x * y) + Float64(z * Float64(Float64(z * Float64(Float64(z * -0.18806319451591877) - 0.5641895835477563)) - 1.1283791670955126))) - 1.1283791670955126))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -100.0) tmp = x + (-1.0 / x); elseif (z <= 2.6) tmp = x - (y / (((x * y) + (z * ((z * ((z * -0.18806319451591877) - 0.5641895835477563)) - 1.1283791670955126))) - 1.1283791670955126)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -100.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6], N[(x - N[(y / N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(N[(z * N[(N[(z * -0.18806319451591877), $MachinePrecision] - 0.5641895835477563), $MachinePrecision]), $MachinePrecision] - 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -100:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.6:\\
\;\;\;\;x - \frac{y}{\left(x \cdot y + z \cdot \left(z \cdot \left(z \cdot -0.18806319451591877 - 0.5641895835477563\right) - 1.1283791670955126\right)\right) - 1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -100Initial program 87.3%
remove-double-neg87.3%
distribute-frac-neg87.3%
unsub-neg87.3%
distribute-frac-neg87.3%
distribute-neg-frac287.3%
neg-sub087.3%
associate--r-87.3%
neg-sub087.7%
+-commutative87.7%
fma-define87.7%
*-commutative87.7%
distribute-rgt-neg-in87.7%
metadata-eval87.7%
Simplified87.7%
Taylor expanded in y around inf 100.0%
if -100 < z < 2.60000000000000009Initial 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%
if 2.60000000000000009 < z Initial program 88.5%
remove-double-neg88.5%
distribute-frac-neg88.5%
unsub-neg88.5%
distribute-frac-neg88.5%
distribute-neg-frac288.5%
neg-sub088.5%
associate--r-88.5%
neg-sub088.5%
+-commutative88.5%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 50.0%
Taylor expanded in x around inf 100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -4.5e+19)
(+ x (/ -1.0 x))
(if (<= z 6e-21)
(+
x
(/
y
(+
1.1283791670955126
(- (* z (- 1.1283791670955126 (* z -0.5641895835477563))) (* x y)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+19) {
tmp = x + (-1.0 / x);
} else if (z <= 6e-21) {
tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * -0.5641895835477563))) - (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 <= (-4.5d+19)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 6d-21) then
tmp = x + (y / (1.1283791670955126d0 + ((z * (1.1283791670955126d0 - (z * (-0.5641895835477563d0)))) - (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 <= -4.5e+19) {
tmp = x + (-1.0 / x);
} else if (z <= 6e-21) {
tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * -0.5641895835477563))) - (x * y))));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.5e+19: tmp = x + (-1.0 / x) elif z <= 6e-21: tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * -0.5641895835477563))) - (x * y)))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.5e+19) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 6e-21) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(Float64(z * Float64(1.1283791670955126 - Float64(z * -0.5641895835477563))) - Float64(x * y))))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e+19) tmp = x + (-1.0 / x); elseif (z <= 6e-21) tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * -0.5641895835477563))) - (x * y)))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.5e+19], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-21], N[(x + N[(y / N[(1.1283791670955126 + N[(N[(z * N[(1.1283791670955126 - N[(z * -0.5641895835477563), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+19}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-21}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + \left(z \cdot \left(1.1283791670955126 - z \cdot -0.5641895835477563\right) - x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.5e19Initial program 86.0%
remove-double-neg86.0%
distribute-frac-neg86.0%
unsub-neg86.0%
distribute-frac-neg86.0%
distribute-neg-frac286.0%
neg-sub086.1%
associate--r-86.1%
neg-sub086.5%
+-commutative86.5%
fma-define86.5%
*-commutative86.5%
distribute-rgt-neg-in86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in y around inf 100.0%
if -4.5e19 < z < 5.99999999999999982e-21Initial 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 96.9%
if 5.99999999999999982e-21 < z Initial program 89.2%
remove-double-neg89.2%
distribute-frac-neg89.2%
unsub-neg89.2%
distribute-frac-neg89.2%
distribute-neg-frac289.2%
neg-sub089.2%
associate--r-89.2%
neg-sub089.2%
+-commutative89.2%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 51.5%
Taylor expanded in x around inf 98.5%
Final simplification98.0%
(FPCore (x y z)
:precision binary64
(if (<= z -10.5)
(+ x (/ -1.0 x))
(if (<= z 9.2e+24)
(- x (/ y (- (+ (* x y) (* z -1.1283791670955126)) 1.1283791670955126)))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -10.5) {
tmp = x + (-1.0 / x);
} else if (z <= 9.2e+24) {
tmp = x - (y / (((x * y) + (z * -1.1283791670955126)) - 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 <= (-10.5d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 9.2d+24) then
tmp = x - (y / (((x * y) + (z * (-1.1283791670955126d0))) - 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 <= -10.5) {
tmp = x + (-1.0 / x);
} else if (z <= 9.2e+24) {
tmp = x - (y / (((x * y) + (z * -1.1283791670955126)) - 1.1283791670955126));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -10.5: tmp = x + (-1.0 / x) elif z <= 9.2e+24: tmp = x - (y / (((x * y) + (z * -1.1283791670955126)) - 1.1283791670955126)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -10.5) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 9.2e+24) tmp = Float64(x - Float64(y / Float64(Float64(Float64(x * y) + Float64(z * -1.1283791670955126)) - 1.1283791670955126))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -10.5) tmp = x + (-1.0 / x); elseif (z <= 9.2e+24) tmp = x - (y / (((x * y) + (z * -1.1283791670955126)) - 1.1283791670955126)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -10.5], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+24], N[(x - N[(y / N[(N[(N[(x * y), $MachinePrecision] + N[(z * -1.1283791670955126), $MachinePrecision]), $MachinePrecision] - 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10.5:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+24}:\\
\;\;\;\;x - \frac{y}{\left(x \cdot y + z \cdot -1.1283791670955126\right) - 1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -10.5Initial program 87.3%
remove-double-neg87.3%
distribute-frac-neg87.3%
unsub-neg87.3%
distribute-frac-neg87.3%
distribute-neg-frac287.3%
neg-sub087.3%
associate--r-87.3%
neg-sub087.7%
+-commutative87.7%
fma-define87.7%
*-commutative87.7%
distribute-rgt-neg-in87.7%
metadata-eval87.7%
Simplified87.7%
Taylor expanded in y around inf 100.0%
if -10.5 < z < 9.1999999999999996e24Initial program 98.4%
remove-double-neg98.4%
distribute-frac-neg98.4%
unsub-neg98.4%
distribute-frac-neg98.4%
distribute-neg-frac298.4%
neg-sub098.4%
associate--r-98.4%
neg-sub098.4%
+-commutative98.4%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 97.9%
if 9.1999999999999996e24 < z Initial program 90.7%
remove-double-neg90.7%
distribute-frac-neg90.7%
unsub-neg90.7%
distribute-frac-neg90.7%
distribute-neg-frac290.7%
neg-sub090.7%
associate--r-90.7%
neg-sub090.7%
+-commutative90.7%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 49.0%
Taylor expanded in x around inf 100.0%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.25e+157) (not (<= y 3.1e+70))) (+ x (/ -1.0 x)) (- x (/ y (* -1.1283791670955126 (+ z 1.0))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.25e+157) || !(y <= 3.1e+70)) {
tmp = x + (-1.0 / x);
} else {
tmp = x - (y / (-1.1283791670955126 * (z + 1.0)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-2.25d+157)) .or. (.not. (y <= 3.1d+70))) then
tmp = x + ((-1.0d0) / x)
else
tmp = x - (y / ((-1.1283791670955126d0) * (z + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.25e+157) || !(y <= 3.1e+70)) {
tmp = x + (-1.0 / x);
} else {
tmp = x - (y / (-1.1283791670955126 * (z + 1.0)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.25e+157) or not (y <= 3.1e+70): tmp = x + (-1.0 / x) else: tmp = x - (y / (-1.1283791670955126 * (z + 1.0))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.25e+157) || !(y <= 3.1e+70)) tmp = Float64(x + Float64(-1.0 / x)); else tmp = Float64(x - Float64(y / Float64(-1.1283791670955126 * Float64(z + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.25e+157) || ~((y <= 3.1e+70))) tmp = x + (-1.0 / x); else tmp = x - (y / (-1.1283791670955126 * (z + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.25e+157], N[Not[LessEqual[y, 3.1e+70]], $MachinePrecision]], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(-1.1283791670955126 * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+157} \lor \neg \left(y \leq 3.1 \cdot 10^{+70}\right):\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126 \cdot \left(z + 1\right)}\\
\end{array}
\end{array}
if y < -2.24999999999999992e157 or 3.1000000000000003e70 < y Initial program 93.0%
remove-double-neg93.0%
distribute-frac-neg93.0%
unsub-neg93.0%
distribute-frac-neg93.0%
distribute-neg-frac293.0%
neg-sub093.0%
associate--r-93.0%
neg-sub093.0%
+-commutative93.0%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 80.3%
if -2.24999999999999992e157 < y < 3.1000000000000003e70Initial program 94.6%
remove-double-neg94.6%
distribute-frac-neg94.6%
unsub-neg94.6%
distribute-frac-neg94.6%
distribute-neg-frac294.6%
neg-sub094.6%
associate--r-94.6%
neg-sub094.7%
+-commutative94.7%
fma-define95.3%
*-commutative95.3%
distribute-rgt-neg-in95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around 0 86.3%
Taylor expanded in z around 0 83.7%
Taylor expanded in y around 0 81.5%
sub-neg81.5%
*-commutative81.5%
metadata-eval81.5%
distribute-lft1-in81.5%
Applied egg-rr81.5%
Final simplification81.1%
(FPCore (x y z) :precision binary64 (if (<= z -27000000000000.0) (+ x (/ -1.0 x)) (if (<= z 4.5e-37) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -27000000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4.5e-37) {
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 <= (-27000000000000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 4.5d-37) 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 <= -27000000000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4.5e-37) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -27000000000000.0: tmp = x + (-1.0 / x) elif z <= 4.5e-37: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -27000000000000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 4.5e-37) 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 <= -27000000000000.0) tmp = x + (-1.0 / x); elseif (z <= 4.5e-37) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -27000000000000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-37], 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 -27000000000000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-37}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.7e13Initial program 86.7%
remove-double-neg86.7%
distribute-frac-neg86.7%
unsub-neg86.7%
distribute-frac-neg86.7%
distribute-neg-frac286.7%
neg-sub086.7%
associate--r-86.7%
neg-sub087.1%
+-commutative87.1%
fma-define87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
metadata-eval87.1%
Simplified87.1%
Taylor expanded in y around inf 100.0%
if -2.7e13 < z < 4.5000000000000004e-37Initial 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 97.1%
if 4.5000000000000004e-37 < z Initial program 89.8%
remove-double-neg89.8%
distribute-frac-neg89.8%
unsub-neg89.8%
distribute-frac-neg89.8%
distribute-neg-frac289.8%
neg-sub089.8%
associate--r-89.8%
neg-sub089.8%
+-commutative89.8%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 51.5%
Taylor expanded in x around inf 95.8%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (<= z -2.35e-67) (+ x (/ -1.0 x)) x))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.35e-67) {
tmp = x + (-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 (z <= (-2.35d-67)) then
tmp = x + ((-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 (z <= -2.35e-67) {
tmp = x + (-1.0 / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.35e-67: tmp = x + (-1.0 / x) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.35e-67) tmp = Float64(x + Float64(-1.0 / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.35e-67) tmp = x + (-1.0 / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.35e-67], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{-67}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.35000000000000002e-67Initial program 89.4%
remove-double-neg89.4%
distribute-frac-neg89.4%
unsub-neg89.4%
distribute-frac-neg89.4%
distribute-neg-frac289.4%
neg-sub089.5%
associate--r-89.5%
neg-sub089.8%
+-commutative89.8%
fma-define89.8%
*-commutative89.8%
distribute-rgt-neg-in89.8%
metadata-eval89.8%
Simplified89.8%
Taylor expanded in y around inf 94.9%
if -2.35000000000000002e-67 < z Initial program 96.0%
remove-double-neg96.0%
distribute-frac-neg96.0%
unsub-neg96.0%
distribute-frac-neg96.0%
distribute-neg-frac296.0%
neg-sub096.0%
associate--r-96.0%
neg-sub096.0%
+-commutative96.0%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 56.0%
Taylor expanded in x around inf 74.8%
Final simplification80.8%
(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.0%
remove-double-neg94.0%
distribute-frac-neg94.0%
unsub-neg94.0%
distribute-frac-neg94.0%
distribute-neg-frac294.0%
neg-sub094.1%
associate--r-94.1%
neg-sub094.1%
+-commutative94.1%
fma-define96.9%
*-commutative96.9%
distribute-rgt-neg-in96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in y around inf 67.5%
Taylor expanded in x around inf 67.6%
(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 2024107
(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)))))