
(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 10 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 -1.3e+28) (not (<= t 8e+93))) (+ x (* (/ y t) (- z a))) (fma (- z t) (/ y (- t a)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e+28) || !(t <= 8e+93)) {
tmp = x + ((y / t) * (z - a));
} else {
tmp = fma((z - t), (y / (t - a)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.3e+28) || !(t <= 8e+93)) tmp = Float64(x + Float64(Float64(y / t) * Float64(z - a))); 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, -1.3e+28], N[Not[LessEqual[t, 8e+93]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - a), $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 -1.3 \cdot 10^{+28} \lor \neg \left(t \leq 8 \cdot 10^{+93}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if t < -1.3000000000000001e28 or 8.00000000000000035e93 < t Initial program 53.7%
Taylor expanded in t around inf 86.5%
associate--l+86.5%
distribute-lft-out--86.5%
div-sub86.5%
mul-1-neg86.5%
unsub-neg86.5%
*-commutative86.5%
distribute-lft-out--86.5%
Simplified86.5%
Taylor expanded in a around 0 86.5%
mul-1-neg86.5%
sub-neg86.5%
associate--l-86.5%
+-commutative86.5%
associate--l-86.5%
cancel-sign-sub-inv86.5%
metadata-eval86.5%
associate-*r/90.2%
*-lft-identity90.2%
associate-+r-90.2%
associate-*r/86.5%
*-commutative86.5%
associate-*r/90.3%
associate-/l*93.2%
distribute-rgt-out--93.2%
Simplified93.2%
if -1.3000000000000001e28 < t < 8.00000000000000035e93Initial program 93.0%
sub-neg93.0%
+-commutative93.0%
distribute-frac-neg93.0%
distribute-rgt-neg-out93.0%
associate-/l*97.9%
fma-define97.9%
distribute-frac-neg97.9%
distribute-neg-frac297.9%
sub-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
+-commutative97.9%
sub-neg97.9%
Simplified97.9%
Final simplification96.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -8.5e-87)
(+ x y)
(if (<= a -2.8e-191)
(* y (/ z (- t a)))
(if (<= a -1.9e-227)
x
(if (<= a -6.6e-276) (* (/ y t) z) (if (<= a 2.1e-65) x (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.5e-87) {
tmp = x + y;
} else if (a <= -2.8e-191) {
tmp = y * (z / (t - a));
} else if (a <= -1.9e-227) {
tmp = x;
} else if (a <= -6.6e-276) {
tmp = (y / t) * z;
} else if (a <= 2.1e-65) {
tmp = x;
} 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 <= (-8.5d-87)) then
tmp = x + y
else if (a <= (-2.8d-191)) then
tmp = y * (z / (t - a))
else if (a <= (-1.9d-227)) then
tmp = x
else if (a <= (-6.6d-276)) then
tmp = (y / t) * z
else if (a <= 2.1d-65) then
tmp = x
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 <= -8.5e-87) {
tmp = x + y;
} else if (a <= -2.8e-191) {
tmp = y * (z / (t - a));
} else if (a <= -1.9e-227) {
tmp = x;
} else if (a <= -6.6e-276) {
tmp = (y / t) * z;
} else if (a <= 2.1e-65) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.5e-87: tmp = x + y elif a <= -2.8e-191: tmp = y * (z / (t - a)) elif a <= -1.9e-227: tmp = x elif a <= -6.6e-276: tmp = (y / t) * z elif a <= 2.1e-65: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.5e-87) tmp = Float64(x + y); elseif (a <= -2.8e-191) tmp = Float64(y * Float64(z / Float64(t - a))); elseif (a <= -1.9e-227) tmp = x; elseif (a <= -6.6e-276) tmp = Float64(Float64(y / t) * z); elseif (a <= 2.1e-65) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.5e-87) tmp = x + y; elseif (a <= -2.8e-191) tmp = y * (z / (t - a)); elseif (a <= -1.9e-227) tmp = x; elseif (a <= -6.6e-276) tmp = (y / t) * z; elseif (a <= 2.1e-65) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.5e-87], N[(x + y), $MachinePrecision], If[LessEqual[a, -2.8e-191], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.9e-227], x, If[LessEqual[a, -6.6e-276], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 2.1e-65], x, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-87}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-191}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-227}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -6.6 \cdot 10^{-276}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{elif}\;a \leq 2.1 \cdot 10^{-65}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -8.5000000000000001e-87 or 2.10000000000000003e-65 < a Initial program 82.7%
Taylor expanded in a around inf 72.1%
+-commutative72.1%
Simplified72.1%
if -8.5000000000000001e-87 < a < -2.80000000000000012e-191Initial program 69.7%
sub-neg69.7%
+-commutative69.7%
distribute-frac-neg69.7%
distribute-rgt-neg-out69.7%
associate-/l*73.4%
fma-define73.4%
distribute-frac-neg73.4%
distribute-neg-frac273.4%
sub-neg73.4%
distribute-neg-in73.4%
remove-double-neg73.4%
+-commutative73.4%
sub-neg73.4%
Simplified73.4%
Taylor expanded in z around inf 65.1%
associate-/l*64.3%
Simplified64.3%
if -2.80000000000000012e-191 < a < -1.90000000000000005e-227 or -6.59999999999999982e-276 < a < 2.10000000000000003e-65Initial program 74.9%
Taylor expanded in x around inf 69.3%
if -1.90000000000000005e-227 < a < -6.59999999999999982e-276Initial program 48.9%
sub-neg48.9%
+-commutative48.9%
distribute-frac-neg48.9%
distribute-rgt-neg-out48.9%
associate-/l*48.9%
fma-define49.1%
distribute-frac-neg49.1%
distribute-neg-frac249.1%
sub-neg49.1%
distribute-neg-in49.1%
remove-double-neg49.1%
+-commutative49.1%
sub-neg49.1%
Simplified49.1%
Taylor expanded in z around inf 79.0%
Taylor expanded in t around inf 79.0%
*-commutative79.0%
associate-/l*79.1%
Applied egg-rr79.1%
Final simplification70.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.8e-81)
(+ x y)
(if (<= a -3.9e-191)
(* z (/ y (- t a)))
(if (<= a -1e-227)
x
(if (<= a -1.6e-276) (* (/ y t) z) (if (<= a 3.4e-65) x (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.8e-81) {
tmp = x + y;
} else if (a <= -3.9e-191) {
tmp = z * (y / (t - a));
} else if (a <= -1e-227) {
tmp = x;
} else if (a <= -1.6e-276) {
tmp = (y / t) * z;
} else if (a <= 3.4e-65) {
tmp = x;
} 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.8d-81)) then
tmp = x + y
else if (a <= (-3.9d-191)) then
tmp = z * (y / (t - a))
else if (a <= (-1d-227)) then
tmp = x
else if (a <= (-1.6d-276)) then
tmp = (y / t) * z
else if (a <= 3.4d-65) then
tmp = x
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.8e-81) {
tmp = x + y;
} else if (a <= -3.9e-191) {
tmp = z * (y / (t - a));
} else if (a <= -1e-227) {
tmp = x;
} else if (a <= -1.6e-276) {
tmp = (y / t) * z;
} else if (a <= 3.4e-65) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.8e-81: tmp = x + y elif a <= -3.9e-191: tmp = z * (y / (t - a)) elif a <= -1e-227: tmp = x elif a <= -1.6e-276: tmp = (y / t) * z elif a <= 3.4e-65: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.8e-81) tmp = Float64(x + y); elseif (a <= -3.9e-191) tmp = Float64(z * Float64(y / Float64(t - a))); elseif (a <= -1e-227) tmp = x; elseif (a <= -1.6e-276) tmp = Float64(Float64(y / t) * z); elseif (a <= 3.4e-65) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.8e-81) tmp = x + y; elseif (a <= -3.9e-191) tmp = z * (y / (t - a)); elseif (a <= -1e-227) tmp = x; elseif (a <= -1.6e-276) tmp = (y / t) * z; elseif (a <= 3.4e-65) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.8e-81], N[(x + y), $MachinePrecision], If[LessEqual[a, -3.9e-191], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1e-227], x, If[LessEqual[a, -1.6e-276], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 3.4e-65], x, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-81}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -3.9 \cdot 10^{-191}:\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{elif}\;a \leq -1 \cdot 10^{-227}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{-276}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-65}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2.7999999999999999e-81 or 3.39999999999999987e-65 < a Initial program 82.7%
Taylor expanded in a around inf 72.1%
+-commutative72.1%
Simplified72.1%
if -2.7999999999999999e-81 < a < -3.8999999999999999e-191Initial program 69.7%
sub-neg69.7%
+-commutative69.7%
distribute-frac-neg69.7%
distribute-rgt-neg-out69.7%
associate-/l*73.4%
fma-define73.4%
distribute-frac-neg73.4%
distribute-neg-frac273.4%
sub-neg73.4%
distribute-neg-in73.4%
remove-double-neg73.4%
+-commutative73.4%
sub-neg73.4%
Simplified73.4%
Taylor expanded in z around inf 65.1%
*-commutative65.1%
associate-/l*68.6%
Applied egg-rr68.6%
if -3.8999999999999999e-191 < a < -9.99999999999999945e-228 or -1.59999999999999995e-276 < a < 3.39999999999999987e-65Initial program 74.9%
Taylor expanded in x around inf 69.3%
if -9.99999999999999945e-228 < a < -1.59999999999999995e-276Initial program 48.9%
sub-neg48.9%
+-commutative48.9%
distribute-frac-neg48.9%
distribute-rgt-neg-out48.9%
associate-/l*48.9%
fma-define49.1%
distribute-frac-neg49.1%
distribute-neg-frac249.1%
sub-neg49.1%
distribute-neg-in49.1%
remove-double-neg49.1%
+-commutative49.1%
sub-neg49.1%
Simplified49.1%
Taylor expanded in z around inf 79.0%
Taylor expanded in t around inf 79.0%
*-commutative79.0%
associate-/l*79.1%
Applied egg-rr79.1%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e+29) (not (<= t 5.6e+93))) (+ x (* (/ y t) (- z a))) (+ (+ x y) (* (/ y (- a t)) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e+29) || !(t <= 5.6e+93)) {
tmp = x + ((y / t) * (z - a));
} 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 <= (-2.4d+29)) .or. (.not. (t <= 5.6d+93))) then
tmp = x + ((y / t) * (z - a))
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 <= -2.4e+29) || !(t <= 5.6e+93)) {
tmp = x + ((y / t) * (z - a));
} else {
tmp = (x + y) + ((y / (a - t)) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e+29) or not (t <= 5.6e+93): tmp = x + ((y / t) * (z - a)) else: tmp = (x + y) + ((y / (a - t)) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e+29) || !(t <= 5.6e+93)) tmp = Float64(x + Float64(Float64(y / t) * Float64(z - a))); 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 <= -2.4e+29) || ~((t <= 5.6e+93))) tmp = x + ((y / t) * (z - a)); else tmp = (x + y) + ((y / (a - t)) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e+29], N[Not[LessEqual[t, 5.6e+93]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - a), $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 -2.4 \cdot 10^{+29} \lor \neg \left(t \leq 5.6 \cdot 10^{+93}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{y}{a - t} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if t < -2.4000000000000001e29 or 5.59999999999999978e93 < t Initial program 53.7%
Taylor expanded in t around inf 86.5%
associate--l+86.5%
distribute-lft-out--86.5%
div-sub86.5%
mul-1-neg86.5%
unsub-neg86.5%
*-commutative86.5%
distribute-lft-out--86.5%
Simplified86.5%
Taylor expanded in a around 0 86.5%
mul-1-neg86.5%
sub-neg86.5%
associate--l-86.5%
+-commutative86.5%
associate--l-86.5%
cancel-sign-sub-inv86.5%
metadata-eval86.5%
associate-*r/90.2%
*-lft-identity90.2%
associate-+r-90.2%
associate-*r/86.5%
*-commutative86.5%
associate-*r/90.3%
associate-/l*93.2%
distribute-rgt-out--93.2%
Simplified93.2%
if -2.4000000000000001e29 < t < 5.59999999999999978e93Initial program 93.0%
Taylor expanded in y around 0 93.0%
associate-*l/97.9%
Simplified97.9%
Final simplification96.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+30) (not (<= t 3e+90))) (+ x (* (/ y t) (- z a))) (+ (+ x y) (* z (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+30) || !(t <= 3e+90)) {
tmp = x + ((y / t) * (z - a));
} else {
tmp = (x + y) + (z * (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 <= (-1.05d+30)) .or. (.not. (t <= 3d+90))) then
tmp = x + ((y / t) * (z - a))
else
tmp = (x + y) + (z * (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 <= -1.05e+30) || !(t <= 3e+90)) {
tmp = x + ((y / t) * (z - a));
} else {
tmp = (x + y) + (z * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+30) or not (t <= 3e+90): tmp = x + ((y / t) * (z - a)) else: tmp = (x + y) + (z * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+30) || !(t <= 3e+90)) tmp = Float64(x + Float64(Float64(y / t) * Float64(z - a))); else tmp = Float64(Float64(x + y) + Float64(z * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+30) || ~((t <= 3e+90))) tmp = x + ((y / t) * (z - a)); else tmp = (x + y) + (z * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+30], N[Not[LessEqual[t, 3e+90]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+30} \lor \neg \left(t \leq 3 \cdot 10^{+90}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -1.05e30 or 2.99999999999999979e90 < t Initial program 53.7%
Taylor expanded in t around inf 86.5%
associate--l+86.5%
distribute-lft-out--86.5%
div-sub86.5%
mul-1-neg86.5%
unsub-neg86.5%
*-commutative86.5%
distribute-lft-out--86.5%
Simplified86.5%
Taylor expanded in a around 0 86.5%
mul-1-neg86.5%
sub-neg86.5%
associate--l-86.5%
+-commutative86.5%
associate--l-86.5%
cancel-sign-sub-inv86.5%
metadata-eval86.5%
associate-*r/90.2%
*-lft-identity90.2%
associate-+r-90.2%
associate-*r/86.5%
*-commutative86.5%
associate-*r/90.3%
associate-/l*93.2%
distribute-rgt-out--93.2%
Simplified93.2%
if -1.05e30 < t < 2.99999999999999979e90Initial program 93.0%
Taylor expanded in z around inf 91.4%
*-commutative91.4%
associate-/l*96.8%
Applied egg-rr96.8%
Final simplification95.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -33500000000000.0) (not (<= a 4.6e-38))) (+ x y) (+ x (* (/ y t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -33500000000000.0) || !(a <= 4.6e-38)) {
tmp = x + y;
} else {
tmp = x + ((y / t) * (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 <= (-33500000000000.0d0)) .or. (.not. (a <= 4.6d-38))) then
tmp = x + y
else
tmp = x + ((y / t) * (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 <= -33500000000000.0) || !(a <= 4.6e-38)) {
tmp = x + y;
} else {
tmp = x + ((y / t) * (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -33500000000000.0) or not (a <= 4.6e-38): tmp = x + y else: tmp = x + ((y / t) * (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -33500000000000.0) || !(a <= 4.6e-38)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y / t) * Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -33500000000000.0) || ~((a <= 4.6e-38))) tmp = x + y; else tmp = x + ((y / t) * (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -33500000000000.0], N[Not[LessEqual[a, 4.6e-38]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -33500000000000 \lor \neg \left(a \leq 4.6 \cdot 10^{-38}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\end{array}
\end{array}
if a < -3.35e13 or 4.60000000000000003e-38 < a Initial program 81.9%
Taylor expanded in a around inf 74.7%
+-commutative74.7%
Simplified74.7%
if -3.35e13 < a < 4.60000000000000003e-38Initial program 74.5%
Taylor expanded in t around inf 87.0%
associate--l+87.0%
distribute-lft-out--87.0%
div-sub87.0%
mul-1-neg87.0%
unsub-neg87.0%
*-commutative87.0%
distribute-lft-out--87.0%
Simplified87.0%
Taylor expanded in a around 0 87.0%
mul-1-neg87.0%
sub-neg87.0%
associate--l-87.0%
+-commutative87.0%
associate--l-87.0%
cancel-sign-sub-inv87.0%
metadata-eval87.0%
associate-*r/86.3%
*-lft-identity86.3%
associate-+r-86.3%
associate-*r/87.0%
*-commutative87.0%
associate-*r/87.7%
associate-/l*84.8%
distribute-rgt-out--87.7%
Simplified87.7%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.75e-17) (not (<= t 1700000.0))) (+ x (* (/ y t) (- z a))) (- (+ x y) (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.75e-17) || !(t <= 1700000.0)) {
tmp = x + ((y / t) * (z - a));
} else {
tmp = (x + y) - (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.75d-17)) .or. (.not. (t <= 1700000.0d0))) then
tmp = x + ((y / t) * (z - a))
else
tmp = (x + y) - (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.75e-17) || !(t <= 1700000.0)) {
tmp = x + ((y / t) * (z - a));
} else {
tmp = (x + y) - (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.75e-17) or not (t <= 1700000.0): tmp = x + ((y / t) * (z - a)) else: tmp = (x + y) - (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.75e-17) || !(t <= 1700000.0)) tmp = Float64(x + Float64(Float64(y / t) * Float64(z - a))); else tmp = Float64(Float64(x + y) - Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.75e-17) || ~((t <= 1700000.0))) tmp = x + ((y / t) * (z - a)); else tmp = (x + y) - (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.75e-17], N[Not[LessEqual[t, 1700000.0]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{-17} \lor \neg \left(t \leq 1700000\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.7500000000000001e-17 or 1.7e6 < t Initial program 61.2%
Taylor expanded in t around inf 86.0%
associate--l+86.0%
distribute-lft-out--86.0%
div-sub86.0%
mul-1-neg86.0%
unsub-neg86.0%
*-commutative86.0%
distribute-lft-out--86.1%
Simplified86.1%
Taylor expanded in a around 0 86.0%
mul-1-neg86.0%
sub-neg86.0%
associate--l-86.0%
+-commutative86.0%
associate--l-86.0%
cancel-sign-sub-inv86.0%
metadata-eval86.0%
associate-*r/89.0%
*-lft-identity89.0%
associate-+r-89.0%
associate-*r/86.0%
*-commutative86.0%
associate-*r/89.1%
associate-/l*91.5%
distribute-rgt-out--91.5%
Simplified91.5%
if -1.7500000000000001e-17 < t < 1.7e6Initial program 93.3%
Taylor expanded in t around 0 82.8%
*-commutative82.8%
associate-/l*87.7%
Applied egg-rr87.7%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.4e+14) (not (<= a 4.3e-5))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.4e+14) || !(a <= 4.3e-5)) {
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 <= (-3.4d+14)) .or. (.not. (a <= 4.3d-5))) 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 <= -3.4e+14) || !(a <= 4.3e-5)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.4e+14) or not (a <= 4.3e-5): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.4e+14) || !(a <= 4.3e-5)) 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 <= -3.4e+14) || ~((a <= 4.3e-5))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.4e+14], N[Not[LessEqual[a, 4.3e-5]], $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 -3.4 \cdot 10^{+14} \lor \neg \left(a \leq 4.3 \cdot 10^{-5}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -3.4e14 or 4.3000000000000002e-5 < a Initial program 81.3%
Taylor expanded in a around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -3.4e14 < a < 4.3000000000000002e-5Initial program 75.2%
Taylor expanded in t around inf 86.0%
associate--l+86.0%
distribute-lft-out--86.0%
div-sub86.0%
mul-1-neg86.0%
unsub-neg86.0%
*-commutative86.0%
distribute-lft-out--86.0%
Simplified86.0%
Taylor expanded in a around 0 84.7%
cancel-sign-sub-inv84.7%
metadata-eval84.7%
associate-*r/84.0%
*-lft-identity84.0%
Simplified84.0%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -950000000000.0) (not (<= a 4.8e-65))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -950000000000.0) || !(a <= 4.8e-65)) {
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 <= (-950000000000.0d0)) .or. (.not. (a <= 4.8d-65))) 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 <= -950000000000.0) || !(a <= 4.8e-65)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -950000000000.0) or not (a <= 4.8e-65): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -950000000000.0) || !(a <= 4.8e-65)) 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 <= -950000000000.0) || ~((a <= 4.8e-65))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -950000000000.0], N[Not[LessEqual[a, 4.8e-65]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -950000000000 \lor \neg \left(a \leq 4.8 \cdot 10^{-65}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.5e11 or 4.8000000000000003e-65 < a Initial program 82.7%
Taylor expanded in a around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -9.5e11 < a < 4.8000000000000003e-65Initial program 73.5%
Taylor expanded in x around inf 59.2%
Final simplification66.1%
(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.8%
Taylor expanded in x around inf 56.9%
Final simplification56.9%
(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 2024112
(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))))