
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_2 -5e+50)
(- (/ y (/ t_1 z)) (/ x t_1))
(if (<= t_2 -1e-317)
t_2
(if (<= t_2 0.0)
(/ y (- a (/ t z)))
(if (<= t_2 INFINITY) (/ (fma z y (- x)) t_1) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -5e+50) {
tmp = (y / (t_1 / z)) - (x / t_1);
} else if (t_2 <= -1e-317) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = y / (a - (t / z));
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(z, y, -x) / t_1;
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_2 <= -5e+50) tmp = Float64(Float64(y / Float64(t_1 / z)) - Float64(x / t_1)); elseif (t_2 <= -1e-317) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (t_2 <= Inf) tmp = Float64(fma(z, y, Float64(-x)) / t_1); else tmp = Float64(y / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], N[(N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-317], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(z * y + (-x)), $MachinePrecision] / t$95$1), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;\frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-317}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, y, -x\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5e50Initial program 85.5%
sub-neg85.5%
+-commutative85.5%
neg-sub085.5%
associate-+l-85.5%
sub0-neg85.5%
neg-mul-185.5%
sub-neg85.5%
+-commutative85.5%
neg-sub085.5%
associate-+l-85.5%
sub0-neg85.5%
neg-mul-185.5%
times-frac85.5%
metadata-eval85.5%
*-lft-identity85.5%
*-commutative85.5%
Simplified85.5%
div-sub85.5%
associate-/l*99.8%
Applied egg-rr99.8%
if -5e50 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.00000023e-317Initial program 99.8%
if -1.00000023e-317 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 56.4%
sub-neg56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
sub0-neg56.4%
neg-mul-156.4%
sub-neg56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
sub0-neg56.4%
neg-mul-156.4%
times-frac56.4%
metadata-eval56.4%
*-lft-identity56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in y around inf 56.4%
*-commutative56.4%
associate-*r/56.4%
*-commutative56.4%
Simplified56.4%
clear-num56.4%
*-commutative56.4%
div-inv56.4%
Applied egg-rr56.4%
Taylor expanded in z around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
if -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 98.7%
sub-neg98.7%
+-commutative98.7%
neg-sub098.7%
associate-+l-98.7%
sub0-neg98.7%
neg-mul-198.7%
sub-neg98.7%
+-commutative98.7%
neg-sub098.7%
associate-+l-98.7%
sub0-neg98.7%
neg-mul-198.7%
times-frac98.7%
metadata-eval98.7%
*-lft-identity98.7%
*-commutative98.7%
Simplified98.7%
*-commutative98.7%
fma-neg98.7%
Applied egg-rr98.7%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
times-frac0.0%
metadata-eval0.0%
*-lft-identity0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification97.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_2 -5e+50)
(- (/ y (/ t_1 z)) (/ x t_1))
(if (<= t_2 -1e-317)
t_2
(if (<= t_2 0.0)
(/ y (- a (/ t z)))
(if (<= t_2 INFINITY) t_2 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -5e+50) {
tmp = (y / (t_1 / z)) - (x / t_1);
} else if (t_2 <= -1e-317) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = y / (a - (t / z));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -5e+50) {
tmp = (y / (t_1 / z)) - (x / t_1);
} else if (t_2 <= -1e-317) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = y / (a - (t / z));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_2 <= -5e+50: tmp = (y / (t_1 / z)) - (x / t_1) elif t_2 <= -1e-317: tmp = t_2 elif t_2 <= 0.0: tmp = y / (a - (t / z)) elif t_2 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_2 <= -5e+50) tmp = Float64(Float64(y / Float64(t_1 / z)) - Float64(x / t_1)); elseif (t_2 <= -1e-317) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_2 <= -5e+50) tmp = (y / (t_1 / z)) - (x / t_1); elseif (t_2 <= -1e-317) tmp = t_2; elseif (t_2 <= 0.0) tmp = y / (a - (t / z)); elseif (t_2 <= Inf) tmp = t_2; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], N[(N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-317], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;\frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-317}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5e50Initial program 85.5%
sub-neg85.5%
+-commutative85.5%
neg-sub085.5%
associate-+l-85.5%
sub0-neg85.5%
neg-mul-185.5%
sub-neg85.5%
+-commutative85.5%
neg-sub085.5%
associate-+l-85.5%
sub0-neg85.5%
neg-mul-185.5%
times-frac85.5%
metadata-eval85.5%
*-lft-identity85.5%
*-commutative85.5%
Simplified85.5%
div-sub85.5%
associate-/l*99.8%
Applied egg-rr99.8%
if -5e50 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.00000023e-317 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 99.1%
if -1.00000023e-317 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 56.4%
sub-neg56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
sub0-neg56.4%
neg-mul-156.4%
sub-neg56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
sub0-neg56.4%
neg-mul-156.4%
times-frac56.4%
metadata-eval56.4%
*-lft-identity56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in y around inf 56.4%
*-commutative56.4%
associate-*r/56.4%
*-commutative56.4%
Simplified56.4%
clear-num56.4%
*-commutative56.4%
div-inv56.4%
Applied egg-rr56.4%
Taylor expanded in z around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
times-frac0.0%
metadata-eval0.0%
*-lft-identity0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification97.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x) (- (* z a) t))))
(if (<= z -3.9)
(/ y (- a (/ t z)))
(if (<= z 2.9e-206)
t_1
(if (<= z 9.5e-121)
(/ (- x (* y z)) t)
(if (<= z 9.5e-37) t_1 (/ (- y (/ x z)) a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -x / ((z * a) - t);
double tmp;
if (z <= -3.9) {
tmp = y / (a - (t / z));
} else if (z <= 2.9e-206) {
tmp = t_1;
} else if (z <= 9.5e-121) {
tmp = (x - (y * z)) / t;
} else if (z <= 9.5e-37) {
tmp = t_1;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = -x / ((z * a) - t)
if (z <= (-3.9d0)) then
tmp = y / (a - (t / z))
else if (z <= 2.9d-206) then
tmp = t_1
else if (z <= 9.5d-121) then
tmp = (x - (y * z)) / t
else if (z <= 9.5d-37) then
tmp = t_1
else
tmp = (y - (x / z)) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -x / ((z * a) - t);
double tmp;
if (z <= -3.9) {
tmp = y / (a - (t / z));
} else if (z <= 2.9e-206) {
tmp = t_1;
} else if (z <= 9.5e-121) {
tmp = (x - (y * z)) / t;
} else if (z <= 9.5e-37) {
tmp = t_1;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -x / ((z * a) - t) tmp = 0 if z <= -3.9: tmp = y / (a - (t / z)) elif z <= 2.9e-206: tmp = t_1 elif z <= 9.5e-121: tmp = (x - (y * z)) / t elif z <= 9.5e-37: tmp = t_1 else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-x) / Float64(Float64(z * a) - t)) tmp = 0.0 if (z <= -3.9) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 2.9e-206) tmp = t_1; elseif (z <= 9.5e-121) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 9.5e-37) tmp = t_1; else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -x / ((z * a) - t); tmp = 0.0; if (z <= -3.9) tmp = y / (a - (t / z)); elseif (z <= 2.9e-206) tmp = t_1; elseif (z <= 9.5e-121) tmp = (x - (y * z)) / t; elseif (z <= 9.5e-37) tmp = t_1; else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-x) / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-206], t$95$1, If[LessEqual[z, 9.5e-121], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 9.5e-37], t$95$1, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot a - t}\\
\mathbf{if}\;z \leq -3.9:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -3.89999999999999991Initial program 70.9%
sub-neg70.9%
+-commutative70.9%
neg-sub070.9%
associate-+l-70.9%
sub0-neg70.9%
neg-mul-170.9%
sub-neg70.9%
+-commutative70.9%
neg-sub070.9%
associate-+l-70.9%
sub0-neg70.9%
neg-mul-170.9%
times-frac70.9%
metadata-eval70.9%
*-lft-identity70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in y around inf 59.5%
*-commutative59.5%
associate-*r/67.5%
*-commutative67.5%
Simplified67.5%
clear-num67.5%
*-commutative67.5%
div-inv67.8%
Applied egg-rr67.8%
Taylor expanded in z around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
if -3.89999999999999991 < z < 2.9000000000000002e-206 or 9.4999999999999994e-121 < z < 9.49999999999999927e-37Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 84.1%
neg-mul-184.1%
Simplified84.1%
if 2.9000000000000002e-206 < z < 9.4999999999999994e-121Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 83.9%
associate-*r/83.9%
neg-mul-183.9%
neg-sub083.9%
sub-neg83.9%
+-commutative83.9%
associate--r+83.9%
neg-sub083.9%
remove-double-neg83.9%
*-commutative83.9%
Simplified83.9%
if 9.49999999999999927e-37 < z Initial program 71.2%
sub-neg71.2%
+-commutative71.2%
neg-sub071.2%
associate-+l-71.2%
sub0-neg71.2%
neg-mul-171.2%
sub-neg71.2%
+-commutative71.2%
neg-sub071.2%
associate-+l-71.2%
sub0-neg71.2%
neg-mul-171.2%
times-frac71.2%
metadata-eval71.2%
*-lft-identity71.2%
*-commutative71.2%
Simplified71.2%
div-sub71.2%
*-un-lft-identity71.2%
times-frac78.3%
fma-neg78.3%
Applied egg-rr78.3%
Taylor expanded in a around inf 80.8%
Final simplification83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -1.4)
t_1
(if (<= z 6.6e-163)
(/ x t)
(if (<= z 1.3e-120)
(/ z (/ t (- y)))
(if (<= z 1.5e-53) (- (/ x (* z a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -1.4) {
tmp = t_1;
} else if (z <= 6.6e-163) {
tmp = x / t;
} else if (z <= 1.3e-120) {
tmp = z / (t / -y);
} else if (z <= 1.5e-53) {
tmp = -(x / (z * a));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y / (a - (t / z))
if (z <= (-1.4d0)) then
tmp = t_1
else if (z <= 6.6d-163) then
tmp = x / t
else if (z <= 1.3d-120) then
tmp = z / (t / -y)
else if (z <= 1.5d-53) then
tmp = -(x / (z * a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -1.4) {
tmp = t_1;
} else if (z <= 6.6e-163) {
tmp = x / t;
} else if (z <= 1.3e-120) {
tmp = z / (t / -y);
} else if (z <= 1.5e-53) {
tmp = -(x / (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -1.4: tmp = t_1 elif z <= 6.6e-163: tmp = x / t elif z <= 1.3e-120: tmp = z / (t / -y) elif z <= 1.5e-53: tmp = -(x / (z * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -1.4) tmp = t_1; elseif (z <= 6.6e-163) tmp = Float64(x / t); elseif (z <= 1.3e-120) tmp = Float64(z / Float64(t / Float64(-y))); elseif (z <= 1.5e-53) tmp = Float64(-Float64(x / Float64(z * a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -1.4) tmp = t_1; elseif (z <= 6.6e-163) tmp = x / t; elseif (z <= 1.3e-120) tmp = z / (t / -y); elseif (z <= 1.5e-53) tmp = -(x / (z * a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4], t$95$1, If[LessEqual[z, 6.6e-163], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.3e-120], N[(z / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-53], (-N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -1.4:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-163}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-120}:\\
\;\;\;\;\frac{z}{\frac{t}{-y}}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-53}:\\
\;\;\;\;-\frac{x}{z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.3999999999999999 or 1.5000000000000001e-53 < z Initial program 71.5%
sub-neg71.5%
+-commutative71.5%
neg-sub071.5%
associate-+l-71.5%
sub0-neg71.5%
neg-mul-171.5%
sub-neg71.5%
+-commutative71.5%
neg-sub071.5%
associate-+l-71.5%
sub0-neg71.5%
neg-mul-171.5%
times-frac71.5%
metadata-eval71.5%
*-lft-identity71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in y around inf 51.7%
*-commutative51.7%
associate-*r/59.2%
*-commutative59.2%
Simplified59.2%
clear-num59.2%
*-commutative59.2%
div-inv59.4%
Applied egg-rr59.4%
Taylor expanded in z around 0 77.0%
mul-1-neg77.0%
unsub-neg77.0%
Simplified77.0%
if -1.3999999999999999 < z < 6.60000000000000002e-163Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 67.9%
if 6.60000000000000002e-163 < z < 1.3000000000000001e-120Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
*-lft-identity99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in a around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
neg-sub082.1%
sub-neg82.1%
+-commutative82.1%
associate--r+82.1%
neg-sub082.1%
remove-double-neg82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in x around 0 58.1%
associate-*r/58.1%
mul-1-neg58.1%
*-commutative58.1%
distribute-rgt-neg-in58.1%
associate-/l*58.3%
Simplified58.3%
if 1.3000000000000001e-120 < z < 1.5000000000000001e-53Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 81.9%
neg-mul-181.9%
Simplified81.9%
Taylor expanded in z around inf 44.4%
associate-*r/44.4%
neg-mul-144.4%
Simplified44.4%
Final simplification70.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e+115) (/ y (- a (/ t z))) (if (<= z 7e+102) (/ (- x (* y z)) (- t (* z a))) (/ (- y (/ x z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+115) {
tmp = y / (a - (t / z));
} else if (z <= 7e+102) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.6d+115)) then
tmp = y / (a - (t / z))
else if (z <= 7d+102) then
tmp = (x - (y * z)) / (t - (z * a))
else
tmp = (y - (x / z)) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+115) {
tmp = y / (a - (t / z));
} else if (z <= 7e+102) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+115: tmp = y / (a - (t / z)) elif z <= 7e+102: tmp = (x - (y * z)) / (t - (z * a)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+115) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 7e+102) tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e+115) tmp = y / (a - (t / z)); elseif (z <= 7e+102) tmp = (x - (y * z)) / (t - (z * a)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+115], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+102], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+115}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+102}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -1.6e115Initial program 51.7%
sub-neg51.7%
+-commutative51.7%
neg-sub051.7%
associate-+l-51.7%
sub0-neg51.7%
neg-mul-151.7%
sub-neg51.7%
+-commutative51.7%
neg-sub051.7%
associate-+l-51.7%
sub0-neg51.7%
neg-mul-151.7%
times-frac51.7%
metadata-eval51.7%
*-lft-identity51.7%
*-commutative51.7%
Simplified51.7%
Taylor expanded in y around inf 46.1%
*-commutative46.1%
associate-*r/61.3%
*-commutative61.3%
Simplified61.3%
clear-num61.1%
*-commutative61.1%
div-inv61.4%
Applied egg-rr61.4%
Taylor expanded in z around 0 90.0%
mul-1-neg90.0%
unsub-neg90.0%
Simplified90.0%
if -1.6e115 < z < 7.00000000000000021e102Initial program 97.7%
if 7.00000000000000021e102 < z Initial program 59.0%
sub-neg59.0%
+-commutative59.0%
neg-sub059.0%
associate-+l-59.0%
sub0-neg59.0%
neg-mul-159.0%
sub-neg59.0%
+-commutative59.0%
neg-sub059.0%
associate-+l-59.0%
sub0-neg59.0%
neg-mul-159.0%
times-frac59.0%
metadata-eval59.0%
*-lft-identity59.0%
*-commutative59.0%
Simplified59.0%
div-sub59.0%
*-un-lft-identity59.0%
times-frac65.9%
fma-neg65.9%
Applied egg-rr65.9%
Taylor expanded in a around inf 84.5%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -0.65)
(/ y a)
(if (<= z 6.6e-163)
(/ x t)
(if (<= z 3.7e-122)
(/ z (/ t (- y)))
(if (<= z 1.5e-36) (- (/ x (* z a))) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.65) {
tmp = y / a;
} else if (z <= 6.6e-163) {
tmp = x / t;
} else if (z <= 3.7e-122) {
tmp = z / (t / -y);
} else if (z <= 1.5e-36) {
tmp = -(x / (z * a));
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-0.65d0)) then
tmp = y / a
else if (z <= 6.6d-163) then
tmp = x / t
else if (z <= 3.7d-122) then
tmp = z / (t / -y)
else if (z <= 1.5d-36) then
tmp = -(x / (z * a))
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.65) {
tmp = y / a;
} else if (z <= 6.6e-163) {
tmp = x / t;
} else if (z <= 3.7e-122) {
tmp = z / (t / -y);
} else if (z <= 1.5e-36) {
tmp = -(x / (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.65: tmp = y / a elif z <= 6.6e-163: tmp = x / t elif z <= 3.7e-122: tmp = z / (t / -y) elif z <= 1.5e-36: tmp = -(x / (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.65) tmp = Float64(y / a); elseif (z <= 6.6e-163) tmp = Float64(x / t); elseif (z <= 3.7e-122) tmp = Float64(z / Float64(t / Float64(-y))); elseif (z <= 1.5e-36) tmp = Float64(-Float64(x / Float64(z * a))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -0.65) tmp = y / a; elseif (z <= 6.6e-163) tmp = x / t; elseif (z <= 3.7e-122) tmp = z / (t / -y); elseif (z <= 1.5e-36) tmp = -(x / (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.65], N[(y / a), $MachinePrecision], If[LessEqual[z, 6.6e-163], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.7e-122], N[(z / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-36], (-N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.65:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-163}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-122}:\\
\;\;\;\;\frac{z}{\frac{t}{-y}}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-36}:\\
\;\;\;\;-\frac{x}{z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -0.650000000000000022 or 1.5000000000000001e-36 < z Initial program 71.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
times-frac71.0%
metadata-eval71.0%
*-lft-identity71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 62.4%
if -0.650000000000000022 < z < 6.60000000000000002e-163Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 67.9%
if 6.60000000000000002e-163 < z < 3.6999999999999997e-122Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
*-lft-identity99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in a around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
neg-sub082.1%
sub-neg82.1%
+-commutative82.1%
associate--r+82.1%
neg-sub082.1%
remove-double-neg82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in x around 0 58.1%
associate-*r/58.1%
mul-1-neg58.1%
*-commutative58.1%
distribute-rgt-neg-in58.1%
associate-/l*58.3%
Simplified58.3%
if 3.6999999999999997e-122 < z < 1.5000000000000001e-36Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 79.4%
neg-mul-179.4%
Simplified79.4%
Taylor expanded in z around inf 40.9%
associate-*r/40.9%
neg-mul-140.9%
Simplified40.9%
Final simplification62.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -0.78)
(/ y a)
(if (<= z 5.6e-163)
(/ x t)
(if (<= z 5.8e-121)
(* (/ y t) (- z))
(if (<= z 3.2e-35) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.78) {
tmp = y / a;
} else if (z <= 5.6e-163) {
tmp = x / t;
} else if (z <= 5.8e-121) {
tmp = (y / t) * -z;
} else if (z <= 3.2e-35) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-0.78d0)) then
tmp = y / a
else if (z <= 5.6d-163) then
tmp = x / t
else if (z <= 5.8d-121) then
tmp = (y / t) * -z
else if (z <= 3.2d-35) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.78) {
tmp = y / a;
} else if (z <= 5.6e-163) {
tmp = x / t;
} else if (z <= 5.8e-121) {
tmp = (y / t) * -z;
} else if (z <= 3.2e-35) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.78: tmp = y / a elif z <= 5.6e-163: tmp = x / t elif z <= 5.8e-121: tmp = (y / t) * -z elif z <= 3.2e-35: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.78) tmp = Float64(y / a); elseif (z <= 5.6e-163) tmp = Float64(x / t); elseif (z <= 5.8e-121) tmp = Float64(Float64(y / t) * Float64(-z)); elseif (z <= 3.2e-35) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -0.78) tmp = y / a; elseif (z <= 5.6e-163) tmp = x / t; elseif (z <= 5.8e-121) tmp = (y / t) * -z; elseif (z <= 3.2e-35) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.78], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.6e-163], N[(x / t), $MachinePrecision], If[LessEqual[z, 5.8e-121], N[(N[(y / t), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[z, 3.2e-35], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.78:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-163}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-121}:\\
\;\;\;\;\frac{y}{t} \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-35}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -0.78000000000000003 or 3.1999999999999998e-35 < z Initial program 71.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
times-frac71.0%
metadata-eval71.0%
*-lft-identity71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 62.4%
if -0.78000000000000003 < z < 5.5999999999999999e-163 or 5.8e-121 < z < 3.1999999999999998e-35Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 62.2%
if 5.5999999999999999e-163 < z < 5.8e-121Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
*-lft-identity99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 57.9%
*-commutative57.9%
associate-*r/41.5%
*-commutative41.5%
Simplified41.5%
clear-num41.6%
*-commutative41.6%
div-inv41.6%
Applied egg-rr41.6%
Taylor expanded in z around 0 41.7%
associate-*r/41.7%
neg-mul-141.7%
Simplified41.7%
Taylor expanded in y around 0 58.1%
mul-1-neg58.1%
associate-*l/58.0%
*-commutative58.0%
distribute-rgt-neg-in58.0%
Simplified58.0%
Final simplification62.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.5)
(/ y a)
(if (<= z 6.6e-163)
(/ x t)
(if (<= z 4.2e-123)
(/ z (/ t (- y)))
(if (<= z 8.5e-36) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5) {
tmp = y / a;
} else if (z <= 6.6e-163) {
tmp = x / t;
} else if (z <= 4.2e-123) {
tmp = z / (t / -y);
} else if (z <= 8.5e-36) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.5d0)) then
tmp = y / a
else if (z <= 6.6d-163) then
tmp = x / t
else if (z <= 4.2d-123) then
tmp = z / (t / -y)
else if (z <= 8.5d-36) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5) {
tmp = y / a;
} else if (z <= 6.6e-163) {
tmp = x / t;
} else if (z <= 4.2e-123) {
tmp = z / (t / -y);
} else if (z <= 8.5e-36) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5: tmp = y / a elif z <= 6.6e-163: tmp = x / t elif z <= 4.2e-123: tmp = z / (t / -y) elif z <= 8.5e-36: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5) tmp = Float64(y / a); elseif (z <= 6.6e-163) tmp = Float64(x / t); elseif (z <= 4.2e-123) tmp = Float64(z / Float64(t / Float64(-y))); elseif (z <= 8.5e-36) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5) tmp = y / a; elseif (z <= 6.6e-163) tmp = x / t; elseif (z <= 4.2e-123) tmp = z / (t / -y); elseif (z <= 8.5e-36) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5], N[(y / a), $MachinePrecision], If[LessEqual[z, 6.6e-163], N[(x / t), $MachinePrecision], If[LessEqual[z, 4.2e-123], N[(z / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-36], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-163}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-123}:\\
\;\;\;\;\frac{z}{\frac{t}{-y}}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-36}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.5 or 8.5000000000000007e-36 < z Initial program 71.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
times-frac71.0%
metadata-eval71.0%
*-lft-identity71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 62.4%
if -7.5 < z < 6.60000000000000002e-163 or 4.1999999999999998e-123 < z < 8.5000000000000007e-36Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 62.2%
if 6.60000000000000002e-163 < z < 4.1999999999999998e-123Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
sub-neg99.6%
+-commutative99.6%
neg-sub099.6%
associate-+l-99.6%
sub0-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
*-lft-identity99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in a around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
neg-sub082.1%
sub-neg82.1%
+-commutative82.1%
associate--r+82.1%
neg-sub082.1%
remove-double-neg82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in x around 0 58.1%
associate-*r/58.1%
mul-1-neg58.1%
*-commutative58.1%
distribute-rgt-neg-in58.1%
associate-/l*58.3%
Simplified58.3%
Final simplification62.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5) (not (<= z 1e-41))) (/ y (- a (/ t z))) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5) || !(z <= 1e-41)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.5d0)) .or. (.not. (z <= 1d-41))) then
tmp = y / (a - (t / z))
else
tmp = (x - (y * z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5) || !(z <= 1e-41)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5) or not (z <= 1e-41): tmp = y / (a - (t / z)) else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5) || !(z <= 1e-41)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5) || ~((z <= 1e-41))) tmp = y / (a - (t / z)); else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5], N[Not[LessEqual[z, 1e-41]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \lor \neg \left(z \leq 10^{-41}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -4.5 or 1.00000000000000001e-41 < z Initial program 71.2%
sub-neg71.2%
+-commutative71.2%
neg-sub071.2%
associate-+l-71.2%
sub0-neg71.2%
neg-mul-171.2%
sub-neg71.2%
+-commutative71.2%
neg-sub071.2%
associate-+l-71.2%
sub0-neg71.2%
neg-mul-171.2%
times-frac71.2%
metadata-eval71.2%
*-lft-identity71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in y around inf 52.1%
*-commutative52.1%
associate-*r/59.6%
*-commutative59.6%
Simplified59.6%
clear-num59.6%
*-commutative59.6%
div-inv59.8%
Applied egg-rr59.8%
Taylor expanded in z around 0 77.6%
mul-1-neg77.6%
unsub-neg77.6%
Simplified77.6%
if -4.5 < z < 1.00000000000000001e-41Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 74.6%
associate-*r/74.6%
neg-mul-174.6%
neg-sub074.6%
sub-neg74.6%
+-commutative74.6%
associate--r+74.6%
neg-sub074.6%
remove-double-neg74.6%
*-commutative74.6%
Simplified74.6%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.8) (/ y (- a (/ t z))) (if (<= z 2e-21) (/ (- x (* y z)) t) (/ (- y (/ x z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.8) {
tmp = y / (a - (t / z));
} else if (z <= 2e-21) {
tmp = (x - (y * z)) / t;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-0.8d0)) then
tmp = y / (a - (t / z))
else if (z <= 2d-21) then
tmp = (x - (y * z)) / t
else
tmp = (y - (x / z)) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.8) {
tmp = y / (a - (t / z));
} else if (z <= 2e-21) {
tmp = (x - (y * z)) / t;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.8: tmp = y / (a - (t / z)) elif z <= 2e-21: tmp = (x - (y * z)) / t else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.8) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 2e-21) tmp = Float64(Float64(x - Float64(y * z)) / t); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -0.8) tmp = y / (a - (t / z)); elseif (z <= 2e-21) tmp = (x - (y * z)) / t; else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.8], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-21], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.8:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-21}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -0.80000000000000004Initial program 70.9%
sub-neg70.9%
+-commutative70.9%
neg-sub070.9%
associate-+l-70.9%
sub0-neg70.9%
neg-mul-170.9%
sub-neg70.9%
+-commutative70.9%
neg-sub070.9%
associate-+l-70.9%
sub0-neg70.9%
neg-mul-170.9%
times-frac70.9%
metadata-eval70.9%
*-lft-identity70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in y around inf 59.5%
*-commutative59.5%
associate-*r/67.5%
*-commutative67.5%
Simplified67.5%
clear-num67.5%
*-commutative67.5%
div-inv67.8%
Applied egg-rr67.8%
Taylor expanded in z around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
if -0.80000000000000004 < z < 1.99999999999999982e-21Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 74.1%
associate-*r/74.1%
neg-mul-174.1%
neg-sub074.1%
sub-neg74.1%
+-commutative74.1%
associate--r+74.1%
neg-sub074.1%
remove-double-neg74.1%
*-commutative74.1%
Simplified74.1%
if 1.99999999999999982e-21 < z Initial program 69.5%
sub-neg69.5%
+-commutative69.5%
neg-sub069.5%
associate-+l-69.5%
sub0-neg69.5%
neg-mul-169.5%
sub-neg69.5%
+-commutative69.5%
neg-sub069.5%
associate-+l-69.5%
sub0-neg69.5%
neg-mul-169.5%
times-frac69.5%
metadata-eval69.5%
*-lft-identity69.5%
*-commutative69.5%
Simplified69.5%
div-sub69.5%
*-un-lft-identity69.5%
times-frac77.0%
fma-neg77.0%
Applied egg-rr77.0%
Taylor expanded in a around inf 82.6%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85) (/ y a) (if (<= z 8.5e-36) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85) {
tmp = y / a;
} else if (z <= 8.5e-36) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.85d0)) then
tmp = y / a
else if (z <= 8.5d-36) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85) {
tmp = y / a;
} else if (z <= 8.5e-36) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85: tmp = y / a elif z <= 8.5e-36: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85) tmp = Float64(y / a); elseif (z <= 8.5e-36) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.85) tmp = y / a; elseif (z <= 8.5e-36) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85], N[(y / a), $MachinePrecision], If[LessEqual[z, 8.5e-36], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-36}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.8500000000000001 or 8.5000000000000007e-36 < z Initial program 71.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
sub-neg71.0%
+-commutative71.0%
neg-sub071.0%
associate-+l-71.0%
sub0-neg71.0%
neg-mul-171.0%
times-frac71.0%
metadata-eval71.0%
*-lft-identity71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 62.4%
if -1.8500000000000001 < z < 8.5000000000000007e-36Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 58.6%
Final simplification60.5%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 85.1%
sub-neg85.1%
+-commutative85.1%
neg-sub085.1%
associate-+l-85.1%
sub0-neg85.1%
neg-mul-185.1%
sub-neg85.1%
+-commutative85.1%
neg-sub085.1%
associate-+l-85.1%
sub0-neg85.1%
neg-mul-185.1%
times-frac85.1%
metadata-eval85.1%
*-lft-identity85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in z around 0 35.9%
Final simplification35.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023240
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))