
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (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) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{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) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (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) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- t z) (- t a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / (t - a)));
}
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 * ((t - z) / (t - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / (t - a)));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / (t - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / Float64(t - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / (t - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{t - a}
\end{array}
Initial program 98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.45e+32)
x
(if (<= a -3.6e-164)
(+ x y)
(if (<= a -1.2e-277) (* y (/ z (- t))) (if (<= a 4.8e+167) (+ x y) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.45e+32) {
tmp = x;
} else if (a <= -3.6e-164) {
tmp = x + y;
} else if (a <= -1.2e-277) {
tmp = y * (z / -t);
} else if (a <= 4.8e+167) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.45d+32)) then
tmp = x
else if (a <= (-3.6d-164)) then
tmp = x + y
else if (a <= (-1.2d-277)) then
tmp = y * (z / -t)
else if (a <= 4.8d+167) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.45e+32) {
tmp = x;
} else if (a <= -3.6e-164) {
tmp = x + y;
} else if (a <= -1.2e-277) {
tmp = y * (z / -t);
} else if (a <= 4.8e+167) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.45e+32: tmp = x elif a <= -3.6e-164: tmp = x + y elif a <= -1.2e-277: tmp = y * (z / -t) elif a <= 4.8e+167: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.45e+32) tmp = x; elseif (a <= -3.6e-164) tmp = Float64(x + y); elseif (a <= -1.2e-277) tmp = Float64(y * Float64(z / Float64(-t))); elseif (a <= 4.8e+167) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.45e+32) tmp = x; elseif (a <= -3.6e-164) tmp = x + y; elseif (a <= -1.2e-277) tmp = y * (z / -t); elseif (a <= 4.8e+167) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.45e+32], x, If[LessEqual[a, -3.6e-164], N[(x + y), $MachinePrecision], If[LessEqual[a, -1.2e-277], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.8e+167], N[(x + y), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -3.6 \cdot 10^{-164}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -1.2 \cdot 10^{-277}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{+167}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.45000000000000001e32 or 4.79999999999999998e167 < a Initial program 97.8%
Taylor expanded in x around inf 72.4%
if -1.45000000000000001e32 < a < -3.59999999999999994e-164 or -1.2e-277 < a < 4.79999999999999998e167Initial program 99.9%
Taylor expanded in t around inf 66.3%
+-commutative66.3%
Simplified66.3%
if -3.59999999999999994e-164 < a < -1.2e-277Initial program 92.6%
Taylor expanded in a around 0 72.4%
mul-1-neg72.4%
unsub-neg72.4%
associate-/l*92.6%
div-sub92.6%
sub-neg92.6%
*-inverses92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in z around inf 49.0%
mul-1-neg49.0%
associate-/l*56.1%
distribute-rgt-neg-in56.1%
distribute-frac-neg56.1%
Simplified56.1%
Final simplification67.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.4e+65)
(+ x y)
(if (<= t 6.8e-46)
(+ x (* z (/ y a)))
(if (<= t 1.5e+138) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.4e+65) {
tmp = x + y;
} else if (t <= 6.8e-46) {
tmp = x + (z * (y / a));
} else if (t <= 1.5e+138) {
tmp = x - (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 (t <= (-7.4d+65)) then
tmp = x + y
else if (t <= 6.8d-46) then
tmp = x + (z * (y / a))
else if (t <= 1.5d+138) then
tmp = x - (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 (t <= -7.4e+65) {
tmp = x + y;
} else if (t <= 6.8e-46) {
tmp = x + (z * (y / a));
} else if (t <= 1.5e+138) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.4e+65: tmp = x + y elif t <= 6.8e-46: tmp = x + (z * (y / a)) elif t <= 1.5e+138: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.4e+65) tmp = Float64(x + y); elseif (t <= 6.8e-46) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= 1.5e+138) tmp = Float64(x - 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 (t <= -7.4e+65) tmp = x + y; elseif (t <= 6.8e-46) tmp = x + (z * (y / a)); elseif (t <= 1.5e+138) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.4e+65], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.8e-46], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+138], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{+65}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-46}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+138}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.39999999999999989e65 or 1.50000000000000005e138 < t Initial program 100.0%
Taylor expanded in t around inf 86.2%
+-commutative86.2%
Simplified86.2%
if -7.39999999999999989e65 < t < 6.79999999999999992e-46Initial program 97.2%
Taylor expanded in t around 0 74.9%
+-commutative74.9%
associate-/l*77.6%
Simplified77.6%
*-commutative77.6%
associate-*l/74.9%
Applied egg-rr74.9%
associate-/l*78.6%
*-commutative78.6%
Applied egg-rr78.6%
if 6.79999999999999992e-46 < t < 1.50000000000000005e138Initial program 99.9%
Taylor expanded in a around 0 78.0%
mul-1-neg78.0%
unsub-neg78.0%
associate-/l*86.1%
div-sub86.1%
sub-neg86.1%
*-inverses86.1%
metadata-eval86.1%
Simplified86.1%
Taylor expanded in z around inf 74.8%
associate-/l*77.6%
Simplified77.6%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.9e+79) (not (<= t 92000.0))) (- x (* y (+ (/ z t) -1.0))) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e+79) || !(t <= 92000.0)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x - (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 <= (-1.9d+79)) .or. (.not. (t <= 92000.0d0))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else
tmp = x - (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 <= -1.9e+79) || !(t <= 92000.0)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.9e+79) or not (t <= 92000.0): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e+79) || !(t <= 92000.0)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); else tmp = Float64(x - 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 <= -1.9e+79) || ~((t <= 92000.0))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.9e+79], N[Not[LessEqual[t, 92000.0]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+79} \lor \neg \left(t \leq 92000\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -1.9000000000000001e79 or 92000 < t Initial program 99.9%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*93.3%
div-sub93.3%
sub-neg93.3%
*-inverses93.3%
metadata-eval93.3%
Simplified93.3%
if -1.9000000000000001e79 < t < 92000Initial program 97.5%
Taylor expanded in z around inf 83.4%
associate-/l*88.2%
Simplified88.2%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.2e+149) (not (<= t 1.3e+134))) (+ x y) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.2e+149) || !(t <= 1.3e+134)) {
tmp = x + y;
} else {
tmp = x - (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 <= (-9.2d+149)) .or. (.not. (t <= 1.3d+134))) then
tmp = x + y
else
tmp = x - (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 <= -9.2e+149) || !(t <= 1.3e+134)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.2e+149) or not (t <= 1.3e+134): tmp = x + y else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.2e+149) || !(t <= 1.3e+134)) tmp = Float64(x + y); else tmp = Float64(x - 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 <= -9.2e+149) || ~((t <= 1.3e+134))) tmp = x + y; else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.2e+149], N[Not[LessEqual[t, 1.3e+134]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+149} \lor \neg \left(t \leq 1.3 \cdot 10^{+134}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -9.1999999999999993e149 or 1.3000000000000001e134 < t Initial program 100.0%
Taylor expanded in t around inf 88.6%
+-commutative88.6%
Simplified88.6%
if -9.1999999999999993e149 < t < 1.3000000000000001e134Initial program 98.0%
Taylor expanded in z around inf 82.1%
associate-/l*86.9%
Simplified86.9%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.15e+80) (+ x (/ y (/ t (- t z)))) (if (<= t 59000.0) (- x (* y (/ z (- t a)))) (- x (* y (+ (/ z t) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e+80) {
tmp = x + (y / (t / (t - z)));
} else if (t <= 59000.0) {
tmp = x - (y * (z / (t - a)));
} else {
tmp = x - (y * ((z / t) + -1.0));
}
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.15d+80)) then
tmp = x + (y / (t / (t - z)))
else if (t <= 59000.0d0) then
tmp = x - (y * (z / (t - a)))
else
tmp = x - (y * ((z / t) + (-1.0d0)))
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.15e+80) {
tmp = x + (y / (t / (t - z)));
} else if (t <= 59000.0) {
tmp = x - (y * (z / (t - a)));
} else {
tmp = x - (y * ((z / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e+80: tmp = x + (y / (t / (t - z))) elif t <= 59000.0: tmp = x - (y * (z / (t - a))) else: tmp = x - (y * ((z / t) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e+80) tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); elseif (t <= 59000.0) tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); else tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.15e+80) tmp = x + (y / (t / (t - z))); elseif (t <= 59000.0) tmp = x - (y * (z / (t - a))); else tmp = x - (y * ((z / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e+80], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 59000.0], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+80}:\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{elif}\;t \leq 59000:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\end{array}
\end{array}
if t < -1.15000000000000002e80Initial program 99.9%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 94.9%
neg-mul-194.9%
distribute-neg-frac294.9%
Simplified94.9%
if -1.15000000000000002e80 < t < 59000Initial program 97.5%
Taylor expanded in z around inf 83.4%
associate-/l*88.2%
Simplified88.2%
if 59000 < t Initial program 100.0%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*92.4%
div-sub92.4%
sub-neg92.4%
*-inverses92.4%
metadata-eval92.4%
Simplified92.4%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e+68) (not (<= t 1.6e-46))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e+68) || !(t <= 1.6e-46)) {
tmp = x + y;
} else {
tmp = x + (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 <= (-3d+68)) .or. (.not. (t <= 1.6d-46))) then
tmp = x + y
else
tmp = x + (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 <= -3e+68) || !(t <= 1.6e-46)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3e+68) or not (t <= 1.6e-46): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e+68) || !(t <= 1.6e-46)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3e+68) || ~((t <= 1.6e-46))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e+68], N[Not[LessEqual[t, 1.6e-46]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+68} \lor \neg \left(t \leq 1.6 \cdot 10^{-46}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.0000000000000002e68 or 1.6e-46 < t Initial program 100.0%
Taylor expanded in t around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -3.0000000000000002e68 < t < 1.6e-46Initial program 97.2%
Taylor expanded in t around 0 74.9%
+-commutative74.9%
associate-/l*77.6%
Simplified77.6%
*-commutative77.6%
associate-*l/74.9%
Applied egg-rr74.9%
associate-/l*78.6%
*-commutative78.6%
Applied egg-rr78.6%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8e+65) (not (<= t 4.6e-45))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e+65) || !(t <= 4.6e-45)) {
tmp = x + y;
} else {
tmp = x + (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 <= (-8d+65)) .or. (.not. (t <= 4.6d-45))) then
tmp = x + y
else
tmp = x + (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 <= -8e+65) || !(t <= 4.6e-45)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8e+65) or not (t <= 4.6e-45): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8e+65) || !(t <= 4.6e-45)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8e+65) || ~((t <= 4.6e-45))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8e+65], N[Not[LessEqual[t, 4.6e-45]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+65} \lor \neg \left(t \leq 4.6 \cdot 10^{-45}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -7.9999999999999999e65 or 4.59999999999999983e-45 < t Initial program 100.0%
Taylor expanded in t around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -7.9999999999999999e65 < t < 4.59999999999999983e-45Initial program 97.2%
Taylor expanded in t around 0 74.9%
+-commutative74.9%
associate-/l*77.6%
Simplified77.6%
Final simplification77.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2e-30) (not (<= t 4.6e-45))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e-30) || !(t <= 4.6e-45)) {
tmp = x + y;
} else {
tmp = x + ((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 <= (-2d-30)) .or. (.not. (t <= 4.6d-45))) then
tmp = x + y
else
tmp = x + ((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 <= -2e-30) || !(t <= 4.6e-45)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2e-30) or not (t <= 4.6e-45): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2e-30) || !(t <= 4.6e-45)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2e-30) || ~((t <= 4.6e-45))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2e-30], N[Not[LessEqual[t, 4.6e-45]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-30} \lor \neg \left(t \leq 4.6 \cdot 10^{-45}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2e-30 or 4.59999999999999983e-45 < t Initial program 99.9%
Taylor expanded in t around inf 77.0%
+-commutative77.0%
Simplified77.0%
if -2e-30 < t < 4.59999999999999983e-45Initial program 96.9%
Taylor expanded in t around 0 76.3%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.1e+31) x (if (<= a 7e+167) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.1e+31) {
tmp = x;
} else if (a <= 7e+167) {
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 <= (-3.1d+31)) then
tmp = x
else if (a <= 7d+167) 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 <= -3.1e+31) {
tmp = x;
} else if (a <= 7e+167) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.1e+31: tmp = x elif a <= 7e+167: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.1e+31) tmp = x; elseif (a <= 7e+167) 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 <= -3.1e+31) tmp = x; elseif (a <= 7e+167) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.1e+31], x, If[LessEqual[a, 7e+167], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+167}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.1000000000000002e31 or 6.99999999999999975e167 < a Initial program 97.8%
Taylor expanded in x around inf 72.4%
if -3.1000000000000002e31 < a < 6.99999999999999975e167Initial program 98.7%
Taylor expanded in t around inf 61.5%
+-commutative61.5%
Simplified61.5%
Final simplification65.4%
(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 98.4%
Taylor expanded in x around inf 54.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (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) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (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 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024091
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))