
(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 11 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.35e+94) (not (<= t 1.25e+112))) (+ (- x (* a (/ y t))) (* y (/ z 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.35e+94) || !(t <= 1.25e+112)) {
tmp = (x - (a * (y / t))) + (y * (z / 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.35e+94) || !(t <= 1.25e+112)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / 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.35e+94], N[Not[LessEqual[t, 1.25e+112]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $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.35 \cdot 10^{+94} \lor \neg \left(t \leq 1.25 \cdot 10^{+112}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if t < -2.35000000000000008e94 or 1.25e112 < t Initial program 47.8%
Taylor expanded in t around inf 78.6%
sub-neg78.6%
mul-1-neg78.6%
unsub-neg78.6%
associate-/l*84.9%
mul-1-neg84.9%
remove-double-neg84.9%
associate-/l*93.5%
Simplified93.5%
if -2.35000000000000008e94 < t < 1.25e112Initial program 88.3%
sub-neg88.3%
+-commutative88.3%
distribute-frac-neg88.3%
distribute-rgt-neg-out88.3%
associate-/l*92.5%
fma-define92.7%
distribute-frac-neg92.7%
distribute-neg-frac292.7%
sub-neg92.7%
distribute-neg-in92.7%
remove-double-neg92.7%
+-commutative92.7%
sub-neg92.7%
Simplified92.7%
Final simplification93.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+84) (not (<= t 2.4e+113))) (+ (- x (* a (/ y t))) (* y (/ z t))) (+ (+ x y) (/ (* y (- z t)) (- t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+84) || !(t <= 2.4e+113)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((y * (z - t)) / (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.2d+84)) .or. (.not. (t <= 2.4d+113))) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else
tmp = (x + y) + ((y * (z - t)) / (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.2e+84) || !(t <= 2.4e+113)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((y * (z - t)) / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+84) or not (t <= 2.4e+113): tmp = (x - (a * (y / t))) + (y * (z / t)) else: tmp = (x + y) + ((y * (z - t)) / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+84) || !(t <= 2.4e+113)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(y * Float64(z - t)) / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e+84) || ~((t <= 2.4e+113))) tmp = (x - (a * (y / t))) + (y * (z / t)); else tmp = (x + y) + ((y * (z - t)) / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+84], N[Not[LessEqual[t, 2.4e+113]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+84} \lor \neg \left(t \leq 2.4 \cdot 10^{+113}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{y \cdot \left(z - t\right)}{t - a}\\
\end{array}
\end{array}
if t < -2.1999999999999998e84 or 2.39999999999999983e113 < t Initial program 47.8%
Taylor expanded in t around inf 78.6%
sub-neg78.6%
mul-1-neg78.6%
unsub-neg78.6%
associate-/l*84.9%
mul-1-neg84.9%
remove-double-neg84.9%
associate-/l*93.5%
Simplified93.5%
if -2.1999999999999998e84 < t < 2.39999999999999983e113Initial program 88.3%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.3e+84) (not (<= t 1.25e+111))) (+ (- x (* a (/ y t))) (* 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.3e+84) || !(t <= 1.25e+111)) {
tmp = (x - (a * (y / t))) + (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.3d+84)) .or. (.not. (t <= 1.25d+111))) then
tmp = (x - (a * (y / t))) + (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.3e+84) || !(t <= 1.25e+111)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.3e+84) or not (t <= 1.25e+111): tmp = (x - (a * (y / t))) + (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.3e+84) || !(t <= 1.25e+111)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + 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 <= -1.3e+84) || ~((t <= 1.25e+111))) tmp = (x - (a * (y / t))) + (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.3e+84], N[Not[LessEqual[t, 1.25e+111]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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 -1.3 \cdot 10^{+84} \lor \neg \left(t \leq 1.25 \cdot 10^{+111}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.3000000000000001e84 or 1.2499999999999999e111 < t Initial program 47.8%
Taylor expanded in t around inf 78.6%
sub-neg78.6%
mul-1-neg78.6%
unsub-neg78.6%
associate-/l*84.9%
mul-1-neg84.9%
remove-double-neg84.9%
associate-/l*93.5%
Simplified93.5%
if -1.3000000000000001e84 < t < 1.2499999999999999e111Initial program 88.3%
Taylor expanded in t around 0 77.3%
associate-/l*83.1%
Simplified83.1%
Final simplification86.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.8e+88)
(+ x (* y (/ z t)))
(if (<= t 2e+111)
(- (+ x y) (* y (/ z a)))
(- x (/ (- (* a y) (* y z)) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e+88) {
tmp = x + (y * (z / t));
} else if (t <= 2e+111) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - (((a * y) - (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 (t <= (-3.8d+88)) then
tmp = x + (y * (z / t))
else if (t <= 2d+111) then
tmp = (x + y) - (y * (z / a))
else
tmp = x - (((a * y) - (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 (t <= -3.8e+88) {
tmp = x + (y * (z / t));
} else if (t <= 2e+111) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - (((a * y) - (y * z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e+88: tmp = x + (y * (z / t)) elif t <= 2e+111: tmp = (x + y) - (y * (z / a)) else: tmp = x - (((a * y) - (y * z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e+88) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 2e+111) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x - Float64(Float64(Float64(a * y) - Float64(y * z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.8e+88) tmp = x + (y * (z / t)); elseif (t <= 2e+111) tmp = (x + y) - (y * (z / a)); else tmp = x - (((a * y) - (y * z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e+88], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+111], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(a * y), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+88}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+111}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a \cdot y - y \cdot z}{t}\\
\end{array}
\end{array}
if t < -3.7999999999999997e88Initial program 43.8%
Taylor expanded in t around -inf 71.6%
mul-1-neg71.6%
unsub-neg71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in a around 0 67.9%
associate-*r/83.2%
Simplified83.2%
if -3.7999999999999997e88 < t < 1.99999999999999991e111Initial program 88.3%
Taylor expanded in t around 0 77.3%
associate-/l*83.1%
Simplified83.1%
if 1.99999999999999991e111 < t Initial program 51.7%
Taylor expanded in t around -inf 85.3%
mul-1-neg85.3%
unsub-neg85.3%
*-commutative85.3%
Simplified85.3%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e+77) (not (<= t 14000000.0))) (+ 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 <= -6.5e+77) || !(t <= 14000000.0)) {
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 <= (-6.5d+77)) .or. (.not. (t <= 14000000.0d0))) 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 <= -6.5e+77) || !(t <= 14000000.0)) {
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 <= -6.5e+77) or not (t <= 14000000.0): 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 <= -6.5e+77) || !(t <= 14000000.0)) 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 <= -6.5e+77) || ~((t <= 14000000.0))) 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, -6.5e+77], N[Not[LessEqual[t, 14000000.0]], $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 -6.5 \cdot 10^{+77} \lor \neg \left(t \leq 14000000\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -6.5e77 or 1.4e7 < t Initial program 54.7%
Taylor expanded in t around -inf 74.5%
mul-1-neg74.5%
unsub-neg74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in a around 0 71.1%
associate-*r/77.3%
Simplified77.3%
if -6.5e77 < t < 1.4e7Initial program 92.0%
Taylor expanded in t around 0 83.4%
associate-/l*86.9%
Simplified86.9%
Final simplification82.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e+104) (not (<= a 2.4e-90))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e+104) || !(a <= 2.4e-90)) {
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.2d+104)) .or. (.not. (a <= 2.4d-90))) 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.2e+104) || !(a <= 2.4e-90)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e+104) or not (a <= 2.4e-90): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e+104) || !(a <= 2.4e-90)) 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.2e+104) || ~((a <= 2.4e-90))) 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.2e+104], N[Not[LessEqual[a, 2.4e-90]], $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.2 \cdot 10^{+104} \lor \neg \left(a \leq 2.4 \cdot 10^{-90}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -2.2e104 or 2.4000000000000002e-90 < a Initial program 76.1%
sub-neg76.1%
+-commutative76.1%
distribute-frac-neg76.1%
distribute-rgt-neg-out76.1%
associate-/l*88.0%
fma-define88.0%
distribute-frac-neg88.0%
distribute-neg-frac288.0%
sub-neg88.0%
distribute-neg-in88.0%
remove-double-neg88.0%
+-commutative88.0%
sub-neg88.0%
Simplified88.0%
Taylor expanded in a around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -2.2e104 < a < 2.4000000000000002e-90Initial program 72.2%
Taylor expanded in t around -inf 78.2%
mul-1-neg78.2%
unsub-neg78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in a around 0 73.2%
associate-*r/76.8%
Simplified76.8%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (<= z 2.25e+88) (+ x y) (* z (/ y (- t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 2.25e+88) {
tmp = x + y;
} else {
tmp = 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 (z <= 2.25d+88) then
tmp = x + y
else
tmp = 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 (z <= 2.25e+88) {
tmp = x + y;
} else {
tmp = z * (y / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 2.25e+88: tmp = x + y else: tmp = z * (y / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 2.25e+88) tmp = Float64(x + y); else tmp = Float64(z * Float64(y / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 2.25e+88) tmp = x + y; else tmp = z * (y / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 2.25e+88], N[(x + y), $MachinePrecision], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.25 \cdot 10^{+88}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < 2.25e88Initial program 75.2%
sub-neg75.2%
+-commutative75.2%
distribute-frac-neg75.2%
distribute-rgt-neg-out75.2%
associate-/l*78.3%
fma-define78.3%
distribute-frac-neg78.3%
distribute-neg-frac278.3%
sub-neg78.3%
distribute-neg-in78.3%
remove-double-neg78.3%
+-commutative78.3%
sub-neg78.3%
Simplified78.3%
Taylor expanded in a around inf 68.1%
+-commutative68.1%
Simplified68.1%
if 2.25e88 < z Initial program 69.1%
sub-neg69.1%
+-commutative69.1%
distribute-frac-neg69.1%
distribute-rgt-neg-out69.1%
associate-/l*85.3%
fma-define85.7%
distribute-frac-neg85.7%
distribute-neg-frac285.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
+-commutative85.7%
sub-neg85.7%
Simplified85.7%
Taylor expanded in z around inf 52.8%
*-commutative52.8%
*-lft-identity52.8%
times-frac67.1%
/-rgt-identity67.1%
Simplified67.1%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= z 1e+87) (+ x y) (* y (/ z (- t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1e+87) {
tmp = x + y;
} else {
tmp = y * (z / (t - a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1d+87) then
tmp = x + y
else
tmp = y * (z / (t - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1e+87) {
tmp = x + y;
} else {
tmp = y * (z / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1e+87: tmp = x + y else: tmp = y * (z / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1e+87) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1e+87) tmp = x + y; else tmp = y * (z / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1e+87], N[(x + y), $MachinePrecision], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{+87}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < 9.9999999999999996e86Initial program 75.2%
sub-neg75.2%
+-commutative75.2%
distribute-frac-neg75.2%
distribute-rgt-neg-out75.2%
associate-/l*78.3%
fma-define78.3%
distribute-frac-neg78.3%
distribute-neg-frac278.3%
sub-neg78.3%
distribute-neg-in78.3%
remove-double-neg78.3%
+-commutative78.3%
sub-neg78.3%
Simplified78.3%
Taylor expanded in a around inf 68.1%
+-commutative68.1%
Simplified68.1%
if 9.9999999999999996e86 < z Initial program 69.1%
sub-neg69.1%
+-commutative69.1%
distribute-frac-neg69.1%
distribute-rgt-neg-out69.1%
associate-/l*85.3%
fma-define85.7%
distribute-frac-neg85.7%
distribute-neg-frac285.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
+-commutative85.7%
sub-neg85.7%
Simplified85.7%
Taylor expanded in z around inf 52.8%
associate-/l*65.1%
Simplified65.1%
Final simplification67.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.8e+218) y (if (<= y 1.55e+169) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.8e+218) {
tmp = y;
} else if (y <= 1.55e+169) {
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 <= (-4.8d+218)) then
tmp = y
else if (y <= 1.55d+169) 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 <= -4.8e+218) {
tmp = y;
} else if (y <= 1.55e+169) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.8e+218: tmp = y elif y <= 1.55e+169: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.8e+218) tmp = y; elseif (y <= 1.55e+169) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.8e+218) tmp = y; elseif (y <= 1.55e+169) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.8e+218], y, If[LessEqual[y, 1.55e+169], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+218}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+169}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -4.79999999999999961e218 or 1.55e169 < y Initial program 54.2%
sub-neg54.2%
+-commutative54.2%
distribute-frac-neg54.2%
distribute-rgt-neg-out54.2%
associate-/l*66.7%
fma-define66.9%
distribute-frac-neg66.9%
distribute-neg-frac266.9%
sub-neg66.9%
distribute-neg-in66.9%
remove-double-neg66.9%
+-commutative66.9%
sub-neg66.9%
Simplified66.9%
Taylor expanded in a around inf 42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in y around inf 37.5%
if -4.79999999999999961e218 < y < 1.55e169Initial program 79.8%
Taylor expanded in t around 0 64.8%
associate-/l*66.2%
Simplified66.2%
Taylor expanded in x around inf 60.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.2e+90) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e+90) {
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 (t <= (-1.2d+90)) 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 (t <= -1.2e+90) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.2e+90: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e+90) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.2e+90) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e+90], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+90}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.20000000000000005e90Initial program 43.8%
Taylor expanded in t around 0 28.2%
associate-/l*24.3%
Simplified24.3%
Taylor expanded in x around inf 57.5%
if -1.20000000000000005e90 < t Initial program 80.4%
sub-neg80.4%
+-commutative80.4%
distribute-frac-neg80.4%
distribute-rgt-neg-out80.4%
associate-/l*85.9%
fma-define86.1%
distribute-frac-neg86.1%
distribute-neg-frac286.1%
sub-neg86.1%
distribute-neg-in86.1%
remove-double-neg86.1%
+-commutative86.1%
sub-neg86.1%
Simplified86.1%
Taylor expanded in a around inf 66.4%
+-commutative66.4%
Simplified66.4%
Final simplification64.9%
(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 74.1%
Taylor expanded in t around 0 62.3%
associate-/l*65.4%
Simplified65.4%
Taylor expanded in x around inf 49.5%
(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 2024163
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -13664970889390727/100000000000000000000000) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 14754293444577233/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)))))
(- (+ x y) (/ (* (- z t) y) (- a t))))