
(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 17 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 (or (<= t -2.3e+114) (not (<= t 1.32e+41))) (+ x (- (* y (/ z t)) (* a (/ y t)))) (fma (- z t) (/ y (- t a)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e+114) || !(t <= 1.32e+41)) {
tmp = x + ((y * (z / t)) - (a * (y / t)));
} else {
tmp = fma((z - t), (y / (t - a)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e+114) || !(t <= 1.32e+41)) tmp = Float64(x + Float64(Float64(y * Float64(z / t)) - Float64(a * Float64(y / t)))); else tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e+114], N[Not[LessEqual[t, 1.32e+41]], $MachinePrecision]], N[(x + N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+114} \lor \neg \left(t \leq 1.32 \cdot 10^{+41}\right):\\
\;\;\;\;x + \left(y \cdot \frac{z}{t} - a \cdot \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if t < -2.3e114 or 1.3199999999999999e41 < t Initial program 49.3%
sub-neg49.3%
+-commutative49.3%
distribute-frac-neg49.3%
distribute-rgt-neg-out49.3%
associate-/l*58.8%
fma-define59.2%
distribute-frac-neg59.2%
distribute-neg-frac259.2%
sub-neg59.2%
distribute-neg-in59.2%
remove-double-neg59.2%
+-commutative59.2%
sub-neg59.2%
Simplified59.2%
Taylor expanded in t around inf 67.1%
associate--l+67.1%
associate-+r+73.7%
distribute-rgt1-in73.7%
metadata-eval73.7%
mul0-lft73.7%
associate-/l*82.7%
associate-/l*89.8%
Simplified89.8%
if -2.3e114 < t < 1.3199999999999999e41Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
distribute-frac-neg91.4%
distribute-rgt-neg-out91.4%
associate-/l*92.0%
fma-define92.3%
distribute-frac-neg92.3%
distribute-neg-frac292.3%
sub-neg92.3%
distribute-neg-in92.3%
remove-double-neg92.3%
+-commutative92.3%
sub-neg92.3%
Simplified92.3%
Final simplification91.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -2e-238) (not (<= t_1 1e-196)))
(+ (+ x y) (* (- 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 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -2e-238) || !(t_1 <= 1e-196)) {
tmp = (x + y) + ((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 = (x + y) + ((y * (t - z)) / (a - t))
if ((t_1 <= (-2d-238)) .or. (.not. (t_1 <= 1d-196))) then
tmp = (x + y) + ((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 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -2e-238) || !(t_1 <= 1e-196)) {
tmp = (x + y) + ((z - t) * (y / (t - a)));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if (t_1 <= -2e-238) or not (t_1 <= 1e-196): tmp = (x + y) + ((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(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -2e-238) || !(t_1 <= 1e-196)) tmp = Float64(Float64(x + y) + 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 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if ((t_1 <= -2e-238) || ~((t_1 <= 1e-196))) tmp = (x + y) + ((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[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-238], N[Not[LessEqual[t$95$1, 1e-196]], $MachinePrecision]], N[(N[(x + y), $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(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-238} \lor \neg \left(t\_1 \leq 10^{-196}\right):\\
\;\;\;\;\left(x + y\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))) < -2e-238 or 1e-196 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.6%
associate-/l*88.2%
*-commutative88.2%
Applied egg-rr88.2%
if -2e-238 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1e-196Initial program 10.8%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
distribute-lft-out--99.9%
div-sub99.8%
mul-1-neg99.8%
unsub-neg99.8%
*-commutative99.8%
distribute-lft-out--99.9%
Simplified99.9%
Final simplification89.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= t -3.4e+112)
t_1
(if (<= t -7e-144)
(+ x y)
(if (<= t -1.02e-269)
(* y (+ (/ z (- t a)) 1.0))
(if (<= t 5.8e+80) (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (t <= -3.4e+112) {
tmp = t_1;
} else if (t <= -7e-144) {
tmp = x + y;
} else if (t <= -1.02e-269) {
tmp = y * ((z / (t - a)) + 1.0);
} else if (t <= 5.8e+80) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (a * (y / t))
if (t <= (-3.4d+112)) then
tmp = t_1
else if (t <= (-7d-144)) then
tmp = x + y
else if (t <= (-1.02d-269)) then
tmp = y * ((z / (t - a)) + 1.0d0)
else if (t <= 5.8d+80) then
tmp = x + y
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 = x - (a * (y / t));
double tmp;
if (t <= -3.4e+112) {
tmp = t_1;
} else if (t <= -7e-144) {
tmp = x + y;
} else if (t <= -1.02e-269) {
tmp = y * ((z / (t - a)) + 1.0);
} else if (t <= 5.8e+80) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -3.4e+112: tmp = t_1 elif t <= -7e-144: tmp = x + y elif t <= -1.02e-269: tmp = y * ((z / (t - a)) + 1.0) elif t <= 5.8e+80: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (t <= -3.4e+112) tmp = t_1; elseif (t <= -7e-144) tmp = Float64(x + y); elseif (t <= -1.02e-269) tmp = Float64(y * Float64(Float64(z / Float64(t - a)) + 1.0)); elseif (t <= 5.8e+80) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); tmp = 0.0; if (t <= -3.4e+112) tmp = t_1; elseif (t <= -7e-144) tmp = x + y; elseif (t <= -1.02e-269) tmp = y * ((z / (t - a)) + 1.0); elseif (t <= 5.8e+80) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e+112], t$95$1, If[LessEqual[t, -7e-144], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.02e-269], N[(y * N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+80], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-144}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.02 \cdot 10^{-269}:\\
\;\;\;\;y \cdot \left(\frac{z}{t - a} + 1\right)\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+80}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.39999999999999993e112 or 5.79999999999999971e80 < t Initial program 46.7%
Taylor expanded in z around 0 42.2%
associate--l+52.0%
sub-neg52.0%
mul-1-neg52.0%
remove-double-neg52.0%
associate-/l*59.2%
Simplified59.2%
Taylor expanded in x around inf 45.1%
associate-+r+40.5%
associate-/l*48.3%
associate-/r*48.5%
Simplified48.5%
Taylor expanded in t around inf 58.2%
+-commutative58.2%
mul-1-neg58.2%
unsub-neg58.2%
distribute-lft1-in58.2%
metadata-eval58.2%
mul0-lft63.1%
metadata-eval63.1%
*-rgt-identity63.1%
associate-/l*71.1%
Simplified71.1%
if -3.39999999999999993e112 < t < -6.9999999999999997e-144 or -1.02000000000000002e-269 < t < 5.79999999999999971e80Initial program 89.1%
Taylor expanded in a around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -6.9999999999999997e-144 < t < -1.02000000000000002e-269Initial program 96.2%
Taylor expanded in z around inf 96.4%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in x around 0 82.1%
associate-/l*82.2%
cancel-sign-sub-inv82.2%
*-rgt-identity82.2%
distribute-lft-neg-in82.2%
distribute-rgt-neg-in82.2%
distribute-lft-in82.2%
sub-neg82.2%
Simplified82.2%
Final simplification73.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= t -1.9e+105)
t_1
(if (<= t -3.1e-142)
(+ x y)
(if (<= t -3.1e-268)
(* y (- 1.0 (/ z a)))
(if (<= t 5.8e+80) (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (t <= -1.9e+105) {
tmp = t_1;
} else if (t <= -3.1e-142) {
tmp = x + y;
} else if (t <= -3.1e-268) {
tmp = y * (1.0 - (z / a));
} else if (t <= 5.8e+80) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (a * (y / t))
if (t <= (-1.9d+105)) then
tmp = t_1
else if (t <= (-3.1d-142)) then
tmp = x + y
else if (t <= (-3.1d-268)) then
tmp = y * (1.0d0 - (z / a))
else if (t <= 5.8d+80) then
tmp = x + y
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 = x - (a * (y / t));
double tmp;
if (t <= -1.9e+105) {
tmp = t_1;
} else if (t <= -3.1e-142) {
tmp = x + y;
} else if (t <= -3.1e-268) {
tmp = y * (1.0 - (z / a));
} else if (t <= 5.8e+80) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -1.9e+105: tmp = t_1 elif t <= -3.1e-142: tmp = x + y elif t <= -3.1e-268: tmp = y * (1.0 - (z / a)) elif t <= 5.8e+80: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (t <= -1.9e+105) tmp = t_1; elseif (t <= -3.1e-142) tmp = Float64(x + y); elseif (t <= -3.1e-268) tmp = Float64(y * Float64(1.0 - Float64(z / a))); elseif (t <= 5.8e+80) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); tmp = 0.0; if (t <= -1.9e+105) tmp = t_1; elseif (t <= -3.1e-142) tmp = x + y; elseif (t <= -3.1e-268) tmp = y * (1.0 - (z / a)); elseif (t <= 5.8e+80) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e+105], t$95$1, If[LessEqual[t, -3.1e-142], N[(x + y), $MachinePrecision], If[LessEqual[t, -3.1e-268], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+80], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-142}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-268}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+80}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.9e105 or 5.79999999999999971e80 < t Initial program 46.7%
Taylor expanded in z around 0 42.2%
associate--l+52.0%
sub-neg52.0%
mul-1-neg52.0%
remove-double-neg52.0%
associate-/l*59.2%
Simplified59.2%
Taylor expanded in x around inf 45.1%
associate-+r+40.5%
associate-/l*48.3%
associate-/r*48.5%
Simplified48.5%
Taylor expanded in t around inf 58.2%
+-commutative58.2%
mul-1-neg58.2%
unsub-neg58.2%
distribute-lft1-in58.2%
metadata-eval58.2%
mul0-lft63.1%
metadata-eval63.1%
*-rgt-identity63.1%
associate-/l*71.1%
Simplified71.1%
if -1.9e105 < t < -3.1e-142 or -3.0999999999999998e-268 < t < 5.79999999999999971e80Initial program 89.1%
Taylor expanded in a around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -3.1e-142 < t < -3.0999999999999998e-268Initial program 96.2%
Taylor expanded in t around 0 92.8%
+-commutative92.8%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in y around inf 78.6%
Final simplification73.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.1e+114) (not (<= t 1.26e+41))) (+ x (- (* y (/ z t)) (* a (/ y t)))) (+ (+ x y) (* (- z t) (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e+114) || !(t <= 1.26e+41)) {
tmp = x + ((y * (z / t)) - (a * (y / t)));
} else {
tmp = (x + y) + ((z - t) * (y / (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 ((t <= (-3.1d+114)) .or. (.not. (t <= 1.26d+41))) then
tmp = x + ((y * (z / t)) - (a * (y / t)))
else
tmp = (x + y) + ((z - t) * (y / (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 ((t <= -3.1e+114) || !(t <= 1.26e+41)) {
tmp = x + ((y * (z / t)) - (a * (y / t)));
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.1e+114) or not (t <= 1.26e+41): tmp = x + ((y * (z / t)) - (a * (y / t))) else: tmp = (x + y) + ((z - t) * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.1e+114) || !(t <= 1.26e+41)) tmp = Float64(x + Float64(Float64(y * Float64(z / t)) - Float64(a * Float64(y / t)))); else tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.1e+114) || ~((t <= 1.26e+41))) tmp = x + ((y * (z / t)) - (a * (y / t))); else tmp = (x + y) + ((z - t) * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.1e+114], N[Not[LessEqual[t, 1.26e+41]], $MachinePrecision]], N[(x + N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+114} \lor \neg \left(t \leq 1.26 \cdot 10^{+41}\right):\\
\;\;\;\;x + \left(y \cdot \frac{z}{t} - a \cdot \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -3.1e114 or 1.26000000000000001e41 < t Initial program 49.3%
sub-neg49.3%
+-commutative49.3%
distribute-frac-neg49.3%
distribute-rgt-neg-out49.3%
associate-/l*58.8%
fma-define59.2%
distribute-frac-neg59.2%
distribute-neg-frac259.2%
sub-neg59.2%
distribute-neg-in59.2%
remove-double-neg59.2%
+-commutative59.2%
sub-neg59.2%
Simplified59.2%
Taylor expanded in t around inf 67.1%
associate--l+67.1%
associate-+r+73.7%
distribute-rgt1-in73.7%
metadata-eval73.7%
mul0-lft73.7%
associate-/l*82.7%
associate-/l*89.8%
Simplified89.8%
if -3.1e114 < t < 1.26000000000000001e41Initial program 91.4%
associate-/l*92.0%
*-commutative92.0%
Applied egg-rr92.0%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.3e-102) (+ x y) (if (<= a 1.2e-250) x (if (<= a 5.1e-102) (* y (/ z (- t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.3e-102) {
tmp = x + y;
} else if (a <= 1.2e-250) {
tmp = x;
} else if (a <= 5.1e-102) {
tmp = y * (z / (t - a));
} else {
tmp = x + 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 (a <= (-2.3d-102)) then
tmp = x + y
else if (a <= 1.2d-250) then
tmp = x
else if (a <= 5.1d-102) then
tmp = y * (z / (t - a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.3e-102) {
tmp = x + y;
} else if (a <= 1.2e-250) {
tmp = x;
} else if (a <= 5.1e-102) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.3e-102: tmp = x + y elif a <= 1.2e-250: tmp = x elif a <= 5.1e-102: tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.3e-102) tmp = Float64(x + y); elseif (a <= 1.2e-250) tmp = x; elseif (a <= 5.1e-102) tmp = Float64(y * Float64(z / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.3e-102) tmp = x + y; elseif (a <= 1.2e-250) tmp = x; elseif (a <= 5.1e-102) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.3e-102], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.2e-250], x, If[LessEqual[a, 5.1e-102], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{-102}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-250}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.1 \cdot 10^{-102}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2.29999999999999987e-102 or 5.09999999999999999e-102 < a Initial program 79.6%
Taylor expanded in a around inf 72.7%
+-commutative72.7%
Simplified72.7%
if -2.29999999999999987e-102 < a < 1.1999999999999999e-250Initial program 71.9%
Taylor expanded in x around inf 67.9%
if 1.1999999999999999e-250 < a < 5.09999999999999999e-102Initial program 63.4%
sub-neg63.4%
+-commutative63.4%
distribute-frac-neg63.4%
distribute-rgt-neg-out63.4%
associate-/l*65.3%
fma-define65.8%
distribute-frac-neg65.8%
distribute-neg-frac265.8%
sub-neg65.8%
distribute-neg-in65.8%
remove-double-neg65.8%
+-commutative65.8%
sub-neg65.8%
Simplified65.8%
Taylor expanded in z around inf 55.5%
associate-/l*58.0%
Simplified58.0%
Final simplification69.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.4e+161)
(- x (* a (/ y t)))
(if (<= t 6e+40)
(+ (+ x y) (* y (/ z (- t a))))
(+ x (/ (* y (- z a)) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.4e+161) {
tmp = x - (a * (y / t));
} else if (t <= 6e+40) {
tmp = (x + y) + (y * (z / (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) :: tmp
if (t <= (-4.4d+161)) then
tmp = x - (a * (y / t))
else if (t <= 6d+40) then
tmp = (x + y) + (y * (z / (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 tmp;
if (t <= -4.4e+161) {
tmp = x - (a * (y / t));
} else if (t <= 6e+40) {
tmp = (x + y) + (y * (z / (t - a)));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.4e+161: tmp = x - (a * (y / t)) elif t <= 6e+40: tmp = (x + y) + (y * (z / (t - a))) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.4e+161) tmp = Float64(x - Float64(a * Float64(y / t))); elseif (t <= 6e+40) tmp = Float64(Float64(x + y) + Float64(y * Float64(z / 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) tmp = 0.0; if (t <= -4.4e+161) tmp = x - (a * (y / t)); elseif (t <= 6e+40) tmp = (x + y) + (y * (z / (t - a))); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.4e+161], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+40], N[(N[(x + y), $MachinePrecision] + N[(y * N[(z / 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}
\mathbf{if}\;t \leq -4.4 \cdot 10^{+161}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+40}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if t < -4.4e161Initial program 25.3%
Taylor expanded in z around 0 29.0%
associate--l+40.1%
sub-neg40.1%
mul-1-neg40.1%
remove-double-neg40.1%
associate-/l*53.1%
Simplified53.1%
Taylor expanded in x around inf 34.9%
associate-+r+27.6%
associate-/l*39.9%
associate-/r*39.8%
Simplified39.8%
Taylor expanded in t around inf 54.8%
+-commutative54.8%
mul-1-neg54.8%
unsub-neg54.8%
distribute-lft1-in54.8%
metadata-eval54.8%
mul0-lft62.5%
metadata-eval62.5%
*-rgt-identity62.5%
associate-/l*84.5%
Simplified84.5%
if -4.4e161 < t < 6.0000000000000004e40Initial program 90.1%
Taylor expanded in z around inf 88.9%
associate-/l*87.8%
Simplified87.8%
if 6.0000000000000004e40 < t Initial program 56.7%
Taylor expanded in t around inf 76.5%
associate--l+76.5%
distribute-lft-out--76.5%
div-sub76.5%
mul-1-neg76.5%
unsub-neg76.5%
*-commutative76.5%
distribute-lft-out--76.5%
Simplified76.5%
Final simplification84.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.3e-88) (not (<= a 105000000.0))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.3e-88) || !(a <= 105000000.0)) {
tmp = (x + y) - (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 <= (-4.3d-88)) .or. (.not. (a <= 105000000.0d0))) then
tmp = (x + y) - (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 <= -4.3e-88) || !(a <= 105000000.0)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.3e-88) or not (a <= 105000000.0): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.3e-88) || !(a <= 105000000.0)) tmp = Float64(Float64(x + y) - 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 <= -4.3e-88) || ~((a <= 105000000.0))) tmp = (x + y) - (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, -4.3e-88], N[Not[LessEqual[a, 105000000.0]], $MachinePrecision]], N[(N[(x + y), $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 -4.3 \cdot 10^{-88} \lor \neg \left(a \leq 105000000\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -4.2999999999999997e-88 or 1.05e8 < a Initial program 82.1%
Taylor expanded in t around 0 81.7%
+-commutative81.7%
associate-/l*82.4%
Simplified82.4%
if -4.2999999999999997e-88 < a < 1.05e8Initial program 66.4%
Taylor expanded in t around inf 78.0%
associate--l+78.0%
distribute-lft-out--78.0%
div-sub79.0%
mul-1-neg79.0%
unsub-neg79.0%
*-commutative79.0%
distribute-lft-out--79.0%
Simplified79.0%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e+20) (not (<= a 1e+111))) (+ x y) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e+20) || !(a <= 1e+111)) {
tmp = x + y;
} 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 <= (-2.5d+20)) .or. (.not. (a <= 1d+111))) then
tmp = x + y
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 <= -2.5e+20) || !(a <= 1e+111)) {
tmp = x + y;
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e+20) or not (a <= 1e+111): tmp = x + y else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e+20) || !(a <= 1e+111)) tmp = Float64(x + y); 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 <= -2.5e+20) || ~((a <= 1e+111))) tmp = x + y; else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e+20], N[Not[LessEqual[a, 1e+111]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+20} \lor \neg \left(a \leq 10^{+111}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -2.5e20 or 9.99999999999999957e110 < a Initial program 82.0%
Taylor expanded in a around inf 86.0%
+-commutative86.0%
Simplified86.0%
if -2.5e20 < a < 9.99999999999999957e110Initial program 71.5%
Taylor expanded in t around inf 72.7%
associate--l+72.7%
distribute-lft-out--72.7%
div-sub74.1%
mul-1-neg74.1%
unsub-neg74.1%
*-commutative74.1%
distribute-lft-out--74.1%
Simplified74.1%
Final simplification79.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2e-69)
(+ x (+ y (* t (/ y (- a t)))))
(if (<= a 105000000.0)
(+ x (/ (* y (- z a)) t))
(- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e-69) {
tmp = x + (y + (t * (y / (a - t))));
} else if (a <= 105000000.0) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) - (y * (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 (a <= (-2d-69)) then
tmp = x + (y + (t * (y / (a - t))))
else if (a <= 105000000.0d0) then
tmp = x + ((y * (z - a)) / t)
else
tmp = (x + y) - (y * (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 (a <= -2e-69) {
tmp = x + (y + (t * (y / (a - t))));
} else if (a <= 105000000.0) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e-69: tmp = x + (y + (t * (y / (a - t)))) elif a <= 105000000.0: tmp = x + ((y * (z - a)) / t) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e-69) tmp = Float64(x + Float64(y + Float64(t * Float64(y / Float64(a - t))))); elseif (a <= 105000000.0) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2e-69) tmp = x + (y + (t * (y / (a - t)))); elseif (a <= 105000000.0) tmp = x + ((y * (z - a)) / t); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e-69], N[(x + N[(y + N[(t * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 105000000.0], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-69}:\\
\;\;\;\;x + \left(y + t \cdot \frac{y}{a - t}\right)\\
\mathbf{elif}\;a \leq 105000000:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -1.9999999999999999e-69Initial program 80.4%
Taylor expanded in z around 0 78.2%
associate--l+80.4%
sub-neg80.4%
mul-1-neg80.4%
remove-double-neg80.4%
associate-/l*84.2%
Simplified84.2%
if -1.9999999999999999e-69 < a < 1.05e8Initial program 68.3%
Taylor expanded in t around inf 77.1%
associate--l+77.1%
distribute-lft-out--77.1%
div-sub78.1%
mul-1-neg78.1%
unsub-neg78.1%
*-commutative78.1%
distribute-lft-out--78.1%
Simplified78.1%
if 1.05e8 < a Initial program 83.5%
Taylor expanded in t around 0 81.5%
+-commutative81.5%
associate-/l*83.2%
Simplified83.2%
Final simplification81.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e+274) (/ (* y (- z)) a) (if (<= z 5.3e+171) (+ x y) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+274) {
tmp = (y * -z) / a;
} else if (z <= 5.3e+171) {
tmp = x + y;
} 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 <= (-2d+274)) then
tmp = (y * -z) / a
else if (z <= 5.3d+171) then
tmp = x + y
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 <= -2e+274) {
tmp = (y * -z) / a;
} else if (z <= 5.3e+171) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+274: tmp = (y * -z) / a elif z <= 5.3e+171: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+274) tmp = Float64(Float64(y * Float64(-z)) / a); elseif (z <= 5.3e+171) tmp = Float64(x + y); 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 <= -2e+274) tmp = (y * -z) / a; elseif (z <= 5.3e+171) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+274], N[(N[(y * (-z)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 5.3e+171], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+274}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{a}\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+171}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.99999999999999984e274Initial program 79.3%
sub-neg79.3%
+-commutative79.3%
distribute-frac-neg79.3%
distribute-rgt-neg-out79.3%
associate-/l*99.7%
fma-define99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
Taylor expanded in z around inf 79.3%
Taylor expanded in t around 0 66.8%
associate-*r/66.8%
associate-*r*66.8%
neg-mul-166.8%
Simplified66.8%
if -1.99999999999999984e274 < z < 5.29999999999999982e171Initial program 76.2%
Taylor expanded in a around inf 67.3%
+-commutative67.3%
Simplified67.3%
if 5.29999999999999982e171 < z Initial program 71.8%
sub-neg71.8%
+-commutative71.8%
distribute-frac-neg71.8%
distribute-rgt-neg-out71.8%
associate-/l*80.6%
fma-define80.4%
distribute-frac-neg80.4%
distribute-neg-frac280.4%
sub-neg80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
+-commutative80.4%
sub-neg80.4%
Simplified80.4%
Taylor expanded in z around inf 58.7%
Taylor expanded in t around inf 54.7%
associate-/l*63.6%
Simplified63.6%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.25e+277) (* y (/ (- z) a)) (if (<= z 4.45e+170) (+ x y) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.25e+277) {
tmp = y * (-z / a);
} else if (z <= 4.45e+170) {
tmp = x + y;
} 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.25d+277)) then
tmp = y * (-z / a)
else if (z <= 4.45d+170) then
tmp = x + y
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.25e+277) {
tmp = y * (-z / a);
} else if (z <= 4.45e+170) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.25e+277: tmp = y * (-z / a) elif z <= 4.45e+170: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.25e+277) tmp = Float64(y * Float64(Float64(-z) / a)); elseif (z <= 4.45e+170) tmp = Float64(x + y); 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.25e+277) tmp = y * (-z / a); elseif (z <= 4.45e+170) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.25e+277], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.45e+170], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+277}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{elif}\;z \leq 4.45 \cdot 10^{+170}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.24999999999999995e277Initial program 79.3%
Taylor expanded in x around inf 68.8%
Taylor expanded in z around inf 68.8%
associate-*r/68.8%
associate-*r*68.8%
*-commutative68.8%
times-frac58.0%
neg-mul-158.0%
distribute-neg-frac58.0%
distribute-neg-frac258.0%
Simplified58.0%
Taylor expanded in a around inf 66.8%
mul-1-neg66.8%
associate-/l*56.2%
distribute-rgt-neg-in56.2%
Simplified56.2%
if -1.24999999999999995e277 < z < 4.45e170Initial program 76.2%
Taylor expanded in a around inf 67.3%
+-commutative67.3%
Simplified67.3%
if 4.45e170 < z Initial program 71.8%
sub-neg71.8%
+-commutative71.8%
distribute-frac-neg71.8%
distribute-rgt-neg-out71.8%
associate-/l*80.6%
fma-define80.4%
distribute-frac-neg80.4%
distribute-neg-frac280.4%
sub-neg80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
+-commutative80.4%
sub-neg80.4%
Simplified80.4%
Taylor expanded in z around inf 58.7%
Taylor expanded in t around inf 54.7%
associate-/l*63.6%
Simplified63.6%
Final simplification66.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.05e-100) (not (<= a 9.5e-8))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.05e-100) || !(a <= 9.5e-8)) {
tmp = x + y;
} 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.05d-100)) .or. (.not. (a <= 9.5d-8))) then
tmp = x + y
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.05e-100) || !(a <= 9.5e-8)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.05e-100) or not (a <= 9.5e-8): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.05e-100) || !(a <= 9.5e-8)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.05e-100) || ~((a <= 9.5e-8))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.05e-100], N[Not[LessEqual[a, 9.5e-8]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{-100} \lor \neg \left(a \leq 9.5 \cdot 10^{-8}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.05000000000000005e-100 or 9.50000000000000036e-8 < a Initial program 80.3%
Taylor expanded in a around inf 75.1%
+-commutative75.1%
Simplified75.1%
if -1.05000000000000005e-100 < a < 9.50000000000000036e-8Initial program 68.7%
Taylor expanded in x around inf 52.6%
Final simplification66.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -5.9e-154) x (if (<= x 2.6e-147) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.9e-154) {
tmp = x;
} else if (x <= 2.6e-147) {
tmp = y;
} 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 <= (-5.9d-154)) then
tmp = x
else if (x <= 2.6d-147) then
tmp = y
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 <= -5.9e-154) {
tmp = x;
} else if (x <= 2.6e-147) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -5.9e-154: tmp = x elif x <= 2.6e-147: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -5.9e-154) tmp = x; elseif (x <= 2.6e-147) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -5.9e-154) tmp = x; elseif (x <= 2.6e-147) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.9e-154], x, If[LessEqual[x, 2.6e-147], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{-154}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-147}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.9000000000000003e-154 or 2.5999999999999999e-147 < x Initial program 81.1%
Taylor expanded in x around inf 60.1%
if -5.9000000000000003e-154 < x < 2.5999999999999999e-147Initial program 62.7%
Taylor expanded in x around inf 38.0%
Taylor expanded in a around inf 31.9%
Taylor expanded in x around 0 41.3%
(FPCore (x y z t a) :precision binary64 (if (<= z 5.3e+170) (+ x y) (* y (/ z t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 5.3e+170) {
tmp = x + y;
} 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 <= 5.3d+170) then
tmp = x + y
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 <= 5.3e+170) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 5.3e+170: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 5.3e+170) tmp = Float64(x + y); 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 <= 5.3e+170) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 5.3e+170], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.3 \cdot 10^{+170}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < 5.30000000000000003e170Initial program 76.3%
Taylor expanded in a around inf 64.9%
+-commutative64.9%
Simplified64.9%
if 5.30000000000000003e170 < z Initial program 71.8%
sub-neg71.8%
+-commutative71.8%
distribute-frac-neg71.8%
distribute-rgt-neg-out71.8%
associate-/l*80.6%
fma-define80.4%
distribute-frac-neg80.4%
distribute-neg-frac280.4%
sub-neg80.4%
distribute-neg-in80.4%
remove-double-neg80.4%
+-commutative80.4%
sub-neg80.4%
Simplified80.4%
Taylor expanded in z around inf 58.7%
Taylor expanded in t around inf 54.7%
associate-/l*63.6%
Simplified63.6%
Final simplification64.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 75.9%
Taylor expanded in x around inf 47.9%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 75.9%
Taylor expanded in z around 0 61.7%
associate--l+65.7%
sub-neg65.7%
mul-1-neg65.7%
remove-double-neg65.7%
associate-/l*68.5%
Simplified68.5%
Taylor expanded in x around 0 23.7%
Taylor expanded in t around inf 2.8%
distribute-rgt1-in2.8%
metadata-eval2.8%
mul0-lft2.8%
Simplified2.8%
(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 2024103
(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))))