
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 98.4%
+-commutative98.4%
fma-define98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ t (- a z))))) (t_2 (+ x (* y (/ (- z t) z)))))
(if (<= z -9.2e+69)
t_2
(if (<= z -2.2e-63)
t_1
(if (<= z -2.9e-109)
t_2
(if (<= z -1.95e-151)
(- x (* t (/ y z)))
(if (<= z 1.52e-89) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (t / (a - z)));
double t_2 = x + (y * ((z - t) / z));
double tmp;
if (z <= -9.2e+69) {
tmp = t_2;
} else if (z <= -2.2e-63) {
tmp = t_1;
} else if (z <= -2.9e-109) {
tmp = t_2;
} else if (z <= -1.95e-151) {
tmp = x - (t * (y / z));
} else if (z <= 1.52e-89) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = x + (y * (t / (a - z)))
t_2 = x + (y * ((z - t) / z))
if (z <= (-9.2d+69)) then
tmp = t_2
else if (z <= (-2.2d-63)) then
tmp = t_1
else if (z <= (-2.9d-109)) then
tmp = t_2
else if (z <= (-1.95d-151)) then
tmp = x - (t * (y / z))
else if (z <= 1.52d-89) then
tmp = t_1
else
tmp = t_2
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 * (t / (a - z)));
double t_2 = x + (y * ((z - t) / z));
double tmp;
if (z <= -9.2e+69) {
tmp = t_2;
} else if (z <= -2.2e-63) {
tmp = t_1;
} else if (z <= -2.9e-109) {
tmp = t_2;
} else if (z <= -1.95e-151) {
tmp = x - (t * (y / z));
} else if (z <= 1.52e-89) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (t / (a - z))) t_2 = x + (y * ((z - t) / z)) tmp = 0 if z <= -9.2e+69: tmp = t_2 elif z <= -2.2e-63: tmp = t_1 elif z <= -2.9e-109: tmp = t_2 elif z <= -1.95e-151: tmp = x - (t * (y / z)) elif z <= 1.52e-89: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(t / Float64(a - z)))) t_2 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) tmp = 0.0 if (z <= -9.2e+69) tmp = t_2; elseif (z <= -2.2e-63) tmp = t_1; elseif (z <= -2.9e-109) tmp = t_2; elseif (z <= -1.95e-151) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.52e-89) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (t / (a - z))); t_2 = x + (y * ((z - t) / z)); tmp = 0.0; if (z <= -9.2e+69) tmp = t_2; elseif (z <= -2.2e-63) tmp = t_1; elseif (z <= -2.9e-109) tmp = t_2; elseif (z <= -1.95e-151) tmp = x - (t * (y / z)); elseif (z <= 1.52e-89) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+69], t$95$2, If[LessEqual[z, -2.2e-63], t$95$1, If[LessEqual[z, -2.9e-109], t$95$2, If[LessEqual[z, -1.95e-151], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.52e-89], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{t}{a - z}\\
t_2 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-109}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-151}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-89}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -9.20000000000000067e69 or -2.2e-63 < z < -2.9e-109 or 1.52e-89 < z Initial program 99.9%
Taylor expanded in a around 0 91.9%
if -9.20000000000000067e69 < z < -2.2e-63 or -1.95000000000000003e-151 < z < 1.52e-89Initial program 97.7%
Taylor expanded in t around inf 86.6%
associate-*r/86.6%
mul-1-neg86.6%
distribute-lft-neg-out86.6%
*-commutative86.6%
associate-/l*87.6%
distribute-neg-frac87.6%
distribute-neg-frac287.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Simplified87.6%
Taylor expanded in t around 0 87.6%
if -2.9e-109 < z < -1.95000000000000003e-151Initial program 82.9%
Taylor expanded in t around inf 83.3%
associate-*r/83.3%
mul-1-neg83.3%
distribute-lft-neg-out83.3%
*-commutative83.3%
associate-/l*74.8%
distribute-neg-frac74.8%
distribute-neg-frac274.8%
sub-neg74.8%
distribute-neg-in74.8%
remove-double-neg74.8%
Simplified74.8%
Taylor expanded in z around inf 83.3%
mul-1-neg83.3%
unsub-neg83.3%
associate-/l*83.3%
Simplified83.3%
Final simplification90.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y z)))))
(if (<= t -2.9e+53)
t_1
(if (<= t 3.8e+20)
(+ y x)
(if (<= t 7e+207)
(+ x (/ y (/ a t)))
(if (<= t 1.02e+291) t_1 (+ x (/ (* y t) a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (t <= -2.9e+53) {
tmp = t_1;
} else if (t <= 3.8e+20) {
tmp = y + x;
} else if (t <= 7e+207) {
tmp = x + (y / (a / t));
} else if (t <= 1.02e+291) {
tmp = t_1;
} else {
tmp = x + ((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) :: t_1
real(8) :: tmp
t_1 = x - (t * (y / z))
if (t <= (-2.9d+53)) then
tmp = t_1
else if (t <= 3.8d+20) then
tmp = y + x
else if (t <= 7d+207) then
tmp = x + (y / (a / t))
else if (t <= 1.02d+291) then
tmp = t_1
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (t <= -2.9e+53) {
tmp = t_1;
} else if (t <= 3.8e+20) {
tmp = y + x;
} else if (t <= 7e+207) {
tmp = x + (y / (a / t));
} else if (t <= 1.02e+291) {
tmp = t_1;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / z)) tmp = 0 if t <= -2.9e+53: tmp = t_1 elif t <= 3.8e+20: tmp = y + x elif t <= 7e+207: tmp = x + (y / (a / t)) elif t <= 1.02e+291: tmp = t_1 else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / z))) tmp = 0.0 if (t <= -2.9e+53) tmp = t_1; elseif (t <= 3.8e+20) tmp = Float64(y + x); elseif (t <= 7e+207) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (t <= 1.02e+291) tmp = t_1; else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / z)); tmp = 0.0; if (t <= -2.9e+53) tmp = t_1; elseif (t <= 3.8e+20) tmp = y + x; elseif (t <= 7e+207) tmp = x + (y / (a / t)); elseif (t <= 1.02e+291) tmp = t_1; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e+53], t$95$1, If[LessEqual[t, 3.8e+20], N[(y + x), $MachinePrecision], If[LessEqual[t, 7e+207], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+291], t$95$1, N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{z}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+20}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+207}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+291}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -2.9000000000000002e53 or 7.00000000000000056e207 < t < 1.02000000000000005e291Initial program 97.3%
Taylor expanded in t around inf 82.8%
associate-*r/82.8%
mul-1-neg82.8%
distribute-lft-neg-out82.8%
*-commutative82.8%
associate-/l*90.7%
distribute-neg-frac90.7%
distribute-neg-frac290.7%
sub-neg90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
Simplified90.7%
Taylor expanded in z around inf 68.1%
mul-1-neg68.1%
unsub-neg68.1%
associate-/l*73.4%
Simplified73.4%
if -2.9000000000000002e53 < t < 3.8e20Initial program 99.2%
Taylor expanded in z around inf 80.2%
+-commutative80.2%
Simplified80.2%
if 3.8e20 < t < 7.00000000000000056e207Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 80.6%
if 1.02000000000000005e291 < t Initial program 76.4%
Taylor expanded in z around 0 100.0%
Final simplification78.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2e+53)
(- x (/ y (/ z t)))
(if (<= t 9e+17)
(+ y x)
(if (<= t 5e+205)
(+ x (/ y (/ a t)))
(if (<= t 6.7e+280) (- x (* t (/ y z))) (+ x (/ (* y t) a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e+53) {
tmp = x - (y / (z / t));
} else if (t <= 9e+17) {
tmp = y + x;
} else if (t <= 5e+205) {
tmp = x + (y / (a / t));
} else if (t <= 6.7e+280) {
tmp = x - (t * (y / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2d+53)) then
tmp = x - (y / (z / t))
else if (t <= 9d+17) then
tmp = y + x
else if (t <= 5d+205) then
tmp = x + (y / (a / t))
else if (t <= 6.7d+280) then
tmp = x - (t * (y / z))
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e+53) {
tmp = x - (y / (z / t));
} else if (t <= 9e+17) {
tmp = y + x;
} else if (t <= 5e+205) {
tmp = x + (y / (a / t));
} else if (t <= 6.7e+280) {
tmp = x - (t * (y / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2e+53: tmp = x - (y / (z / t)) elif t <= 9e+17: tmp = y + x elif t <= 5e+205: tmp = x + (y / (a / t)) elif t <= 6.7e+280: tmp = x - (t * (y / z)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2e+53) tmp = Float64(x - Float64(y / Float64(z / t))); elseif (t <= 9e+17) tmp = Float64(y + x); elseif (t <= 5e+205) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (t <= 6.7e+280) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2e+53) tmp = x - (y / (z / t)); elseif (t <= 9e+17) tmp = y + x; elseif (t <= 5e+205) tmp = x + (y / (a / t)); elseif (t <= 6.7e+280) tmp = x - (t * (y / z)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2e+53], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+17], N[(y + x), $MachinePrecision], If[LessEqual[t, 5e+205], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.7e+280], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+53}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+17}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+205}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq 6.7 \cdot 10^{+280}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -2e53Initial program 98.1%
Taylor expanded in t around inf 83.9%
associate-*r/83.9%
mul-1-neg83.9%
distribute-lft-neg-out83.9%
*-commutative83.9%
associate-/l*91.0%
distribute-neg-frac91.0%
distribute-neg-frac291.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
Simplified91.0%
Taylor expanded in z around inf 72.8%
associate-*r/72.8%
neg-mul-172.8%
Simplified72.8%
*-commutative72.8%
add-sqr-sqrt72.8%
sqrt-unprod39.9%
sqr-neg39.9%
sqrt-unprod0.0%
add-sqr-sqrt31.9%
cancel-sign-sub31.9%
distribute-frac-neg31.9%
*-commutative31.9%
add-sqr-sqrt31.9%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod0.0%
add-sqr-sqrt72.8%
Applied egg-rr72.8%
clear-num72.7%
un-div-inv72.8%
Applied egg-rr72.8%
if -2e53 < t < 9e17Initial program 99.2%
Taylor expanded in z around inf 80.2%
+-commutative80.2%
Simplified80.2%
if 9e17 < t < 5.0000000000000002e205Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 80.6%
if 5.0000000000000002e205 < t < 6.6999999999999999e280Initial program 94.9%
Taylor expanded in t around inf 79.8%
associate-*r/79.8%
mul-1-neg79.8%
distribute-lft-neg-out79.8%
*-commutative79.8%
associate-/l*90.1%
distribute-neg-frac90.1%
distribute-neg-frac290.1%
sub-neg90.1%
distribute-neg-in90.1%
remove-double-neg90.1%
Simplified90.1%
Taylor expanded in z around inf 64.9%
mul-1-neg64.9%
unsub-neg64.9%
associate-/l*74.9%
Simplified74.9%
if 6.6999999999999999e280 < t Initial program 76.4%
Taylor expanded in z around 0 100.0%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.55e+116) (not (<= z 8.7e+102))) (+ y x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e+116) || !(z <= 8.7e+102)) {
tmp = y + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.55d+116)) .or. (.not. (z <= 8.7d+102))) then
tmp = y + x
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e+116) || !(z <= 8.7e+102)) {
tmp = y + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.55e+116) or not (z <= 8.7e+102): tmp = y + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.55e+116) || !(z <= 8.7e+102)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.55e+116) || ~((z <= 8.7e+102))) tmp = y + x; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.55e+116], N[Not[LessEqual[z, 8.7e+102]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+116} \lor \neg \left(z \leq 8.7 \cdot 10^{+102}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.54999999999999998e116 or 8.69999999999999974e102 < z Initial program 100.0%
Taylor expanded in z around inf 91.7%
+-commutative91.7%
Simplified91.7%
if -1.54999999999999998e116 < z < 8.69999999999999974e102Initial program 97.5%
Taylor expanded in t around inf 80.4%
associate-*r/80.4%
mul-1-neg80.4%
distribute-lft-neg-out80.4%
*-commutative80.4%
associate-/l*80.9%
distribute-neg-frac80.9%
distribute-neg-frac280.9%
sub-neg80.9%
distribute-neg-in80.9%
remove-double-neg80.9%
Simplified80.9%
Taylor expanded in t around 0 80.9%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.05e+28) (not (<= t 3.4e+84))) (+ x (* y (/ t (- a z)))) (+ x (* z (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e+28) || !(t <= 3.4e+84)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (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 <= (-2.05d+28)) .or. (.not. (t <= 3.4d+84))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (z * (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 <= -2.05e+28) || !(t <= 3.4e+84)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.05e+28) or not (t <= 3.4e+84): tmp = x + (y * (t / (a - z))) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.05e+28) || !(t <= 3.4e+84)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.05e+28) || ~((t <= 3.4e+84))) tmp = x + (y * (t / (a - z))); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.05e+28], N[Not[LessEqual[t, 3.4e+84]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+28} \lor \neg \left(t \leq 3.4 \cdot 10^{+84}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -2.0499999999999999e28 or 3.3999999999999998e84 < t Initial program 97.3%
Taylor expanded in t around inf 85.4%
associate-*r/85.4%
mul-1-neg85.4%
distribute-lft-neg-out85.4%
*-commutative85.4%
associate-/l*90.4%
distribute-neg-frac90.4%
distribute-neg-frac290.4%
sub-neg90.4%
distribute-neg-in90.4%
remove-double-neg90.4%
Simplified90.4%
Taylor expanded in t around 0 90.4%
if -2.0499999999999999e28 < t < 3.3999999999999998e84Initial program 99.3%
clear-num98.6%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in t around 0 80.1%
associate-*l/87.4%
*-commutative87.4%
Simplified87.4%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.06e+22) (not (<= t 2.8e+75))) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.06e+22) || !(t <= 2.8e+75)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (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.06d+22)) .or. (.not. (t <= 2.8d+75))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (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.06e+22) || !(t <= 2.8e+75)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.06e+22) or not (t <= 2.8e+75): tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.06e+22) || !(t <= 2.8e+75)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.06e+22) || ~((t <= 2.8e+75))) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.06e+22], N[Not[LessEqual[t, 2.8e+75]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.06 \cdot 10^{+22} \lor \neg \left(t \leq 2.8 \cdot 10^{+75}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -1.06e22 or 2.80000000000000012e75 < t Initial program 97.4%
Taylor expanded in t around inf 85.2%
associate-*r/85.2%
mul-1-neg85.2%
distribute-lft-neg-out85.2%
*-commutative85.2%
associate-/l*90.0%
distribute-neg-frac90.0%
distribute-neg-frac290.0%
sub-neg90.0%
distribute-neg-in90.0%
remove-double-neg90.0%
Simplified90.0%
Taylor expanded in t around 0 90.0%
if -1.06e22 < t < 2.80000000000000012e75Initial program 99.2%
Taylor expanded in t around 0 80.8%
+-commutative80.8%
associate-/l*92.2%
Simplified92.2%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+26) (not (<= z 3.1e-144))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+26) || !(z <= 3.1e-144)) {
tmp = y + x;
} else {
tmp = x + (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 <= (-4.8d+26)) .or. (.not. (z <= 3.1d-144))) then
tmp = y + x
else
tmp = x + (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 <= -4.8e+26) || !(z <= 3.1e-144)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+26) or not (z <= 3.1e-144): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+26) || !(z <= 3.1e-144)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e+26) || ~((z <= 3.1e-144))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+26], N[Not[LessEqual[z, 3.1e-144]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+26} \lor \neg \left(z \leq 3.1 \cdot 10^{-144}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.80000000000000009e26 or 3.1000000000000001e-144 < z Initial program 99.9%
Taylor expanded in z around inf 78.5%
+-commutative78.5%
Simplified78.5%
if -4.80000000000000009e26 < z < 3.1000000000000001e-144Initial program 96.0%
Taylor expanded in z around 0 73.3%
*-commutative73.3%
associate-/l*73.2%
Simplified73.2%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e+23) (not (<= z 4.2e-144))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+23) || !(z <= 4.2e-144)) {
tmp = y + x;
} else {
tmp = x + (y / (a / 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 ((z <= (-8.5d+23)) .or. (.not. (z <= 4.2d-144))) then
tmp = y + x
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+23) || !(z <= 4.2e-144)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e+23) or not (z <= 4.2e-144): tmp = y + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e+23) || !(z <= 4.2e-144)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.5e+23) || ~((z <= 4.2e-144))) tmp = y + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e+23], N[Not[LessEqual[z, 4.2e-144]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+23} \lor \neg \left(z \leq 4.2 \cdot 10^{-144}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -8.5000000000000001e23 or 4.2000000000000002e-144 < z Initial program 99.9%
Taylor expanded in z around inf 78.5%
+-commutative78.5%
Simplified78.5%
if -8.5000000000000001e23 < z < 4.2000000000000002e-144Initial program 96.0%
clear-num96.0%
un-div-inv96.0%
Applied egg-rr96.0%
Taylor expanded in z around 0 73.2%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+25) (not (<= z 3.2e-168))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+25) || !(z <= 3.2e-168)) {
tmp = y + x;
} else {
tmp = x + ((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 <= (-1.9d+25)) .or. (.not. (z <= 3.2d-168))) then
tmp = y + x
else
tmp = x + ((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 <= -1.9e+25) || !(z <= 3.2e-168)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+25) or not (z <= 3.2e-168): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+25) || !(z <= 3.2e-168)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+25) || ~((z <= 3.2e-168))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+25], N[Not[LessEqual[z, 3.2e-168]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+25} \lor \neg \left(z \leq 3.2 \cdot 10^{-168}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.9e25 or 3.20000000000000006e-168 < z Initial program 99.9%
Taylor expanded in z around inf 78.3%
+-commutative78.3%
Simplified78.3%
if -1.9e25 < z < 3.20000000000000006e-168Initial program 95.9%
Taylor expanded in z around 0 74.5%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.9e+162) x (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.9e+162) {
tmp = x;
} else {
tmp = y + 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 <= (-2.9d+162)) then
tmp = x
else
tmp = y + 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 <= -2.9e+162) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.9e+162: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.9e+162) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.9e+162) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.9e+162], x, N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{+162}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.90000000000000006e162Initial program 99.9%
Taylor expanded in x around inf 71.1%
if -2.90000000000000006e162 < a Initial program 98.2%
Taylor expanded in z around inf 67.6%
+-commutative67.6%
Simplified67.6%
Final simplification67.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 98.4%
Taylor expanded in x around inf 49.5%
Final simplification49.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - 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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024095
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))