
(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 12 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 -4.2e+90) (not (<= t 5.6e+56))) (+ x (- (* y (/ z t)) (* a (/ y t)))) (+ (+ x y) (* (/ y (- a t)) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+90) || !(t <= 5.6e+56)) {
tmp = x + ((y * (z / t)) - (a * (y / t)));
} else {
tmp = (x + y) + ((y / (a - t)) * (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.2d+90)) .or. (.not. (t <= 5.6d+56))) then
tmp = x + ((y * (z / t)) - (a * (y / t)))
else
tmp = (x + y) + ((y / (a - t)) * (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+90) || !(t <= 5.6e+56)) {
tmp = x + ((y * (z / t)) - (a * (y / t)));
} else {
tmp = (x + y) + ((y / (a - t)) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e+90) or not (t <= 5.6e+56): tmp = x + ((y * (z / t)) - (a * (y / t))) else: tmp = (x + y) + ((y / (a - t)) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e+90) || !(t <= 5.6e+56)) tmp = Float64(x + Float64(Float64(y * Float64(z / t)) - Float64(a * Float64(y / t)))); else tmp = Float64(Float64(x + y) + Float64(Float64(y / Float64(a - t)) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.2e+90) || ~((t <= 5.6e+56))) tmp = x + ((y * (z / t)) - (a * (y / t))); else tmp = (x + y) + ((y / (a - t)) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.2e+90], N[Not[LessEqual[t, 5.6e+56]], $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[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+90} \lor \neg \left(t \leq 5.6 \cdot 10^{+56}\right):\\
\;\;\;\;x + \left(y \cdot \frac{z}{t} - a \cdot \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{y}{a - t} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if t < -4.19999999999999961e90 or 5.60000000000000017e56 < t Initial program 50.4%
sub-neg50.4%
+-commutative50.4%
distribute-frac-neg50.4%
distribute-rgt-neg-out50.4%
associate-/l*60.0%
fma-define60.3%
distribute-frac-neg60.3%
distribute-neg-frac260.3%
sub-neg60.3%
distribute-neg-in60.3%
remove-double-neg60.3%
+-commutative60.3%
sub-neg60.3%
Simplified60.3%
Taylor expanded in t around inf 73.5%
associate--l+73.5%
associate-+r+82.9%
distribute-rgt1-in82.9%
metadata-eval82.9%
mul0-lft82.9%
associate-/l*91.0%
associate-/l*95.3%
Simplified95.3%
if -4.19999999999999961e90 < t < 5.60000000000000017e56Initial program 90.6%
associate-/l*94.3%
*-commutative94.3%
Applied egg-rr94.3%
Final simplification94.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.2e+90) (not (<= t 1.35e+57))) (+ x (* y (/ z t))) (+ (+ x y) (* (/ y (- a t)) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.2e+90) || !(t <= 1.35e+57)) {
tmp = x + (y * (z / t));
} else {
tmp = (x + y) + ((y / (a - t)) * (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-7.2d+90)) .or. (.not. (t <= 1.35d+57))) then
tmp = x + (y * (z / t))
else
tmp = (x + y) + ((y / (a - t)) * (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.2e+90) || !(t <= 1.35e+57)) {
tmp = x + (y * (z / t));
} else {
tmp = (x + y) + ((y / (a - t)) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.2e+90) or not (t <= 1.35e+57): tmp = x + (y * (z / t)) else: tmp = (x + y) + ((y / (a - t)) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.2e+90) || !(t <= 1.35e+57)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(y / Float64(a - t)) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.2e+90) || ~((t <= 1.35e+57))) tmp = x + (y * (z / t)); else tmp = (x + y) + ((y / (a - t)) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.2e+90], N[Not[LessEqual[t, 1.35e+57]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+90} \lor \neg \left(t \leq 1.35 \cdot 10^{+57}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{y}{a - t} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if t < -7.2e90 or 1.3499999999999999e57 < t Initial program 50.4%
sub-neg50.4%
+-commutative50.4%
distribute-frac-neg50.4%
distribute-rgt-neg-out50.4%
associate-/l*60.0%
fma-define60.3%
distribute-frac-neg60.3%
distribute-neg-frac260.3%
sub-neg60.3%
distribute-neg-in60.3%
remove-double-neg60.3%
+-commutative60.3%
sub-neg60.3%
Simplified60.3%
Taylor expanded in t around inf 73.5%
associate--l+73.5%
associate-+r+82.9%
distribute-rgt1-in82.9%
metadata-eval82.9%
mul0-lft82.9%
associate-/l*91.0%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in a around 0 81.4%
associate-*r/91.8%
Simplified91.8%
if -7.2e90 < t < 1.3499999999999999e57Initial program 90.6%
associate-/l*94.3%
*-commutative94.3%
Applied egg-rr94.3%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e+90) (not (<= t 2.4e+55))) (+ x (* y (/ z t))) (+ (+ x y) (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e+90) || !(t <= 2.4e+55)) {
tmp = x + (y * (z / t));
} else {
tmp = (x + y) + (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 ((t <= (-2.5d+90)) .or. (.not. (t <= 2.4d+55))) then
tmp = x + (y * (z / t))
else
tmp = (x + y) + (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 ((t <= -2.5e+90) || !(t <= 2.4e+55)) {
tmp = x + (y * (z / t));
} else {
tmp = (x + y) + (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.5e+90) or not (t <= 2.4e+55): tmp = x + (y * (z / t)) else: tmp = (x + y) + (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e+90) || !(t <= 2.4e+55)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) + Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.5e+90) || ~((t <= 2.4e+55))) tmp = x + (y * (z / t)); else tmp = (x + y) + (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e+90], N[Not[LessEqual[t, 2.4e+55]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+90} \lor \neg \left(t \leq 2.4 \cdot 10^{+55}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -2.5000000000000002e90 or 2.3999999999999999e55 < t Initial program 50.4%
sub-neg50.4%
+-commutative50.4%
distribute-frac-neg50.4%
distribute-rgt-neg-out50.4%
associate-/l*60.0%
fma-define60.3%
distribute-frac-neg60.3%
distribute-neg-frac260.3%
sub-neg60.3%
distribute-neg-in60.3%
remove-double-neg60.3%
+-commutative60.3%
sub-neg60.3%
Simplified60.3%
Taylor expanded in t around inf 73.5%
associate--l+73.5%
associate-+r+82.9%
distribute-rgt1-in82.9%
metadata-eval82.9%
mul0-lft82.9%
associate-/l*91.0%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in a around 0 81.4%
associate-*r/91.8%
Simplified91.8%
if -2.5000000000000002e90 < t < 2.3999999999999999e55Initial program 90.6%
Taylor expanded in z around inf 89.9%
associate-/l*94.2%
Simplified94.2%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.8e-13) (+ x y) (if (<= a -1.02e-285) x (if (<= a 5.8e-157) (* y (/ z t)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-13) {
tmp = x + y;
} else if (a <= -1.02e-285) {
tmp = x;
} else if (a <= 5.8e-157) {
tmp = y * (z / t);
} 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 <= (-1.8d-13)) then
tmp = x + y
else if (a <= (-1.02d-285)) then
tmp = x
else if (a <= 5.8d-157) then
tmp = y * (z / t)
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 <= -1.8e-13) {
tmp = x + y;
} else if (a <= -1.02e-285) {
tmp = x;
} else if (a <= 5.8e-157) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e-13: tmp = x + y elif a <= -1.02e-285: tmp = x elif a <= 5.8e-157: tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e-13) tmp = Float64(x + y); elseif (a <= -1.02e-285) tmp = x; elseif (a <= 5.8e-157) tmp = Float64(y * Float64(z / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e-13) tmp = x + y; elseif (a <= -1.02e-285) tmp = x; elseif (a <= 5.8e-157) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e-13], N[(x + y), $MachinePrecision], If[LessEqual[a, -1.02e-285], x, If[LessEqual[a, 5.8e-157], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-13}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -1.02 \cdot 10^{-285}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-157}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.7999999999999999e-13 or 5.79999999999999977e-157 < a Initial program 80.9%
Taylor expanded in a around inf 70.3%
+-commutative70.3%
Simplified70.3%
if -1.7999999999999999e-13 < a < -1.01999999999999994e-285Initial program 67.1%
Taylor expanded in x around inf 56.4%
if -1.01999999999999994e-285 < a < 5.79999999999999977e-157Initial program 78.3%
sub-neg78.3%
+-commutative78.3%
distribute-frac-neg78.3%
distribute-rgt-neg-out78.3%
associate-/l*77.8%
fma-define78.0%
distribute-frac-neg78.0%
distribute-neg-frac278.0%
sub-neg78.0%
distribute-neg-in78.0%
remove-double-neg78.0%
+-commutative78.0%
sub-neg78.0%
Simplified78.0%
Taylor expanded in z around inf 70.8%
Taylor expanded in t around inf 61.7%
associate-*r/64.6%
Simplified64.6%
Final simplification66.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.5e+90) (not (<= t 1.1e+46))) (+ x (* y (/ z t))) (- (+ x y) (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e+90) || !(t <= 1.1e+46)) {
tmp = x + (y * (z / 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 ((t <= (-1.5d+90)) .or. (.not. (t <= 1.1d+46))) then
tmp = x + (y * (z / 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 ((t <= -1.5e+90) || !(t <= 1.1e+46)) {
tmp = x + (y * (z / t));
} else {
tmp = (x + y) - ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.5e+90) or not (t <= 1.1e+46): tmp = x + (y * (z / t)) else: tmp = (x + y) - ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.5e+90) || !(t <= 1.1e+46)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) - Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.5e+90) || ~((t <= 1.1e+46))) tmp = x + (y * (z / t)); else tmp = (x + y) - ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.5e+90], N[Not[LessEqual[t, 1.1e+46]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+90} \lor \neg \left(t \leq 1.1 \cdot 10^{+46}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.49999999999999989e90 or 1.1e46 < t Initial program 52.1%
sub-neg52.1%
+-commutative52.1%
distribute-frac-neg52.1%
distribute-rgt-neg-out52.1%
associate-/l*61.4%
fma-define61.7%
distribute-frac-neg61.7%
distribute-neg-frac261.7%
sub-neg61.7%
distribute-neg-in61.7%
remove-double-neg61.7%
+-commutative61.7%
sub-neg61.7%
Simplified61.7%
Taylor expanded in t around inf 73.5%
associate--l+73.5%
associate-+r+82.6%
distribute-rgt1-in82.6%
metadata-eval82.6%
mul0-lft82.6%
associate-/l*90.4%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in a around 0 80.9%
associate-*r/91.0%
Simplified91.0%
if -1.49999999999999989e90 < t < 1.1e46Initial program 90.5%
Taylor expanded in t around 0 80.1%
Final simplification83.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+90) (not (<= t 6.2e+45))) (+ x (* y (/ z t))) (- (+ x y) (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+90) || !(t <= 6.2e+45)) {
tmp = x + (y * (z / 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 ((t <= (-4.8d+90)) .or. (.not. (t <= 6.2d+45))) then
tmp = x + (y * (z / 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 ((t <= -4.8e+90) || !(t <= 6.2e+45)) {
tmp = x + (y * (z / t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+90) or not (t <= 6.2e+45): tmp = x + (y * (z / t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+90) || !(t <= 6.2e+45)) tmp = Float64(x + Float64(y * Float64(z / 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 ((t <= -4.8e+90) || ~((t <= 6.2e+45))) tmp = x + (y * (z / t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+90], N[Not[LessEqual[t, 6.2e+45]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+90} \lor \neg \left(t \leq 6.2 \cdot 10^{+45}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -4.8000000000000002e90 or 6.19999999999999975e45 < t Initial program 52.1%
sub-neg52.1%
+-commutative52.1%
distribute-frac-neg52.1%
distribute-rgt-neg-out52.1%
associate-/l*61.4%
fma-define61.7%
distribute-frac-neg61.7%
distribute-neg-frac261.7%
sub-neg61.7%
distribute-neg-in61.7%
remove-double-neg61.7%
+-commutative61.7%
sub-neg61.7%
Simplified61.7%
Taylor expanded in t around inf 73.5%
associate--l+73.5%
associate-+r+82.6%
distribute-rgt1-in82.6%
metadata-eval82.6%
mul0-lft82.6%
associate-/l*90.4%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in a around 0 80.9%
associate-*r/91.0%
Simplified91.0%
if -4.8000000000000002e90 < t < 6.19999999999999975e45Initial program 90.5%
Taylor expanded in t around 0 80.1%
+-commutative80.1%
associate-/l*85.1%
Simplified85.1%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+175) (not (<= z 3.6e+171))) (* y (- 1.0 (/ z a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+175) || !(z <= 3.6e+171)) {
tmp = y * (1.0 - (z / 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 ((z <= (-2.4d+175)) .or. (.not. (z <= 3.6d+171))) then
tmp = y * (1.0d0 - (z / 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 ((z <= -2.4e+175) || !(z <= 3.6e+171)) {
tmp = y * (1.0 - (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+175) or not (z <= 3.6e+171): tmp = y * (1.0 - (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e+175) || !(z <= 3.6e+171)) tmp = Float64(y * Float64(1.0 - Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.4e+175) || ~((z <= 3.6e+171))) tmp = y * (1.0 - (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e+175], N[Not[LessEqual[z, 3.6e+171]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+175} \lor \neg \left(z \leq 3.6 \cdot 10^{+171}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.4e175 or 3.60000000000000018e171 < z Initial program 73.0%
Taylor expanded in x around 0 65.3%
associate-*r/83.7%
sub-neg83.7%
*-rgt-identity83.7%
distribute-rgt-neg-in83.7%
mul-1-neg83.7%
distribute-lft-in83.7%
mul-1-neg83.7%
unsub-neg83.7%
Simplified83.7%
Taylor expanded in t around 0 60.7%
if -2.4e175 < z < 3.60000000000000018e171Initial program 79.1%
Taylor expanded in a around inf 67.4%
+-commutative67.4%
Simplified67.4%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+139) (not (<= z 8.5e+171))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+139) || !(z <= 8.5e+171)) {
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 ((z <= (-1.5d+139)) .or. (.not. (z <= 8.5d+171))) 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 ((z <= -1.5e+139) || !(z <= 8.5e+171)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+139) or not (z <= 8.5e+171): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+139) || !(z <= 8.5e+171)) 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 ((z <= -1.5e+139) || ~((z <= 8.5e+171))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+139], N[Not[LessEqual[z, 8.5e+171]], $MachinePrecision]], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+139} \lor \neg \left(z \leq 8.5 \cdot 10^{+171}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.5e139 or 8.4999999999999995e171 < z Initial program 74.4%
sub-neg74.4%
+-commutative74.4%
distribute-frac-neg74.4%
distribute-rgt-neg-out74.4%
associate-/l*92.9%
fma-define93.1%
distribute-frac-neg93.1%
distribute-neg-frac293.1%
sub-neg93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
+-commutative93.1%
sub-neg93.1%
Simplified93.1%
Taylor expanded in z around inf 59.2%
associate-/l*73.7%
Simplified73.7%
if -1.5e139 < z < 8.4999999999999995e171Initial program 78.8%
Taylor expanded in a around inf 68.6%
+-commutative68.6%
Simplified68.6%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e-13) (not (<= a 2.7e-24))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-13) || !(a <= 2.7e-24)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.5d-13)) .or. (.not. (a <= 2.7d-24))) then
tmp = x + y
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-13) || !(a <= 2.7e-24)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e-13) or not (a <= 2.7e-24): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e-13) || !(a <= 2.7e-24)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.5e-13) || ~((a <= 2.7e-24))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e-13], N[Not[LessEqual[a, 2.7e-24]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-13} \lor \neg \left(a \leq 2.7 \cdot 10^{-24}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -2.49999999999999995e-13 or 2.70000000000000007e-24 < a Initial program 83.3%
Taylor expanded in a around inf 75.5%
+-commutative75.5%
Simplified75.5%
if -2.49999999999999995e-13 < a < 2.70000000000000007e-24Initial program 71.3%
sub-neg71.3%
+-commutative71.3%
distribute-frac-neg71.3%
distribute-rgt-neg-out71.3%
associate-/l*73.6%
fma-define73.7%
distribute-frac-neg73.7%
distribute-neg-frac273.7%
sub-neg73.7%
distribute-neg-in73.7%
remove-double-neg73.7%
+-commutative73.7%
sub-neg73.7%
Simplified73.7%
Taylor expanded in t around inf 71.4%
associate--l+71.4%
associate-+r+79.2%
distribute-rgt1-in79.2%
metadata-eval79.2%
mul0-lft79.2%
associate-/l*81.6%
associate-/l*75.3%
Simplified75.3%
Taylor expanded in a around 0 78.1%
associate-*r/80.5%
Simplified80.5%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e-13) (not (<= a 1e-25))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e-13) || !(a <= 1e-25)) {
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 <= (-3d-13)) .or. (.not. (a <= 1d-25))) 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 <= -3e-13) || !(a <= 1e-25)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e-13) or not (a <= 1e-25): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e-13) || !(a <= 1e-25)) 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 <= -3e-13) || ~((a <= 1e-25))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e-13], N[Not[LessEqual[a, 1e-25]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-13} \lor \neg \left(a \leq 10^{-25}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.99999999999999984e-13 or 1.00000000000000004e-25 < a Initial program 83.3%
Taylor expanded in a around inf 75.5%
+-commutative75.5%
Simplified75.5%
if -2.99999999999999984e-13 < a < 1.00000000000000004e-25Initial program 71.3%
Taylor expanded in x around inf 47.2%
Final simplification62.3%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.95e+144) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.95e+144) {
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 <= 1.95d+144) 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 <= 1.95e+144) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.95e+144: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.95e+144) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 1.95e+144) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.95e+144], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.95 \cdot 10^{+144}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 1.95000000000000009e144Initial program 79.4%
Taylor expanded in x around inf 54.0%
if 1.95000000000000009e144 < y Initial program 68.4%
Taylor expanded in x around 0 64.1%
associate-*r/80.6%
sub-neg80.6%
*-rgt-identity80.6%
distribute-rgt-neg-in80.6%
mul-1-neg80.6%
distribute-lft-in80.7%
mul-1-neg80.7%
unsub-neg80.7%
Simplified80.7%
Taylor expanded in a around inf 38.5%
Final simplification51.7%
(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 77.7%
Taylor expanded in x around inf 47.0%
Final simplification47.0%
(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 2024078
(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))))