
(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 (- (/ y (/ t_1 z)) (/ x t_1)))
(t_3 (/ (- x (* y z)) (- t (* z a))))
(t_4 (- (* y z) x)))
(if (<= t_3 -2e-24)
t_2
(if (<= t_3 0.0)
(/ 1.0 (- (/ z (/ t_4 a)) (/ t t_4)))
(if (<= t_3 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 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double t_4 = (y * z) - x;
double tmp;
if (t_3 <= -2e-24) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4));
} else if (t_3 <= ((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 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double t_4 = (y * z) - x;
double tmp;
if (t_3 <= -2e-24) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4));
} else if (t_3 <= 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 = (y / (t_1 / z)) - (x / t_1) t_3 = (x - (y * z)) / (t - (z * a)) t_4 = (y * z) - x tmp = 0 if t_3 <= -2e-24: tmp = t_2 elif t_3 <= 0.0: tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4)) elif t_3 <= 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(y / Float64(t_1 / z)) - Float64(x / t_1)) t_3 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) t_4 = Float64(Float64(y * z) - x) tmp = 0.0 if (t_3 <= -2e-24) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(1.0 / Float64(Float64(z / Float64(t_4 / a)) - Float64(t / t_4))); elseif (t_3 <= 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 = (y / (t_1 / z)) - (x / t_1); t_3 = (x - (y * z)) / (t - (z * a)); t_4 = (y * z) - x; tmp = 0.0; if (t_3 <= -2e-24) tmp = t_2; elseif (t_3 <= 0.0) tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4)); elseif (t_3 <= 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[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-24], t$95$2, If[LessEqual[t$95$3, 0.0], N[(1.0 / N[(N[(z / N[(t$95$4 / a), $MachinePrecision]), $MachinePrecision] - N[(t / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
t_3 := \frac{x - y \cdot z}{t - z \cdot a}\\
t_4 := y \cdot z - x\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{-24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{t_4}{a}} - \frac{t}{t_4}}\\
\mathbf{elif}\;t_3 \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))) < -1.99999999999999985e-24 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 90.8%
sub-neg90.8%
+-commutative90.8%
neg-sub090.8%
associate-+l-90.8%
sub0-neg90.8%
neg-mul-190.8%
sub-neg90.8%
+-commutative90.8%
neg-sub090.8%
associate-+l-90.8%
sub0-neg90.8%
neg-mul-190.8%
times-frac90.8%
metadata-eval90.8%
*-lft-identity90.8%
*-commutative90.8%
Simplified90.8%
div-sub90.2%
associate-/l*98.2%
Applied egg-rr98.2%
if -1.99999999999999985e-24 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 74.6%
sub-neg74.6%
+-commutative74.6%
neg-sub074.6%
associate-+l-74.6%
sub0-neg74.6%
neg-mul-174.6%
sub-neg74.6%
+-commutative74.6%
neg-sub074.6%
associate-+l-74.6%
sub0-neg74.6%
neg-mul-174.6%
times-frac74.6%
metadata-eval74.6%
*-lft-identity74.6%
*-commutative74.6%
Simplified74.6%
div-sub74.6%
associate-/l*71.0%
Applied egg-rr71.0%
div-inv70.9%
*-commutative70.9%
clear-num71.3%
associate-*r/74.6%
*-commutative74.6%
div-sub74.6%
clear-num74.5%
*-commutative74.5%
Applied egg-rr74.5%
div-sub74.5%
sub-neg74.5%
associate-/l*98.2%
*-commutative98.2%
fma-neg98.2%
*-commutative98.2%
fma-neg98.2%
Applied egg-rr98.2%
sub-neg98.2%
fma-neg98.2%
fma-neg98.2%
Simplified98.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 simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t))
(t_2 (- (/ y (/ t_1 z)) (/ x t_1)))
(t_3 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_3 -5e-265)
t_2
(if (<= t_3 0.0)
(/ y (- a (/ t z)))
(if (<= t_3 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 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_3 <= -5e-265) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = y / (a - (t / z));
} else if (t_3 <= ((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 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_3 <= -5e-265) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = y / (a - (t / z));
} else if (t_3 <= 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 = (y / (t_1 / z)) - (x / t_1) t_3 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_3 <= -5e-265: tmp = t_2 elif t_3 <= 0.0: tmp = y / (a - (t / z)) elif t_3 <= 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(y / Float64(t_1 / z)) - Float64(x / t_1)) t_3 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_3 <= -5e-265) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (t_3 <= 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 = (y / (t_1 / z)) - (x / t_1); t_3 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_3 <= -5e-265) tmp = t_2; elseif (t_3 <= 0.0) tmp = y / (a - (t / z)); elseif (t_3 <= 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[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-265], t$95$2, If[LessEqual[t$95$3, 0.0], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
t_3 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-265}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;t_3 \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))) < -5.0000000000000001e-265 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 92.3%
sub-neg92.3%
+-commutative92.3%
neg-sub092.3%
associate-+l-92.3%
sub0-neg92.3%
neg-mul-192.3%
sub-neg92.3%
+-commutative92.3%
neg-sub092.3%
associate-+l-92.3%
sub0-neg92.3%
neg-mul-192.3%
times-frac92.3%
metadata-eval92.3%
*-lft-identity92.3%
*-commutative92.3%
Simplified92.3%
div-sub91.9%
associate-/l*97.2%
Applied egg-rr97.2%
if -5.0000000000000001e-265 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 45.9%
sub-neg45.9%
+-commutative45.9%
neg-sub045.9%
associate-+l-45.9%
sub0-neg45.9%
neg-mul-145.9%
sub-neg45.9%
+-commutative45.9%
neg-sub045.9%
associate-+l-45.9%
sub0-neg45.9%
neg-mul-145.9%
times-frac45.9%
metadata-eval45.9%
*-lft-identity45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
associate-*r/45.9%
*-commutative45.9%
Simplified45.9%
clear-num45.9%
*-commutative45.9%
div-inv45.9%
Applied egg-rr45.9%
Taylor expanded in z around 0 82.1%
mul-1-neg82.1%
unsub-neg82.1%
Simplified82.1%
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 simplification95.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.15e+99) (/ (- y (/ x z)) a) (if (<= z 4e+97) (/ (- x (* y z)) (- t (* z a))) (/ y (- a (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.15e+99) {
tmp = (y - (x / z)) / a;
} else if (z <= 4e+97) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = y / (a - (t / z));
}
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 <= (-2.15d+99)) then
tmp = (y - (x / z)) / a
else if (z <= 4d+97) then
tmp = (x - (y * z)) / (t - (z * a))
else
tmp = y / (a - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.15e+99) {
tmp = (y - (x / z)) / a;
} else if (z <= 4e+97) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.15e+99: tmp = (y - (x / z)) / a elif z <= 4e+97: tmp = (x - (y * z)) / (t - (z * a)) else: tmp = y / (a - (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.15e+99) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (z <= 4e+97) tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); else tmp = Float64(y / Float64(a - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.15e+99) tmp = (y - (x / z)) / a; elseif (z <= 4e+97) tmp = (x - (y * z)) / (t - (z * a)); else tmp = y / (a - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.15e+99], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 4e+97], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+99}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+97}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -2.1500000000000001e99Initial program 60.7%
sub-neg60.7%
+-commutative60.7%
neg-sub060.7%
associate-+l-60.7%
sub0-neg60.7%
neg-mul-160.7%
sub-neg60.7%
+-commutative60.7%
neg-sub060.7%
associate-+l-60.7%
sub0-neg60.7%
neg-mul-160.7%
times-frac60.7%
metadata-eval60.7%
*-lft-identity60.7%
*-commutative60.7%
Simplified60.7%
div-sub60.7%
associate-/l*77.4%
Applied egg-rr77.4%
Taylor expanded in a around inf 85.2%
if -2.1500000000000001e99 < z < 4.0000000000000003e97Initial program 99.1%
if 4.0000000000000003e97 < z Initial program 48.9%
sub-neg48.9%
+-commutative48.9%
neg-sub048.9%
associate-+l-48.9%
sub0-neg48.9%
neg-mul-148.9%
sub-neg48.9%
+-commutative48.9%
neg-sub048.9%
associate-+l-48.9%
sub0-neg48.9%
neg-mul-148.9%
times-frac48.9%
metadata-eval48.9%
*-lft-identity48.9%
*-commutative48.9%
Simplified48.9%
Taylor expanded in y around inf 38.5%
*-commutative38.5%
associate-*r/54.6%
*-commutative54.6%
Simplified54.6%
clear-num54.7%
*-commutative54.7%
div-inv54.8%
Applied egg-rr54.8%
Taylor expanded in z around 0 75.6%
mul-1-neg75.6%
unsub-neg75.6%
Simplified75.6%
Final simplification92.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.35e-88) (not (<= t 1.6e-83))) (- (/ x t) (/ z (/ t y))) (/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.35e-88) || !(t <= 1.6e-83)) {
tmp = (x / t) - (z / (t / y));
} 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 ((t <= (-1.35d-88)) .or. (.not. (t <= 1.6d-83))) then
tmp = (x / t) - (z / (t / y))
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 ((t <= -1.35e-88) || !(t <= 1.6e-83)) {
tmp = (x / t) - (z / (t / y));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.35e-88) or not (t <= 1.6e-83): tmp = (x / t) - (z / (t / y)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.35e-88) || !(t <= 1.6e-83)) tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); 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 ((t <= -1.35e-88) || ~((t <= 1.6e-83))) tmp = (x / t) - (z / (t / y)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.35e-88], N[Not[LessEqual[t, 1.6e-83]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-88} \lor \neg \left(t \leq 1.6 \cdot 10^{-83}\right):\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if t < -1.34999999999999997e-88 or 1.6000000000000001e-83 < t Initial program 85.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
times-frac85.2%
metadata-eval85.2%
*-lft-identity85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in a around 0 67.0%
associate-*r/67.0%
neg-mul-167.0%
neg-sub067.0%
sub-neg67.0%
+-commutative67.0%
associate--r+67.0%
neg-sub067.0%
remove-double-neg67.0%
*-commutative67.0%
Simplified67.0%
div-sub67.0%
associate-/l*70.6%
Applied egg-rr70.6%
if -1.34999999999999997e-88 < t < 1.6000000000000001e-83Initial program 80.7%
sub-neg80.7%
+-commutative80.7%
neg-sub080.7%
associate-+l-80.7%
sub0-neg80.7%
neg-mul-180.7%
sub-neg80.7%
+-commutative80.7%
neg-sub080.7%
associate-+l-80.7%
sub0-neg80.7%
neg-mul-180.7%
times-frac80.7%
metadata-eval80.7%
*-lft-identity80.7%
*-commutative80.7%
Simplified80.7%
div-sub79.6%
associate-/l*85.4%
Applied egg-rr85.4%
Taylor expanded in a around inf 80.4%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -3.4e+23) (not (<= x 1e+42))) (/ (- x) (- (* z a) t)) (/ y (- a (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -3.4e+23) || !(x <= 1e+42)) {
tmp = -x / ((z * a) - t);
} else {
tmp = y / (a - (t / z));
}
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 ((x <= (-3.4d+23)) .or. (.not. (x <= 1d+42))) then
tmp = -x / ((z * a) - t)
else
tmp = y / (a - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -3.4e+23) || !(x <= 1e+42)) {
tmp = -x / ((z * a) - t);
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -3.4e+23) or not (x <= 1e+42): tmp = -x / ((z * a) - t) else: tmp = y / (a - (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -3.4e+23) || !(x <= 1e+42)) tmp = Float64(Float64(-x) / Float64(Float64(z * a) - t)); else tmp = Float64(y / Float64(a - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -3.4e+23) || ~((x <= 1e+42))) tmp = -x / ((z * a) - t); else tmp = y / (a - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -3.4e+23], N[Not[LessEqual[x, 1e+42]], $MachinePrecision]], N[((-x) / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+23} \lor \neg \left(x \leq 10^{+42}\right):\\
\;\;\;\;\frac{-x}{z \cdot a - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if x < -3.39999999999999992e23 or 1.00000000000000004e42 < x Initial 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%
Taylor expanded in y around 0 70.7%
neg-mul-170.7%
Simplified70.7%
if -3.39999999999999992e23 < x < 1.00000000000000004e42Initial program 81.7%
sub-neg81.7%
+-commutative81.7%
neg-sub081.7%
associate-+l-81.7%
sub0-neg81.7%
neg-mul-181.7%
sub-neg81.7%
+-commutative81.7%
neg-sub081.7%
associate-+l-81.7%
sub0-neg81.7%
neg-mul-181.7%
times-frac81.7%
metadata-eval81.7%
*-lft-identity81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in y around inf 60.3%
*-commutative60.3%
associate-*r/65.2%
*-commutative65.2%
Simplified65.2%
clear-num65.1%
*-commutative65.1%
div-inv65.2%
Applied egg-rr65.2%
Taylor expanded in z around 0 75.7%
mul-1-neg75.7%
unsub-neg75.7%
Simplified75.7%
Final simplification73.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.4e+89)
(/ y a)
(if (<= z -9e-9)
(* y (/ (- z) t))
(if (<= z -9e-44) (/ y a) (if (<= z 2.4e+41) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+89) {
tmp = y / a;
} else if (z <= -9e-9) {
tmp = y * (-z / t);
} else if (z <= -9e-44) {
tmp = y / a;
} else if (z <= 2.4e+41) {
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 <= (-2.4d+89)) then
tmp = y / a
else if (z <= (-9d-9)) then
tmp = y * (-z / t)
else if (z <= (-9d-44)) then
tmp = y / a
else if (z <= 2.4d+41) 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 <= -2.4e+89) {
tmp = y / a;
} else if (z <= -9e-9) {
tmp = y * (-z / t);
} else if (z <= -9e-44) {
tmp = y / a;
} else if (z <= 2.4e+41) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e+89: tmp = y / a elif z <= -9e-9: tmp = y * (-z / t) elif z <= -9e-44: tmp = y / a elif z <= 2.4e+41: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e+89) tmp = Float64(y / a); elseif (z <= -9e-9) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= -9e-44) tmp = Float64(y / a); elseif (z <= 2.4e+41) 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 <= -2.4e+89) tmp = y / a; elseif (z <= -9e-9) tmp = y * (-z / t); elseif (z <= -9e-44) tmp = y / a; elseif (z <= 2.4e+41) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+89], N[(y / a), $MachinePrecision], If[LessEqual[z, -9e-9], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-44], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.4e+41], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+89}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-9}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-44}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.40000000000000004e89 or -8.99999999999999953e-9 < z < -8.9999999999999997e-44 or 2.4000000000000002e41 < z Initial program 64.6%
sub-neg64.6%
+-commutative64.6%
neg-sub064.6%
associate-+l-64.6%
sub0-neg64.6%
neg-mul-164.6%
sub-neg64.6%
+-commutative64.6%
neg-sub064.6%
associate-+l-64.6%
sub0-neg64.6%
neg-mul-164.6%
times-frac64.6%
metadata-eval64.6%
*-lft-identity64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in z around inf 59.6%
if -2.40000000000000004e89 < z < -8.99999999999999953e-9Initial program 93.4%
sub-neg93.4%
+-commutative93.4%
neg-sub093.4%
associate-+l-93.4%
sub0-neg93.4%
neg-mul-193.4%
sub-neg93.4%
+-commutative93.4%
neg-sub093.4%
associate-+l-93.4%
sub0-neg93.4%
neg-mul-193.4%
times-frac93.4%
metadata-eval93.4%
*-lft-identity93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in y around inf 44.5%
*-commutative44.5%
associate-*r/50.4%
*-commutative50.4%
Simplified50.4%
Taylor expanded in z around 0 46.0%
associate-*r/46.0%
neg-mul-146.0%
Simplified46.0%
if -8.9999999999999997e-44 < z < 2.4000000000000002e41Initial 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 z around 0 59.0%
Final simplification58.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e+97)
(/ y a)
(if (<= z -1.7e-8)
(* z (/ (- y) t))
(if (<= z -1e-43) (/ y a) (if (<= z 3.35e+44) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+97) {
tmp = y / a;
} else if (z <= -1.7e-8) {
tmp = z * (-y / t);
} else if (z <= -1e-43) {
tmp = y / a;
} else if (z <= 3.35e+44) {
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 <= (-3.7d+97)) then
tmp = y / a
else if (z <= (-1.7d-8)) then
tmp = z * (-y / t)
else if (z <= (-1d-43)) then
tmp = y / a
else if (z <= 3.35d+44) 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 <= -3.7e+97) {
tmp = y / a;
} else if (z <= -1.7e-8) {
tmp = z * (-y / t);
} else if (z <= -1e-43) {
tmp = y / a;
} else if (z <= 3.35e+44) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.7e+97: tmp = y / a elif z <= -1.7e-8: tmp = z * (-y / t) elif z <= -1e-43: tmp = y / a elif z <= 3.35e+44: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+97) tmp = Float64(y / a); elseif (z <= -1.7e-8) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= -1e-43) tmp = Float64(y / a); elseif (z <= 3.35e+44) 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 <= -3.7e+97) tmp = y / a; elseif (z <= -1.7e-8) tmp = z * (-y / t); elseif (z <= -1e-43) tmp = y / a; elseif (z <= 3.35e+44) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+97], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.7e-8], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-43], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.35e+44], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+97}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-8}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-43}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.35 \cdot 10^{+44}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.70000000000000001e97 or -1.7e-8 < z < -1.00000000000000008e-43 or 3.35000000000000018e44 < z Initial program 63.6%
sub-neg63.6%
+-commutative63.6%
neg-sub063.6%
associate-+l-63.6%
sub0-neg63.6%
neg-mul-163.6%
sub-neg63.6%
+-commutative63.6%
neg-sub063.6%
associate-+l-63.6%
sub0-neg63.6%
neg-mul-163.6%
times-frac63.6%
metadata-eval63.6%
*-lft-identity63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in z around inf 60.3%
if -3.70000000000000001e97 < z < -1.7e-8Initial program 94.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
neg-mul-194.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
neg-mul-194.5%
times-frac94.5%
metadata-eval94.5%
*-lft-identity94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in y around inf 48.2%
*-commutative48.2%
associate-*r/53.0%
*-commutative53.0%
Simplified53.0%
clear-num53.1%
*-commutative53.1%
div-inv53.3%
Applied egg-rr53.3%
Taylor expanded in z around 0 44.5%
associate-*r/44.5%
neg-mul-144.5%
Simplified44.5%
Taylor expanded in y around 0 39.3%
associate-*l/49.1%
associate-*r*49.1%
associate-*r/49.1%
neg-mul-149.1%
Simplified49.1%
if -1.00000000000000008e-43 < z < 3.35000000000000018e44Initial 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 z around 0 59.0%
Final simplification58.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e-64) (not (<= z 2.45e-82))) (/ y (- a (/ t z))) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e-64) || !(z <= 2.45e-82)) {
tmp = y / (a - (t / z));
} else {
tmp = x / 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 <= (-8.5d-64)) .or. (.not. (z <= 2.45d-82))) then
tmp = y / (a - (t / z))
else
tmp = x / 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 <= -8.5e-64) || !(z <= 2.45e-82)) {
tmp = y / (a - (t / z));
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e-64) or not (z <= 2.45e-82): tmp = y / (a - (t / z)) else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e-64) || !(z <= 2.45e-82)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.5e-64) || ~((z <= 2.45e-82))) tmp = y / (a - (t / z)); else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e-64], N[Not[LessEqual[z, 2.45e-82]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-64} \lor \neg \left(z \leq 2.45 \cdot 10^{-82}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -8.49999999999999996e-64 or 2.4500000000000001e-82 < z Initial program 74.5%
sub-neg74.5%
+-commutative74.5%
neg-sub074.5%
associate-+l-74.5%
sub0-neg74.5%
neg-mul-174.5%
sub-neg74.5%
+-commutative74.5%
neg-sub074.5%
associate-+l-74.5%
sub0-neg74.5%
neg-mul-174.5%
times-frac74.5%
metadata-eval74.5%
*-lft-identity74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in y around inf 44.5%
*-commutative44.5%
associate-*r/54.1%
*-commutative54.1%
Simplified54.1%
clear-num54.1%
*-commutative54.1%
div-inv54.2%
Applied egg-rr54.2%
Taylor expanded in z around 0 66.1%
mul-1-neg66.1%
unsub-neg66.1%
Simplified66.1%
if -8.49999999999999996e-64 < z < 2.4500000000000001e-82Initial 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.2%
Final simplification66.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.6e-44) (not (<= z 2.1e+44))) (/ y (- a (/ t z))) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e-44) || !(z <= 2.1e+44)) {
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 <= (-7.6d-44)) .or. (.not. (z <= 2.1d+44))) 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 <= -7.6e-44) || !(z <= 2.1e+44)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e-44) or not (z <= 2.1e+44): 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 <= -7.6e-44) || !(z <= 2.1e+44)) 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 <= -7.6e-44) || ~((z <= 2.1e+44))) 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, -7.6e-44], N[Not[LessEqual[z, 2.1e+44]], $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 -7.6 \cdot 10^{-44} \lor \neg \left(z \leq 2.1 \cdot 10^{+44}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -7.6000000000000002e-44 or 2.09999999999999987e44 < z Initial program 68.1%
sub-neg68.1%
+-commutative68.1%
neg-sub068.1%
associate-+l-68.1%
sub0-neg68.1%
neg-mul-168.1%
sub-neg68.1%
+-commutative68.1%
neg-sub068.1%
associate-+l-68.1%
sub0-neg68.1%
neg-mul-168.1%
times-frac68.1%
metadata-eval68.1%
*-lft-identity68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in y around inf 42.4%
*-commutative42.4%
associate-*r/54.5%
*-commutative54.5%
Simplified54.5%
clear-num54.6%
*-commutative54.6%
div-inv54.7%
Applied egg-rr54.7%
Taylor expanded in z around 0 69.6%
mul-1-neg69.6%
unsub-neg69.6%
Simplified69.6%
if -7.6000000000000002e-44 < z < 2.09999999999999987e44Initial 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 a around 0 78.7%
associate-*r/78.7%
neg-mul-178.7%
neg-sub078.7%
sub-neg78.7%
+-commutative78.7%
associate--r+78.7%
neg-sub078.7%
remove-double-neg78.7%
*-commutative78.7%
Simplified78.7%
Final simplification74.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.25e-58) (not (<= a 3.9e-39))) (/ (- y (/ x z)) a) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.25e-58) || !(a <= 3.9e-39)) {
tmp = (y - (x / z)) / a;
} 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 ((a <= (-1.25d-58)) .or. (.not. (a <= 3.9d-39))) then
tmp = (y - (x / z)) / a
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 ((a <= -1.25e-58) || !(a <= 3.9e-39)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.25e-58) or not (a <= 3.9e-39): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.25e-58) || !(a <= 3.9e-39)) tmp = Float64(Float64(y - Float64(x / z)) / a); 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 ((a <= -1.25e-58) || ~((a <= 3.9e-39))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.25e-58], N[Not[LessEqual[a, 3.9e-39]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{-58} \lor \neg \left(a \leq 3.9 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if a < -1.24999999999999994e-58 or 3.9000000000000003e-39 < a Initial program 73.8%
sub-neg73.8%
+-commutative73.8%
neg-sub073.8%
associate-+l-73.8%
sub0-neg73.8%
neg-mul-173.8%
sub-neg73.8%
+-commutative73.8%
neg-sub073.8%
associate-+l-73.8%
sub0-neg73.8%
neg-mul-173.8%
times-frac73.8%
metadata-eval73.8%
*-lft-identity73.8%
*-commutative73.8%
Simplified73.8%
div-sub73.8%
associate-/l*75.9%
Applied egg-rr75.9%
Taylor expanded in a around inf 72.4%
if -1.24999999999999994e-58 < a < 3.9000000000000003e-39Initial program 92.3%
sub-neg92.3%
+-commutative92.3%
neg-sub092.3%
associate-+l-92.3%
sub0-neg92.3%
neg-mul-192.3%
sub-neg92.3%
+-commutative92.3%
neg-sub092.3%
associate-+l-92.3%
sub0-neg92.3%
neg-mul-192.3%
times-frac92.3%
metadata-eval92.3%
*-lft-identity92.3%
*-commutative92.3%
Simplified92.3%
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 simplification73.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.5e-45) (/ y a) (if (<= z 2.1e+41) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-45) {
tmp = y / a;
} else if (z <= 2.1e+41) {
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 <= (-9.5d-45)) then
tmp = y / a
else if (z <= 2.1d+41) 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 <= -9.5e-45) {
tmp = y / a;
} else if (z <= 2.1e+41) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.5e-45: tmp = y / a elif z <= 2.1e+41: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-45) tmp = Float64(y / a); elseif (z <= 2.1e+41) 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 <= -9.5e-45) tmp = y / a; elseif (z <= 2.1e+41) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-45], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.1e+41], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-45}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -9.5000000000000002e-45 or 2.1e41 < z Initial program 68.1%
sub-neg68.1%
+-commutative68.1%
neg-sub068.1%
associate-+l-68.1%
sub0-neg68.1%
neg-mul-168.1%
sub-neg68.1%
+-commutative68.1%
neg-sub068.1%
associate-+l-68.1%
sub0-neg68.1%
neg-mul-168.1%
times-frac68.1%
metadata-eval68.1%
*-lft-identity68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in z around inf 54.2%
if -9.5000000000000002e-45 < z < 2.1e41Initial 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 z around 0 59.0%
Final simplification56.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 83.4%
sub-neg83.4%
+-commutative83.4%
neg-sub083.4%
associate-+l-83.4%
sub0-neg83.4%
neg-mul-183.4%
sub-neg83.4%
+-commutative83.4%
neg-sub083.4%
associate-+l-83.4%
sub0-neg83.4%
neg-mul-183.4%
times-frac83.4%
metadata-eval83.4%
*-lft-identity83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in z around 0 35.4%
Final simplification35.4%
(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 2023230
(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))))