
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - 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 + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - 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 + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t 4.2e+142) (fma (- z t) (/ y (- t a)) (+ y x)) (+ x (- (* y (/ z t)) (* a (/ y t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.2e+142) {
tmp = fma((z - t), (y / (t - a)), (y + x));
} else {
tmp = x + ((y * (z / t)) - (a * (y / t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.2e+142) tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(y + x)); else tmp = Float64(x + Float64(Float64(y * Float64(z / t)) - Float64(a * Float64(y / t)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.2e+142], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.2 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \frac{z}{t} - a \cdot \frac{y}{t}\right)\\
\end{array}
\end{array}
if t < 4.2e142Initial program 84.5%
sub-neg84.5%
+-commutative84.5%
distribute-frac-neg84.5%
distribute-rgt-neg-out84.5%
associate-/l*91.2%
fma-define91.3%
distribute-frac-neg91.3%
distribute-neg-frac291.3%
sub-neg91.3%
distribute-neg-in91.3%
remove-double-neg91.3%
+-commutative91.3%
sub-neg91.3%
Simplified91.3%
if 4.2e142 < t Initial program 47.1%
sub-neg47.1%
+-commutative47.1%
distribute-frac-neg47.1%
distribute-rgt-neg-out47.1%
associate-/l*57.1%
fma-define57.0%
distribute-frac-neg57.0%
distribute-neg-frac257.0%
sub-neg57.0%
distribute-neg-in57.0%
remove-double-neg57.0%
+-commutative57.0%
sub-neg57.0%
Simplified57.0%
Taylor expanded in t around inf 59.3%
associate--l+59.3%
associate-+r+59.3%
distribute-rgt1-in59.3%
metadata-eval59.3%
mul0-lft59.3%
associate-/l*71.0%
associate-/l*92.1%
Simplified92.1%
Final simplification91.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ y x) (/ (* (- z t) y) (- t a)))))
(if (or (<= t_1 -4e-250) (not (<= t_1 2e-233)))
(+ (+ y x) (* (- z t) (/ y (- t a))))
(+ x (/ (* y (- z a)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) + (((z - t) * y) / (t - a));
double tmp;
if ((t_1 <= -4e-250) || !(t_1 <= 2e-233)) {
tmp = (y + x) + ((z - t) * (y / (t - a)));
} else {
tmp = x + ((y * (z - a)) / 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) :: t_1
real(8) :: tmp
t_1 = (y + x) + (((z - t) * y) / (t - a))
if ((t_1 <= (-4d-250)) .or. (.not. (t_1 <= 2d-233))) then
tmp = (y + x) + ((z - t) * (y / (t - a)))
else
tmp = x + ((y * (z - a)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) + (((z - t) * y) / (t - a));
double tmp;
if ((t_1 <= -4e-250) || !(t_1 <= 2e-233)) {
tmp = (y + x) + ((z - t) * (y / (t - a)));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) + (((z - t) * y) / (t - a)) tmp = 0 if (t_1 <= -4e-250) or not (t_1 <= 2e-233): tmp = (y + x) + ((z - t) * (y / (t - a))) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) + Float64(Float64(Float64(z - t) * y) / Float64(t - a))) tmp = 0.0 if ((t_1 <= -4e-250) || !(t_1 <= 2e-233)) tmp = Float64(Float64(y + x) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) + (((z - t) * y) / (t - a)); tmp = 0.0; if ((t_1 <= -4e-250) || ~((t_1 <= 2e-233))) tmp = (y + x) + ((z - t) * (y / (t - a))); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e-250], N[Not[LessEqual[t$95$1, 2e-233]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + \frac{\left(z - t\right) \cdot y}{t - a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-250} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-233}\right):\\
\;\;\;\;\left(y + x\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.0000000000000002e-250 or 1.99999999999999992e-233 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.0%
associate-/l*90.9%
*-commutative90.9%
Applied egg-rr90.9%
if -4.0000000000000002e-250 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.99999999999999992e-233Initial program 16.4%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
distribute-lft-out--99.8%
div-sub99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
distribute-lft-out--99.6%
Simplified99.6%
Final simplification91.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- t a)))))
(if (<= a -3.8e+35)
(+ y x)
(if (<= a -2.4e-40)
t_1
(if (<= a -9e-98)
x
(if (<= a -9e-127)
t_1
(if (<= a -7.2e-218)
(- x (* y (/ a t)))
(if (<= a 3.4e-141) (* z (/ y (- t a))) (+ y x)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (t - a));
double tmp;
if (a <= -3.8e+35) {
tmp = y + x;
} else if (a <= -2.4e-40) {
tmp = t_1;
} else if (a <= -9e-98) {
tmp = x;
} else if (a <= -9e-127) {
tmp = t_1;
} else if (a <= -7.2e-218) {
tmp = x - (y * (a / t));
} else if (a <= 3.4e-141) {
tmp = z * (y / (t - a));
} else {
tmp = y + x;
}
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 * (z / (t - a))
if (a <= (-3.8d+35)) then
tmp = y + x
else if (a <= (-2.4d-40)) then
tmp = t_1
else if (a <= (-9d-98)) then
tmp = x
else if (a <= (-9d-127)) then
tmp = t_1
else if (a <= (-7.2d-218)) then
tmp = x - (y * (a / t))
else if (a <= 3.4d-141) then
tmp = z * (y / (t - a))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (t - a));
double tmp;
if (a <= -3.8e+35) {
tmp = y + x;
} else if (a <= -2.4e-40) {
tmp = t_1;
} else if (a <= -9e-98) {
tmp = x;
} else if (a <= -9e-127) {
tmp = t_1;
} else if (a <= -7.2e-218) {
tmp = x - (y * (a / t));
} else if (a <= 3.4e-141) {
tmp = z * (y / (t - a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / (t - a)) tmp = 0 if a <= -3.8e+35: tmp = y + x elif a <= -2.4e-40: tmp = t_1 elif a <= -9e-98: tmp = x elif a <= -9e-127: tmp = t_1 elif a <= -7.2e-218: tmp = x - (y * (a / t)) elif a <= 3.4e-141: tmp = z * (y / (t - a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(t - a))) tmp = 0.0 if (a <= -3.8e+35) tmp = Float64(y + x); elseif (a <= -2.4e-40) tmp = t_1; elseif (a <= -9e-98) tmp = x; elseif (a <= -9e-127) tmp = t_1; elseif (a <= -7.2e-218) tmp = Float64(x - Float64(y * Float64(a / t))); elseif (a <= 3.4e-141) tmp = Float64(z * Float64(y / Float64(t - a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / (t - a)); tmp = 0.0; if (a <= -3.8e+35) tmp = y + x; elseif (a <= -2.4e-40) tmp = t_1; elseif (a <= -9e-98) tmp = x; elseif (a <= -9e-127) tmp = t_1; elseif (a <= -7.2e-218) tmp = x - (y * (a / t)); elseif (a <= 3.4e-141) tmp = z * (y / (t - a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e+35], N[(y + x), $MachinePrecision], If[LessEqual[a, -2.4e-40], t$95$1, If[LessEqual[a, -9e-98], x, If[LessEqual[a, -9e-127], t$95$1, If[LessEqual[a, -7.2e-218], N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.4e-141], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t - a}\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+35}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -9 \cdot 10^{-98}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -9 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-218}:\\
\;\;\;\;x - y \cdot \frac{a}{t}\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-141}:\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.8e35 or 3.3999999999999998e-141 < a Initial program 81.4%
sub-neg81.4%
+-commutative81.4%
distribute-frac-neg81.4%
distribute-rgt-neg-out81.4%
associate-/l*90.9%
fma-define90.9%
distribute-frac-neg90.9%
distribute-neg-frac290.9%
sub-neg90.9%
distribute-neg-in90.9%
remove-double-neg90.9%
+-commutative90.9%
sub-neg90.9%
Simplified90.9%
Taylor expanded in a around inf 79.7%
+-commutative79.7%
Simplified79.7%
if -3.8e35 < a < -2.39999999999999991e-40 or -8.99999999999999994e-98 < a < -8.9999999999999998e-127Initial program 80.4%
sub-neg80.4%
+-commutative80.4%
distribute-frac-neg80.4%
distribute-rgt-neg-out80.4%
associate-/l*88.1%
fma-define88.2%
distribute-frac-neg88.2%
distribute-neg-frac288.2%
sub-neg88.2%
distribute-neg-in88.2%
remove-double-neg88.2%
+-commutative88.2%
sub-neg88.2%
Simplified88.2%
Taylor expanded in z around inf 62.3%
associate-/l*70.6%
Simplified70.6%
if -2.39999999999999991e-40 < a < -8.99999999999999994e-98Initial program 80.5%
sub-neg80.5%
+-commutative80.5%
distribute-frac-neg80.5%
distribute-rgt-neg-out80.5%
associate-/l*80.7%
fma-define80.8%
distribute-frac-neg80.8%
distribute-neg-frac280.8%
sub-neg80.8%
distribute-neg-in80.8%
remove-double-neg80.8%
+-commutative80.8%
sub-neg80.8%
Simplified80.8%
Taylor expanded in y around 0 67.8%
if -8.9999999999999998e-127 < a < -7.20000000000000023e-218Initial program 75.9%
Taylor expanded in t around -inf 100.0%
Taylor expanded in a around inf 92.2%
mul-1-neg92.2%
*-commutative92.2%
associate-/l*92.2%
distribute-rgt-neg-in92.2%
Simplified92.2%
if -7.20000000000000023e-218 < a < 3.3999999999999998e-141Initial program 74.0%
sub-neg74.0%
+-commutative74.0%
distribute-frac-neg74.0%
distribute-rgt-neg-out74.0%
associate-/l*76.6%
fma-define76.6%
distribute-frac-neg76.6%
distribute-neg-frac276.6%
sub-neg76.6%
distribute-neg-in76.6%
remove-double-neg76.6%
+-commutative76.6%
sub-neg76.6%
Simplified76.6%
Taylor expanded in z around inf 55.9%
associate-/l*54.0%
Simplified54.0%
clear-num53.9%
un-div-inv56.4%
Applied egg-rr56.4%
associate-/r/59.9%
Simplified59.9%
Final simplification75.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.4e+42)
(+ y x)
(if (<= a -1.12e-217)
x
(if (<= a 2e-281)
(/ (* z y) t)
(if (<= a 6.8e-172) x (if (<= a 1.75e-144) (* z (/ y t)) (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.4e+42) {
tmp = y + x;
} else if (a <= -1.12e-217) {
tmp = x;
} else if (a <= 2e-281) {
tmp = (z * y) / t;
} else if (a <= 6.8e-172) {
tmp = x;
} else if (a <= 1.75e-144) {
tmp = z * (y / t);
} else {
tmp = y + x;
}
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 <= (-5.4d+42)) then
tmp = y + x
else if (a <= (-1.12d-217)) then
tmp = x
else if (a <= 2d-281) then
tmp = (z * y) / t
else if (a <= 6.8d-172) then
tmp = x
else if (a <= 1.75d-144) then
tmp = z * (y / t)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.4e+42) {
tmp = y + x;
} else if (a <= -1.12e-217) {
tmp = x;
} else if (a <= 2e-281) {
tmp = (z * y) / t;
} else if (a <= 6.8e-172) {
tmp = x;
} else if (a <= 1.75e-144) {
tmp = z * (y / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.4e+42: tmp = y + x elif a <= -1.12e-217: tmp = x elif a <= 2e-281: tmp = (z * y) / t elif a <= 6.8e-172: tmp = x elif a <= 1.75e-144: tmp = z * (y / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.4e+42) tmp = Float64(y + x); elseif (a <= -1.12e-217) tmp = x; elseif (a <= 2e-281) tmp = Float64(Float64(z * y) / t); elseif (a <= 6.8e-172) tmp = x; elseif (a <= 1.75e-144) tmp = Float64(z * Float64(y / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.4e+42) tmp = y + x; elseif (a <= -1.12e-217) tmp = x; elseif (a <= 2e-281) tmp = (z * y) / t; elseif (a <= 6.8e-172) tmp = x; elseif (a <= 1.75e-144) tmp = z * (y / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.4e+42], N[(y + x), $MachinePrecision], If[LessEqual[a, -1.12e-217], x, If[LessEqual[a, 2e-281], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 6.8e-172], x, If[LessEqual[a, 1.75e-144], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -1.12 \cdot 10^{-217}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-281}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{-172}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-144}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -5.4000000000000001e42 or 1.7499999999999999e-144 < a Initial program 81.1%
sub-neg81.1%
+-commutative81.1%
distribute-frac-neg81.1%
distribute-rgt-neg-out81.1%
associate-/l*90.8%
fma-define90.8%
distribute-frac-neg90.8%
distribute-neg-frac290.8%
sub-neg90.8%
distribute-neg-in90.8%
remove-double-neg90.8%
+-commutative90.8%
sub-neg90.8%
Simplified90.8%
Taylor expanded in a around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -5.4000000000000001e42 < a < -1.12000000000000004e-217 or 2e-281 < a < 6.7999999999999997e-172Initial program 82.6%
sub-neg82.6%
+-commutative82.6%
distribute-frac-neg82.6%
distribute-rgt-neg-out82.6%
associate-/l*85.1%
fma-define85.2%
distribute-frac-neg85.2%
distribute-neg-frac285.2%
sub-neg85.2%
distribute-neg-in85.2%
remove-double-neg85.2%
+-commutative85.2%
sub-neg85.2%
Simplified85.2%
Taylor expanded in y around 0 57.4%
if -1.12000000000000004e-217 < a < 2e-281Initial program 66.3%
sub-neg66.3%
+-commutative66.3%
distribute-frac-neg66.3%
distribute-rgt-neg-out66.3%
associate-/l*68.0%
fma-define68.0%
distribute-frac-neg68.0%
distribute-neg-frac268.0%
sub-neg68.0%
distribute-neg-in68.0%
remove-double-neg68.0%
+-commutative68.0%
sub-neg68.0%
Simplified68.0%
Taylor expanded in z around inf 68.1%
associate-/l*58.8%
Simplified58.8%
Taylor expanded in t around inf 68.1%
if 6.7999999999999997e-172 < a < 1.7499999999999999e-144Initial program 52.3%
sub-neg52.3%
+-commutative52.3%
distribute-frac-neg52.3%
distribute-rgt-neg-out52.3%
associate-/l*67.9%
fma-define67.2%
distribute-frac-neg67.2%
distribute-neg-frac267.2%
sub-neg67.2%
distribute-neg-in67.2%
remove-double-neg67.2%
+-commutative67.2%
sub-neg67.2%
Simplified67.2%
Taylor expanded in z around inf 68.0%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in t around inf 68.0%
*-commutative68.0%
associate-/l*83.8%
Applied egg-rr83.8%
Final simplification72.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y t))))
(if (<= a -1.3e+42)
(+ y x)
(if (<= a -2.95e-217)
x
(if (<= a 1.65e-281)
t_1
(if (<= a 6.8e-172) x (if (<= a 1.25e-143) t_1 (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / t);
double tmp;
if (a <= -1.3e+42) {
tmp = y + x;
} else if (a <= -2.95e-217) {
tmp = x;
} else if (a <= 1.65e-281) {
tmp = t_1;
} else if (a <= 6.8e-172) {
tmp = x;
} else if (a <= 1.25e-143) {
tmp = t_1;
} else {
tmp = y + x;
}
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 = z * (y / t)
if (a <= (-1.3d+42)) then
tmp = y + x
else if (a <= (-2.95d-217)) then
tmp = x
else if (a <= 1.65d-281) then
tmp = t_1
else if (a <= 6.8d-172) then
tmp = x
else if (a <= 1.25d-143) then
tmp = t_1
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / t);
double tmp;
if (a <= -1.3e+42) {
tmp = y + x;
} else if (a <= -2.95e-217) {
tmp = x;
} else if (a <= 1.65e-281) {
tmp = t_1;
} else if (a <= 6.8e-172) {
tmp = x;
} else if (a <= 1.25e-143) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / t) tmp = 0 if a <= -1.3e+42: tmp = y + x elif a <= -2.95e-217: tmp = x elif a <= 1.65e-281: tmp = t_1 elif a <= 6.8e-172: tmp = x elif a <= 1.25e-143: tmp = t_1 else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / t)) tmp = 0.0 if (a <= -1.3e+42) tmp = Float64(y + x); elseif (a <= -2.95e-217) tmp = x; elseif (a <= 1.65e-281) tmp = t_1; elseif (a <= 6.8e-172) tmp = x; elseif (a <= 1.25e-143) tmp = t_1; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / t); tmp = 0.0; if (a <= -1.3e+42) tmp = y + x; elseif (a <= -2.95e-217) tmp = x; elseif (a <= 1.65e-281) tmp = t_1; elseif (a <= 6.8e-172) tmp = x; elseif (a <= 1.25e-143) tmp = t_1; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.3e+42], N[(y + x), $MachinePrecision], If[LessEqual[a, -2.95e-217], x, If[LessEqual[a, 1.65e-281], t$95$1, If[LessEqual[a, 6.8e-172], x, If[LessEqual[a, 1.25e-143], t$95$1, N[(y + x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+42}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -2.95 \cdot 10^{-217}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-281}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{-172}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.29999999999999995e42 or 1.2500000000000001e-143 < a Initial program 81.1%
sub-neg81.1%
+-commutative81.1%
distribute-frac-neg81.1%
distribute-rgt-neg-out81.1%
associate-/l*90.8%
fma-define90.8%
distribute-frac-neg90.8%
distribute-neg-frac290.8%
sub-neg90.8%
distribute-neg-in90.8%
remove-double-neg90.8%
+-commutative90.8%
sub-neg90.8%
Simplified90.8%
Taylor expanded in a around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -1.29999999999999995e42 < a < -2.9499999999999999e-217 or 1.65e-281 < a < 6.7999999999999997e-172Initial program 82.6%
sub-neg82.6%
+-commutative82.6%
distribute-frac-neg82.6%
distribute-rgt-neg-out82.6%
associate-/l*85.1%
fma-define85.2%
distribute-frac-neg85.2%
distribute-neg-frac285.2%
sub-neg85.2%
distribute-neg-in85.2%
remove-double-neg85.2%
+-commutative85.2%
sub-neg85.2%
Simplified85.2%
Taylor expanded in y around 0 57.4%
if -2.9499999999999999e-217 < a < 1.65e-281 or 6.7999999999999997e-172 < a < 1.2500000000000001e-143Initial program 63.2%
sub-neg63.2%
+-commutative63.2%
distribute-frac-neg63.2%
distribute-rgt-neg-out63.2%
associate-/l*67.9%
fma-define67.8%
distribute-frac-neg67.8%
distribute-neg-frac267.8%
sub-neg67.8%
distribute-neg-in67.8%
remove-double-neg67.8%
+-commutative67.8%
sub-neg67.8%
Simplified67.8%
Taylor expanded in z around inf 68.1%
associate-/l*64.3%
Simplified64.3%
Taylor expanded in t around inf 68.1%
*-commutative68.1%
associate-/l*71.1%
Applied egg-rr71.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e-83) (not (<= a 2.7e-70))) (- (+ y x) (* y (/ z a))) (+ x (/ (- (* z y) (* y a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e-83) || !(a <= 2.7e-70)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + (((z * y) - (y * a)) / 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 <= (-2d-83)) .or. (.not. (a <= 2.7d-70))) then
tmp = (y + x) - (y * (z / a))
else
tmp = x + (((z * y) - (y * a)) / 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 <= -2e-83) || !(a <= 2.7e-70)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + (((z * y) - (y * a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e-83) or not (a <= 2.7e-70): tmp = (y + x) - (y * (z / a)) else: tmp = x + (((z * y) - (y * a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e-83) || !(a <= 2.7e-70)) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(Float64(z * y) - Float64(y * a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2e-83) || ~((a <= 2.7e-70))) tmp = (y + x) - (y * (z / a)); else tmp = x + (((z * y) - (y * a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e-83], N[Not[LessEqual[a, 2.7e-70]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(z * y), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-83} \lor \neg \left(a \leq 2.7 \cdot 10^{-70}\right):\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y - y \cdot a}{t}\\
\end{array}
\end{array}
if a < -2.0000000000000001e-83 or 2.7000000000000001e-70 < a Initial program 81.4%
sub-neg81.4%
+-commutative81.4%
distribute-frac-neg81.4%
distribute-rgt-neg-out81.4%
associate-/l*91.2%
fma-define91.2%
distribute-frac-neg91.2%
distribute-neg-frac291.2%
sub-neg91.2%
distribute-neg-in91.2%
remove-double-neg91.2%
+-commutative91.2%
sub-neg91.2%
Simplified91.2%
Taylor expanded in t around 0 82.1%
associate-+r+82.1%
mul-1-neg82.1%
sub-neg82.1%
+-commutative82.1%
associate-/l*86.7%
Simplified86.7%
if -2.0000000000000001e-83 < a < 2.7000000000000001e-70Initial program 76.0%
Taylor expanded in t around -inf 85.8%
Final simplification86.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.15e-81) (not (<= a 7.8e-70))) (- (+ y x) (* y (/ z a))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.15e-81) || !(a <= 7.8e-70)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + ((y * (z - a)) / 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 <= (-3.15d-81)) .or. (.not. (a <= 7.8d-70))) then
tmp = (y + x) - (y * (z / a))
else
tmp = x + ((y * (z - a)) / 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 <= -3.15e-81) || !(a <= 7.8e-70)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.15e-81) or not (a <= 7.8e-70): tmp = (y + x) - (y * (z / a)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.15e-81) || !(a <= 7.8e-70)) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.15e-81) || ~((a <= 7.8e-70))) tmp = (y + x) - (y * (z / a)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.15e-81], N[Not[LessEqual[a, 7.8e-70]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.15 \cdot 10^{-81} \lor \neg \left(a \leq 7.8 \cdot 10^{-70}\right):\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -3.15000000000000011e-81 or 7.80000000000000038e-70 < a Initial program 81.4%
sub-neg81.4%
+-commutative81.4%
distribute-frac-neg81.4%
distribute-rgt-neg-out81.4%
associate-/l*91.2%
fma-define91.2%
distribute-frac-neg91.2%
distribute-neg-frac291.2%
sub-neg91.2%
distribute-neg-in91.2%
remove-double-neg91.2%
+-commutative91.2%
sub-neg91.2%
Simplified91.2%
Taylor expanded in t around 0 82.1%
associate-+r+82.1%
mul-1-neg82.1%
sub-neg82.1%
+-commutative82.1%
associate-/l*86.7%
Simplified86.7%
if -3.15000000000000011e-81 < a < 7.80000000000000038e-70Initial program 76.0%
Taylor expanded in t around inf 85.8%
associate--l+85.8%
distribute-lft-out--85.8%
div-sub85.8%
mul-1-neg85.8%
unsub-neg85.8%
*-commutative85.8%
distribute-lft-out--85.8%
Simplified85.8%
Final simplification86.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.6e+25) (not (<= a 1e-13))) (+ y x) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.6e+25) || !(a <= 1e-13)) {
tmp = y + x;
} else {
tmp = x + ((y * (z - a)) / 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 <= (-3.6d+25)) .or. (.not. (a <= 1d-13))) then
tmp = y + x
else
tmp = x + ((y * (z - a)) / 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 <= -3.6e+25) || !(a <= 1e-13)) {
tmp = y + x;
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.6e+25) or not (a <= 1e-13): tmp = y + x else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.6e+25) || !(a <= 1e-13)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.6e+25) || ~((a <= 1e-13))) tmp = y + x; else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.6e+25], N[Not[LessEqual[a, 1e-13]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{+25} \lor \neg \left(a \leq 10^{-13}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -3.60000000000000015e25 or 1e-13 < a Initial program 80.9%
sub-neg80.9%
+-commutative80.9%
distribute-frac-neg80.9%
distribute-rgt-neg-out80.9%
associate-/l*91.7%
fma-define91.8%
distribute-frac-neg91.8%
distribute-neg-frac291.8%
sub-neg91.8%
distribute-neg-in91.8%
remove-double-neg91.8%
+-commutative91.8%
sub-neg91.8%
Simplified91.8%
Taylor expanded in a around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -3.60000000000000015e25 < a < 1e-13Initial program 78.1%
Taylor expanded in t around inf 78.9%
associate--l+78.9%
distribute-lft-out--78.9%
div-sub79.7%
mul-1-neg79.7%
unsub-neg79.7%
*-commutative79.7%
distribute-lft-out--79.7%
Simplified79.7%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -7.8e-175) (+ y x) (if (<= x 220000.0) (* y (- 1.0 (/ z (- a t)))) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7.8e-175) {
tmp = y + x;
} else if (x <= 220000.0) {
tmp = y * (1.0 - (z / (a - t)));
} else {
tmp = x;
}
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 <= (-7.8d-175)) then
tmp = y + x
else if (x <= 220000.0d0) then
tmp = y * (1.0d0 - (z / (a - t)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7.8e-175) {
tmp = y + x;
} else if (x <= 220000.0) {
tmp = y * (1.0 - (z / (a - t)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7.8e-175: tmp = y + x elif x <= 220000.0: tmp = y * (1.0 - (z / (a - t))) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7.8e-175) tmp = Float64(y + x); elseif (x <= 220000.0) tmp = Float64(y * Float64(1.0 - Float64(z / Float64(a - t)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -7.8e-175) tmp = y + x; elseif (x <= 220000.0) tmp = y * (1.0 - (z / (a - t))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7.8e-175], N[(y + x), $MachinePrecision], If[LessEqual[x, 220000.0], N[(y * N[(1.0 - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{-175}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;x \leq 220000:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.79999999999999997e-175Initial program 84.3%
sub-neg84.3%
+-commutative84.3%
distribute-frac-neg84.3%
distribute-rgt-neg-out84.3%
associate-/l*90.7%
fma-define90.8%
distribute-frac-neg90.8%
distribute-neg-frac290.8%
sub-neg90.8%
distribute-neg-in90.8%
remove-double-neg90.8%
+-commutative90.8%
sub-neg90.8%
Simplified90.8%
Taylor expanded in a around inf 74.1%
+-commutative74.1%
Simplified74.1%
if -7.79999999999999997e-175 < x < 2.2e5Initial program 71.8%
associate-/l*79.7%
*-commutative79.7%
Applied egg-rr79.7%
add-cube-cbrt78.9%
pow378.9%
+-commutative78.9%
Applied egg-rr78.9%
Taylor expanded in z around inf 71.2%
associate-*l/77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y around inf 64.5%
if 2.2e5 < x Initial program 83.6%
sub-neg83.6%
+-commutative83.6%
distribute-frac-neg83.6%
distribute-rgt-neg-out83.6%
associate-/l*90.9%
fma-define90.9%
distribute-frac-neg90.9%
distribute-neg-frac290.9%
sub-neg90.9%
distribute-neg-in90.9%
remove-double-neg90.9%
+-commutative90.9%
sub-neg90.9%
Simplified90.9%
Taylor expanded in y around 0 85.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 2e+142) (+ (+ y x) (* (- z t) (/ y (- t a)))) (+ x (- (* y (/ z t)) (* a (/ y t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2e+142) {
tmp = (y + x) + ((z - t) * (y / (t - a)));
} else {
tmp = x + ((y * (z / t)) - (a * (y / 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 (t <= 2d+142) then
tmp = (y + x) + ((z - t) * (y / (t - a)))
else
tmp = x + ((y * (z / t)) - (a * (y / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2e+142) {
tmp = (y + x) + ((z - t) * (y / (t - a)));
} else {
tmp = x + ((y * (z / t)) - (a * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2e+142: tmp = (y + x) + ((z - t) * (y / (t - a))) else: tmp = x + ((y * (z / t)) - (a * (y / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2e+142) tmp = Float64(Float64(y + x) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); else tmp = Float64(x + Float64(Float64(y * Float64(z / t)) - Float64(a * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2e+142) tmp = (y + x) + ((z - t) * (y / (t - a))); else tmp = x + ((y * (z / t)) - (a * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2e+142], N[(N[(y + x), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2 \cdot 10^{+142}:\\
\;\;\;\;\left(y + x\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \frac{z}{t} - a \cdot \frac{y}{t}\right)\\
\end{array}
\end{array}
if t < 2.0000000000000001e142Initial program 84.5%
associate-/l*91.2%
*-commutative91.2%
Applied egg-rr91.2%
if 2.0000000000000001e142 < t Initial program 47.1%
sub-neg47.1%
+-commutative47.1%
distribute-frac-neg47.1%
distribute-rgt-neg-out47.1%
associate-/l*57.1%
fma-define57.0%
distribute-frac-neg57.0%
distribute-neg-frac257.0%
sub-neg57.0%
distribute-neg-in57.0%
remove-double-neg57.0%
+-commutative57.0%
sub-neg57.0%
Simplified57.0%
Taylor expanded in t around inf 59.3%
associate--l+59.3%
associate-+r+59.3%
distribute-rgt1-in59.3%
metadata-eval59.3%
mul0-lft59.3%
associate-/l*71.0%
associate-/l*92.1%
Simplified92.1%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.3e+42) (not (<= a 4.6e+56))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.3e+42) || !(a <= 4.6e+56)) {
tmp = y + x;
} else {
tmp = x;
}
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.3d+42)) .or. (.not. (a <= 4.6d+56))) then
tmp = y + x
else
tmp = x
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.3e+42) || !(a <= 4.6e+56)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.3e+42) or not (a <= 4.6e+56): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.3e+42) || !(a <= 4.6e+56)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.3e+42) || ~((a <= 4.6e+56))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.3e+42], N[Not[LessEqual[a, 4.6e+56]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+42} \lor \neg \left(a \leq 4.6 \cdot 10^{+56}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.29999999999999995e42 or 4.60000000000000029e56 < a Initial program 80.0%
sub-neg80.0%
+-commutative80.0%
distribute-frac-neg80.0%
distribute-rgt-neg-out80.0%
associate-/l*93.1%
fma-define93.2%
distribute-frac-neg93.2%
distribute-neg-frac293.2%
sub-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
+-commutative93.2%
sub-neg93.2%
Simplified93.2%
Taylor expanded in a around inf 85.8%
+-commutative85.8%
Simplified85.8%
if -1.29999999999999995e42 < a < 4.60000000000000029e56Initial program 79.4%
sub-neg79.4%
+-commutative79.4%
distribute-frac-neg79.4%
distribute-rgt-neg-out79.4%
associate-/l*81.8%
fma-define81.8%
distribute-frac-neg81.8%
distribute-neg-frac281.8%
sub-neg81.8%
distribute-neg-in81.8%
remove-double-neg81.8%
+-commutative81.8%
sub-neg81.8%
Simplified81.8%
Taylor expanded in y around 0 52.6%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (if (<= z 4.5e+235) (+ y x) (* y (/ z (- t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.5e+235) {
tmp = y + x;
} else {
tmp = y * (z / (t - 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 <= 4.5d+235) then
tmp = y + x
else
tmp = y * (z / (t - 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 <= 4.5e+235) {
tmp = y + x;
} else {
tmp = y * (z / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 4.5e+235: tmp = y + x else: tmp = y * (z / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 4.5e+235) tmp = Float64(y + x); else tmp = Float64(y * Float64(z / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 4.5e+235) tmp = y + x; else tmp = y * (z / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 4.5e+235], N[(y + x), $MachinePrecision], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.5 \cdot 10^{+235}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < 4.5e235Initial program 79.4%
sub-neg79.4%
+-commutative79.4%
distribute-frac-neg79.4%
distribute-rgt-neg-out79.4%
associate-/l*86.5%
fma-define86.5%
distribute-frac-neg86.5%
distribute-neg-frac286.5%
sub-neg86.5%
distribute-neg-in86.5%
remove-double-neg86.5%
+-commutative86.5%
sub-neg86.5%
Simplified86.5%
Taylor expanded in a around inf 66.9%
+-commutative66.9%
Simplified66.9%
if 4.5e235 < z Initial program 82.1%
sub-neg82.1%
+-commutative82.1%
distribute-frac-neg82.1%
distribute-rgt-neg-out82.1%
associate-/l*90.8%
fma-define90.7%
distribute-frac-neg90.7%
distribute-neg-frac290.7%
sub-neg90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
+-commutative90.7%
sub-neg90.7%
Simplified90.7%
Taylor expanded in z around inf 59.1%
associate-/l*72.1%
Simplified72.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -6.2e+74) y (if (<= y 4.7e+225) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6.2e+74) {
tmp = y;
} else if (y <= 4.7e+225) {
tmp = x;
} else {
tmp = y;
}
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 (y <= (-6.2d+74)) then
tmp = y
else if (y <= 4.7d+225) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6.2e+74) {
tmp = y;
} else if (y <= 4.7e+225) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -6.2e+74: tmp = y elif y <= 4.7e+225: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -6.2e+74) tmp = y; elseif (y <= 4.7e+225) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -6.2e+74) tmp = y; elseif (y <= 4.7e+225) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -6.2e+74], y, If[LessEqual[y, 4.7e+225], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+74}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+225}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -6.20000000000000043e74 or 4.70000000000000004e225 < y Initial program 59.1%
Taylor expanded in x around 0 52.7%
associate-*r/63.8%
Simplified63.8%
Taylor expanded in a around inf 35.4%
if -6.20000000000000043e74 < y < 4.70000000000000004e225Initial program 88.3%
sub-neg88.3%
+-commutative88.3%
distribute-frac-neg88.3%
distribute-rgt-neg-out88.3%
associate-/l*93.2%
fma-define93.2%
distribute-frac-neg93.2%
distribute-neg-frac293.2%
sub-neg93.2%
distribute-neg-in93.2%
remove-double-neg93.2%
+-commutative93.2%
sub-neg93.2%
Simplified93.2%
Taylor expanded in y around 0 63.9%
(FPCore (x y z t a) :precision binary64 (if (<= z 1.45e+237) (+ y x) (* y (/ z t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.45e+237) {
tmp = y + x;
} else {
tmp = 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 <= 1.45d+237) then
tmp = y + x
else
tmp = 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 <= 1.45e+237) {
tmp = y + x;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.45e+237: tmp = y + x else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.45e+237) tmp = Float64(y + x); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.45e+237) tmp = y + x; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.45e+237], N[(y + x), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.45 \cdot 10^{+237}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < 1.45000000000000005e237Initial program 79.4%
sub-neg79.4%
+-commutative79.4%
distribute-frac-neg79.4%
distribute-rgt-neg-out79.4%
associate-/l*86.5%
fma-define86.5%
distribute-frac-neg86.5%
distribute-neg-frac286.5%
sub-neg86.5%
distribute-neg-in86.5%
remove-double-neg86.5%
+-commutative86.5%
sub-neg86.5%
Simplified86.5%
Taylor expanded in a around inf 66.9%
+-commutative66.9%
Simplified66.9%
if 1.45000000000000005e237 < z Initial program 82.1%
sub-neg82.1%
+-commutative82.1%
distribute-frac-neg82.1%
distribute-rgt-neg-out82.1%
associate-/l*90.8%
fma-define90.7%
distribute-frac-neg90.7%
distribute-neg-frac290.7%
sub-neg90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
+-commutative90.7%
sub-neg90.7%
Simplified90.7%
Taylor expanded in z around inf 59.1%
associate-/l*72.1%
Simplified72.1%
Taylor expanded in t around inf 49.5%
associate-/l*53.8%
Simplified53.8%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 79.7%
sub-neg79.7%
+-commutative79.7%
distribute-frac-neg79.7%
distribute-rgt-neg-out79.7%
associate-/l*86.8%
fma-define86.8%
distribute-frac-neg86.8%
distribute-neg-frac286.8%
sub-neg86.8%
distribute-neg-in86.8%
remove-double-neg86.8%
+-commutative86.8%
sub-neg86.8%
Simplified86.8%
Taylor expanded in y around 0 50.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} 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) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
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 + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024111
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))