
(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 -1.8e+93) (not (<= t 2.7e+42))) (+ (- 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 <= -1.8e+93) || !(t <= 2.7e+42)) {
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 <= -1.8e+93) || !(t <= 2.7e+42)) 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, -1.8e+93], N[Not[LessEqual[t, 2.7e+42]], $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 -1.8 \cdot 10^{+93} \lor \neg \left(t \leq 2.7 \cdot 10^{+42}\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 < -1.8e93 or 2.7000000000000001e42 < t Initial program 53.1%
Taylor expanded in t around inf 73.4%
sub-neg73.4%
mul-1-neg73.4%
unsub-neg73.4%
associate-/l*76.5%
mul-1-neg76.5%
remove-double-neg76.5%
associate-/l*90.7%
Simplified90.7%
if -1.8e93 < t < 2.7000000000000001e42Initial program 90.4%
sub-neg90.4%
+-commutative90.4%
distribute-frac-neg90.4%
distribute-rgt-neg-out90.4%
associate-/l*93.5%
fma-define93.6%
distribute-frac-neg93.6%
distribute-neg-frac293.6%
sub-neg93.6%
distribute-neg-in93.6%
remove-double-neg93.6%
+-commutative93.6%
sub-neg93.6%
Simplified93.6%
Final simplification92.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+93) (not (<= t 4.2e+117))) (+ (- x (* a (/ y t))) (* 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 <= -9e+93) || !(t <= 4.2e+117)) {
tmp = (x - (a * (y / t))) + (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 <= (-9d+93)) .or. (.not. (t <= 4.2d+117))) then
tmp = (x - (a * (y / t))) + (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 <= -9e+93) || !(t <= 4.2e+117)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e+93) or not (t <= 4.2e+117): tmp = (x - (a * (y / t))) + (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 <= -9e+93) || !(t <= 4.2e+117)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + 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 <= -9e+93) || ~((t <= 4.2e+117))) tmp = (x - (a * (y / t))) + (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, -9e+93], N[Not[LessEqual[t, 4.2e+117]], $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 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+93} \lor \neg \left(t \leq 4.2 \cdot 10^{+117}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -8.99999999999999981e93 or 4.2000000000000002e117 < t Initial program 49.2%
Taylor expanded in t around inf 72.7%
sub-neg72.7%
mul-1-neg72.7%
unsub-neg72.7%
associate-/l*76.3%
mul-1-neg76.3%
remove-double-neg76.3%
associate-/l*92.9%
Simplified92.9%
if -8.99999999999999981e93 < t < 4.2000000000000002e117Initial program 89.4%
Taylor expanded in z around inf 88.1%
associate-/l*90.6%
Simplified90.6%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+167) (not (<= t 4.7e+169))) (+ 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 <= -9e+167) || !(t <= 4.7e+169)) {
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 <= (-9d+167)) .or. (.not. (t <= 4.7d+169))) 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 <= -9e+167) || !(t <= 4.7e+169)) {
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 <= -9e+167) or not (t <= 4.7e+169): 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 <= -9e+167) || !(t <= 4.7e+169)) 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 <= -9e+167) || ~((t <= 4.7e+169))) 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, -9e+167], N[Not[LessEqual[t, 4.7e+169]], $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 -9 \cdot 10^{+167} \lor \neg \left(t \leq 4.7 \cdot 10^{+169}\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 < -8.9999999999999998e167 or 4.6999999999999998e169 < t Initial program 38.5%
Taylor expanded in t around -inf 70.0%
mul-1-neg70.0%
unsub-neg70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in a around 0 62.0%
+-commutative62.0%
associate-/l*83.0%
Simplified83.0%
if -8.9999999999999998e167 < t < 4.6999999999999998e169Initial program 86.4%
Taylor expanded in z around inf 86.0%
associate-/l*89.1%
Simplified89.1%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.8e-78) (not (<= a 1.3e-23))) (- (+ x y) (* y (/ z a))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.8e-78) || !(a <= 1.3e-23)) {
tmp = (x + y) - (y * (z / a));
} 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 <= (-1.8d-78)) .or. (.not. (a <= 1.3d-23))) then
tmp = (x + y) - (y * (z / a))
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 <= -1.8e-78) || !(a <= 1.3e-23)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.8e-78) or not (a <= 1.3e-23): tmp = (x + y) - (y * (z / a)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.8e-78) || !(a <= 1.3e-23)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); 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 <= -1.8e-78) || ~((a <= 1.3e-23))) tmp = (x + y) - (y * (z / a)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.8e-78], N[Not[LessEqual[a, 1.3e-23]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-78} \lor \neg \left(a \leq 1.3 \cdot 10^{-23}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -1.8000000000000001e-78 or 1.3e-23 < a Initial program 80.7%
Taylor expanded in t around 0 79.2%
associate-/l*82.7%
Simplified82.7%
if -1.8000000000000001e-78 < a < 1.3e-23Initial program 72.5%
Taylor expanded in t around -inf 76.9%
mul-1-neg76.9%
unsub-neg76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in a around 0 69.7%
+-commutative69.7%
associate-/l*78.5%
Simplified78.5%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.4e-78) (not (<= a 2e+39))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.4e-78) || !(a <= 2e+39)) {
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 <= (-7.4d-78)) .or. (.not. (a <= 2d+39))) 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 <= -7.4e-78) || !(a <= 2e+39)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.4e-78) or not (a <= 2e+39): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.4e-78) || !(a <= 2e+39)) 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 <= -7.4e-78) || ~((a <= 2e+39))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.4e-78], N[Not[LessEqual[a, 2e+39]], $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 -7.4 \cdot 10^{-78} \lor \neg \left(a \leq 2 \cdot 10^{+39}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -7.40000000000000011e-78 or 1.99999999999999988e39 < a Initial program 82.0%
sub-neg82.0%
+-commutative82.0%
distribute-frac-neg82.0%
distribute-rgt-neg-out82.0%
associate-/l*89.0%
fma-define89.0%
distribute-frac-neg89.0%
distribute-neg-frac289.0%
sub-neg89.0%
distribute-neg-in89.0%
remove-double-neg89.0%
+-commutative89.0%
sub-neg89.0%
Simplified89.0%
Taylor expanded in a around inf 75.2%
+-commutative75.2%
Simplified75.2%
if -7.40000000000000011e-78 < a < 1.99999999999999988e39Initial program 72.2%
Taylor expanded in t around -inf 74.3%
mul-1-neg74.3%
unsub-neg74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in a around 0 67.4%
+-commutative67.4%
associate-/l*75.9%
Simplified75.9%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.5e+95) (not (<= y 2.5e+170))) (* y (/ (- z a) t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.5e+95) || !(y <= 2.5e+170)) {
tmp = y * ((z - a) / 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 ((y <= (-2.5d+95)) .or. (.not. (y <= 2.5d+170))) then
tmp = y * ((z - a) / 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 ((y <= -2.5e+95) || !(y <= 2.5e+170)) {
tmp = y * ((z - a) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.5e+95) or not (y <= 2.5e+170): tmp = y * ((z - a) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.5e+95) || !(y <= 2.5e+170)) tmp = Float64(y * Float64(Float64(z - a) / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.5e+95) || ~((y <= 2.5e+170))) tmp = y * ((z - a) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.5e+95], N[Not[LessEqual[y, 2.5e+170]], $MachinePrecision]], N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+95} \lor \neg \left(y \leq 2.5 \cdot 10^{+170}\right):\\
\;\;\;\;y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -2.50000000000000012e95 or 2.49999999999999988e170 < y Initial program 51.3%
Taylor expanded in t around -inf 54.8%
mul-1-neg54.8%
unsub-neg54.8%
*-commutative54.8%
Simplified54.8%
Taylor expanded in x around 0 48.1%
Taylor expanded in y around 0 60.2%
distribute-rgt-out--60.0%
associate-*l/48.0%
associate-*r/56.1%
associate-*l/53.7%
associate-*r/52.0%
distribute-rgt-out--57.7%
Simplified57.7%
Taylor expanded in y around 0 48.4%
associate-/l*60.3%
Simplified60.3%
if -2.50000000000000012e95 < y < 2.49999999999999988e170Initial program 87.7%
sub-neg87.7%
+-commutative87.7%
distribute-frac-neg87.7%
distribute-rgt-neg-out87.7%
associate-/l*89.7%
fma-define89.6%
distribute-frac-neg89.6%
distribute-neg-frac289.6%
sub-neg89.6%
distribute-neg-in89.6%
remove-double-neg89.6%
+-commutative89.6%
sub-neg89.6%
Simplified89.6%
Taylor expanded in a around inf 69.4%
+-commutative69.4%
Simplified69.4%
Final simplification66.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.3e+170) (not (<= z 7.5e+93))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+170) || !(z <= 7.5e+93)) {
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 <= (-2.3d+170)) .or. (.not. (z <= 7.5d+93))) 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 <= -2.3e+170) || !(z <= 7.5e+93)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e+170) or not (z <= 7.5e+93): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.3e+170) || !(z <= 7.5e+93)) 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 <= -2.3e+170) || ~((z <= 7.5e+93))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.3e+170], N[Not[LessEqual[z, 7.5e+93]], $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 -2.3 \cdot 10^{+170} \lor \neg \left(z \leq 7.5 \cdot 10^{+93}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.3000000000000001e170 or 7.5000000000000002e93 < z Initial program 67.5%
sub-neg67.5%
+-commutative67.5%
distribute-frac-neg67.5%
distribute-rgt-neg-out67.5%
associate-/l*83.1%
fma-define83.4%
distribute-frac-neg83.4%
distribute-neg-frac283.4%
sub-neg83.4%
distribute-neg-in83.4%
remove-double-neg83.4%
+-commutative83.4%
sub-neg83.4%
Simplified83.4%
Taylor expanded in z around inf 51.4%
associate-/l*68.4%
Simplified68.4%
if -2.3000000000000001e170 < z < 7.5000000000000002e93Initial program 80.0%
sub-neg80.0%
+-commutative80.0%
distribute-frac-neg80.0%
distribute-rgt-neg-out80.0%
associate-/l*82.2%
fma-define82.2%
distribute-frac-neg82.2%
distribute-neg-frac282.2%
sub-neg82.2%
distribute-neg-in82.2%
remove-double-neg82.2%
+-commutative82.2%
sub-neg82.2%
Simplified82.2%
Taylor expanded in a around inf 66.1%
+-commutative66.1%
Simplified66.1%
Final simplification66.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.32e+180) (not (<= y 7.4e+171))) (* y (/ z t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.32e+180) || !(y <= 7.4e+171)) {
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 ((y <= (-1.32d+180)) .or. (.not. (y <= 7.4d+171))) 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 ((y <= -1.32e+180) || !(y <= 7.4e+171)) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.32e+180) or not (y <= 7.4e+171): tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.32e+180) || !(y <= 7.4e+171)) 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 ((y <= -1.32e+180) || ~((y <= 7.4e+171))) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.32e+180], N[Not[LessEqual[y, 7.4e+171]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{+180} \lor \neg \left(y \leq 7.4 \cdot 10^{+171}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.31999999999999991e180 or 7.39999999999999996e171 < y Initial program 47.0%
sub-neg47.0%
+-commutative47.0%
distribute-frac-neg47.0%
distribute-rgt-neg-out47.0%
associate-/l*60.4%
fma-define60.8%
distribute-frac-neg60.8%
distribute-neg-frac260.8%
sub-neg60.8%
distribute-neg-in60.8%
remove-double-neg60.8%
+-commutative60.8%
sub-neg60.8%
Simplified60.8%
Taylor expanded in z around inf 38.8%
associate-/l*54.7%
Simplified54.7%
Taylor expanded in t around inf 33.6%
associate-/l*46.7%
Simplified46.7%
if -1.31999999999999991e180 < y < 7.39999999999999996e171Initial program 85.2%
sub-neg85.2%
+-commutative85.2%
distribute-frac-neg85.2%
distribute-rgt-neg-out85.2%
associate-/l*88.4%
fma-define88.4%
distribute-frac-neg88.4%
distribute-neg-frac288.4%
sub-neg88.4%
distribute-neg-in88.4%
remove-double-neg88.4%
+-commutative88.4%
sub-neg88.4%
Simplified88.4%
Taylor expanded in a around inf 66.8%
+-commutative66.8%
Simplified66.8%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.85e+210) x (if (<= t 3.9e+170) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.85e+210) {
tmp = x;
} else if (t <= 3.9e+170) {
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 (t <= (-1.85d+210)) then
tmp = x
else if (t <= 3.9d+170) 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 (t <= -1.85e+210) {
tmp = x;
} else if (t <= 3.9e+170) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.85e+210: tmp = x elif t <= 3.9e+170: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.85e+210) tmp = x; elseif (t <= 3.9e+170) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.85e+210) tmp = x; elseif (t <= 3.9e+170) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.85e+210], x, If[LessEqual[t, 3.9e+170], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+210}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+170}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.84999999999999999e210 or 3.9000000000000002e170 < t Initial program 34.8%
sub-neg34.8%
+-commutative34.8%
distribute-frac-neg34.8%
distribute-rgt-neg-out34.8%
associate-/l*46.7%
fma-define46.4%
distribute-frac-neg46.4%
distribute-neg-frac246.4%
sub-neg46.4%
distribute-neg-in46.4%
remove-double-neg46.4%
+-commutative46.4%
sub-neg46.4%
Simplified46.4%
Taylor expanded in t around inf 61.2%
distribute-rgt1-in61.2%
metadata-eval61.2%
mul0-lft61.2%
Simplified61.2%
Taylor expanded in x around 0 61.2%
if -1.84999999999999999e210 < t < 3.9000000000000002e170Initial program 85.3%
sub-neg85.3%
+-commutative85.3%
distribute-frac-neg85.3%
distribute-rgt-neg-out85.3%
associate-/l*89.4%
fma-define89.5%
distribute-frac-neg89.5%
distribute-neg-frac289.5%
sub-neg89.5%
distribute-neg-in89.5%
remove-double-neg89.5%
+-commutative89.5%
sub-neg89.5%
Simplified89.5%
Taylor expanded in a around inf 61.0%
+-commutative61.0%
Simplified61.0%
Final simplification61.0%
(FPCore (x y z t a) :precision binary64 (if (<= x -5.7e-60) x (if (<= x 1.2e-66) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.7e-60) {
tmp = x;
} else if (x <= 1.2e-66) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-5.7d-60)) then
tmp = x
else if (x <= 1.2d-66) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.7e-60) {
tmp = x;
} else if (x <= 1.2e-66) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -5.7e-60: tmp = x elif x <= 1.2e-66: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -5.7e-60) tmp = x; elseif (x <= 1.2e-66) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -5.7e-60) tmp = x; elseif (x <= 1.2e-66) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.7e-60], x, If[LessEqual[x, 1.2e-66], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.7 \cdot 10^{-60}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-66}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.70000000000000019e-60 or 1.20000000000000013e-66 < x Initial program 80.2%
sub-neg80.2%
+-commutative80.2%
distribute-frac-neg80.2%
distribute-rgt-neg-out80.2%
associate-/l*88.1%
fma-define88.2%
distribute-frac-neg88.2%
distribute-neg-frac288.2%
sub-neg88.2%
distribute-neg-in88.2%
remove-double-neg88.2%
+-commutative88.2%
sub-neg88.2%
Simplified88.2%
Taylor expanded in t around inf 65.2%
distribute-rgt1-in65.2%
metadata-eval65.2%
mul0-lft65.2%
Simplified65.2%
Taylor expanded in x around 0 65.2%
if -5.70000000000000019e-60 < x < 1.20000000000000013e-66Initial program 71.7%
sub-neg71.7%
+-commutative71.7%
distribute-frac-neg71.7%
distribute-rgt-neg-out71.7%
associate-/l*73.0%
fma-define72.8%
distribute-frac-neg72.8%
distribute-neg-frac272.8%
sub-neg72.8%
distribute-neg-in72.8%
remove-double-neg72.8%
+-commutative72.8%
sub-neg72.8%
Simplified72.8%
Taylor expanded in a around inf 42.0%
+-commutative42.0%
Simplified42.0%
Taylor expanded in y around inf 32.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.0%
sub-neg77.0%
+-commutative77.0%
distribute-frac-neg77.0%
distribute-rgt-neg-out77.0%
associate-/l*82.4%
fma-define82.5%
distribute-frac-neg82.5%
distribute-neg-frac282.5%
sub-neg82.5%
distribute-neg-in82.5%
remove-double-neg82.5%
+-commutative82.5%
sub-neg82.5%
Simplified82.5%
Taylor expanded in t around inf 46.7%
distribute-rgt1-in46.7%
metadata-eval46.7%
mul0-lft46.7%
Simplified46.7%
Taylor expanded in x around 0 46.7%
(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 2024181
(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))))