
(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 13 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 (/ (- 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}
Initial program 98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.5e+95)
(+ x y)
(if (<= t -1.4e-114)
(- x (* y (/ z t)))
(if (<= t 3.5e+66) (+ x (/ (* y z) a)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e+95) {
tmp = x + y;
} else if (t <= -1.4e-114) {
tmp = x - (y * (z / t));
} else if (t <= 3.5e+66) {
tmp = x + ((y * z) / 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 (t <= (-8.5d+95)) then
tmp = x + y
else if (t <= (-1.4d-114)) then
tmp = x - (y * (z / t))
else if (t <= 3.5d+66) then
tmp = x + ((y * z) / 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 (t <= -8.5e+95) {
tmp = x + y;
} else if (t <= -1.4e-114) {
tmp = x - (y * (z / t));
} else if (t <= 3.5e+66) {
tmp = x + ((y * z) / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.5e+95: tmp = x + y elif t <= -1.4e-114: tmp = x - (y * (z / t)) elif t <= 3.5e+66: tmp = x + ((y * z) / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.5e+95) tmp = Float64(x + y); elseif (t <= -1.4e-114) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 3.5e+66) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.5e+95) tmp = x + y; elseif (t <= -1.4e-114) tmp = x - (y * (z / t)); elseif (t <= 3.5e+66) tmp = x + ((y * z) / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.5e+95], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.4e-114], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+66], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+95}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-114}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+66}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -8.5000000000000002e95 or 3.4999999999999997e66 < t Initial program 99.9%
Taylor expanded in t around inf 82.9%
if -8.5000000000000002e95 < t < -1.4000000000000001e-114Initial program 97.8%
Taylor expanded in z around inf 91.1%
Taylor expanded in a around 0 72.1%
mul-1-neg72.1%
associate-/l*70.1%
unsub-neg70.1%
associate-/l*72.1%
associate-*r/70.1%
Simplified70.1%
if -1.4000000000000001e-114 < t < 3.4999999999999997e66Initial program 96.4%
Taylor expanded in t around 0 79.2%
Final simplification79.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.02e+96)
(+ x y)
(if (<= t -6.2e-115)
(- x (/ (* y z) t))
(if (<= t 3.5e+66) (+ x (/ (* y z) a)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.02e+96) {
tmp = x + y;
} else if (t <= -6.2e-115) {
tmp = x - ((y * z) / t);
} else if (t <= 3.5e+66) {
tmp = x + ((y * z) / 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 (t <= (-1.02d+96)) then
tmp = x + y
else if (t <= (-6.2d-115)) then
tmp = x - ((y * z) / t)
else if (t <= 3.5d+66) then
tmp = x + ((y * z) / 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 (t <= -1.02e+96) {
tmp = x + y;
} else if (t <= -6.2e-115) {
tmp = x - ((y * z) / t);
} else if (t <= 3.5e+66) {
tmp = x + ((y * z) / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.02e+96: tmp = x + y elif t <= -6.2e-115: tmp = x - ((y * z) / t) elif t <= 3.5e+66: tmp = x + ((y * z) / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.02e+96) tmp = Float64(x + y); elseif (t <= -6.2e-115) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (t <= 3.5e+66) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.02e+96) tmp = x + y; elseif (t <= -6.2e-115) tmp = x - ((y * z) / t); elseif (t <= 3.5e+66) tmp = x + ((y * z) / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.02e+96], N[(x + y), $MachinePrecision], If[LessEqual[t, -6.2e-115], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+66], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+96}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -6.2 \cdot 10^{-115}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+66}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.02000000000000001e96 or 3.4999999999999997e66 < t Initial program 99.9%
Taylor expanded in t around inf 82.9%
if -1.02000000000000001e96 < t < -6.20000000000000013e-115Initial program 97.8%
Taylor expanded in z around inf 87.1%
associate-/l*91.2%
Simplified91.2%
Taylor expanded in a around 0 72.1%
+-commutative72.1%
associate-*r/72.1%
neg-mul-172.1%
distribute-rgt-neg-in72.1%
Simplified72.1%
if -6.20000000000000013e-115 < t < 3.4999999999999997e66Initial program 96.4%
Taylor expanded in t around 0 79.2%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5e+96) (not (<= t 2.8e+201))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5e+96) || !(t <= 2.8e+201)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (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 ((t <= (-5d+96)) .or. (.not. (t <= 2.8d+201))) then
tmp = x + y
else
tmp = x + (y * (z / (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 ((t <= -5e+96) || !(t <= 2.8e+201)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5e+96) or not (t <= 2.8e+201): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5e+96) || !(t <= 2.8e+201)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5e+96) || ~((t <= 2.8e+201))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5e+96], N[Not[LessEqual[t, 2.8e+201]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+96} \lor \neg \left(t \leq 2.8 \cdot 10^{+201}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -5.0000000000000004e96 or 2.80000000000000005e201 < t Initial program 99.9%
Taylor expanded in t around inf 86.3%
if -5.0000000000000004e96 < t < 2.80000000000000005e201Initial program 97.3%
Taylor expanded in z around inf 88.9%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e+95) (not (<= t 4.8e+82))) (+ x (* y (/ t (- t a)))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e+95) || !(t <= 4.8e+82)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y * (z / (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 ((t <= (-2.4d+95)) .or. (.not. (t <= 4.8d+82))) then
tmp = x + (y * (t / (t - a)))
else
tmp = x + (y * (z / (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 ((t <= -2.4e+95) || !(t <= 4.8e+82)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e+95) or not (t <= 4.8e+82): tmp = x + (y * (t / (t - a))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e+95) || !(t <= 4.8e+82)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.4e+95) || ~((t <= 4.8e+82))) tmp = x + (y * (t / (t - a))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e+95], N[Not[LessEqual[t, 4.8e+82]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+95} \lor \neg \left(t \leq 4.8 \cdot 10^{+82}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.4e95 or 4.79999999999999996e82 < t Initial program 99.9%
Taylor expanded in z around 0 89.4%
neg-mul-189.4%
distribute-neg-frac89.4%
Simplified89.4%
*-commutative89.4%
div-inv89.4%
associate-*l*84.4%
add-sqr-sqrt44.8%
sqrt-unprod26.3%
sqr-neg26.3%
sqrt-unprod27.3%
add-sqr-sqrt54.9%
associate-/r/54.9%
div-inv54.9%
frac-2neg54.9%
add-sqr-sqrt27.6%
sqrt-unprod25.5%
sqr-neg25.5%
sqrt-unprod39.3%
add-sqr-sqrt84.4%
distribute-neg-frac84.4%
sub-neg84.4%
distribute-neg-in84.4%
remove-double-neg84.4%
Applied egg-rr84.4%
associate-/r/89.4%
+-commutative89.4%
unsub-neg89.4%
Simplified89.4%
if -2.4e95 < t < 4.79999999999999996e82Initial program 96.8%
Taylor expanded in z around inf 90.4%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e+95) (not (<= t 5.4e+81))) (+ x (* y (/ t (- t a)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e+95) || !(t <= 5.4e+81)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (z * (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 ((t <= (-2.7d+95)) .or. (.not. (t <= 5.4d+81))) then
tmp = x + (y * (t / (t - a)))
else
tmp = x + (z * (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 ((t <= -2.7e+95) || !(t <= 5.4e+81)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e+95) or not (t <= 5.4e+81): tmp = x + (y * (t / (t - a))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e+95) || !(t <= 5.4e+81)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.7e+95) || ~((t <= 5.4e+81))) tmp = x + (y * (t / (t - a))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e+95], N[Not[LessEqual[t, 5.4e+81]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+95} \lor \neg \left(t \leq 5.4 \cdot 10^{+81}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.7e95 or 5.3999999999999999e81 < t Initial program 99.9%
Taylor expanded in z around 0 89.4%
neg-mul-189.4%
distribute-neg-frac89.4%
Simplified89.4%
*-commutative89.4%
div-inv89.4%
associate-*l*84.4%
add-sqr-sqrt44.8%
sqrt-unprod26.3%
sqr-neg26.3%
sqrt-unprod27.3%
add-sqr-sqrt54.9%
associate-/r/54.9%
div-inv54.9%
frac-2neg54.9%
add-sqr-sqrt27.6%
sqrt-unprod25.5%
sqr-neg25.5%
sqrt-unprod39.3%
add-sqr-sqrt84.4%
distribute-neg-frac84.4%
sub-neg84.4%
distribute-neg-in84.4%
remove-double-neg84.4%
Applied egg-rr84.4%
associate-/r/89.4%
+-commutative89.4%
unsub-neg89.4%
Simplified89.4%
if -2.7e95 < t < 5.3999999999999999e81Initial program 96.8%
Taylor expanded in z around inf 89.5%
associate-/l*91.0%
Simplified91.0%
associate-/r/90.8%
Applied egg-rr90.8%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+95) (not (<= t 3.3e+81))) (+ x (* y (/ t (- t a)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+95) || !(t <= 3.3e+81)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.05d+95)) .or. (.not. (t <= 3.3d+81))) then
tmp = x + (y * (t / (t - a)))
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+95) || !(t <= 3.3e+81)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+95) or not (t <= 3.3e+81): tmp = x + (y * (t / (t - a))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+95) || !(t <= 3.3e+81)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+95) || ~((t <= 3.3e+81))) tmp = x + (y * (t / (t - a))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+95], N[Not[LessEqual[t, 3.3e+81]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+95} \lor \neg \left(t \leq 3.3 \cdot 10^{+81}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.05e95 or 3.3e81 < t Initial program 99.9%
Taylor expanded in z around 0 89.4%
neg-mul-189.4%
distribute-neg-frac89.4%
Simplified89.4%
*-commutative89.4%
div-inv89.4%
associate-*l*84.4%
add-sqr-sqrt44.8%
sqrt-unprod26.3%
sqr-neg26.3%
sqrt-unprod27.3%
add-sqr-sqrt54.9%
associate-/r/54.9%
div-inv54.9%
frac-2neg54.9%
add-sqr-sqrt27.6%
sqrt-unprod25.5%
sqr-neg25.5%
sqrt-unprod39.3%
add-sqr-sqrt84.4%
distribute-neg-frac84.4%
sub-neg84.4%
distribute-neg-in84.4%
remove-double-neg84.4%
Applied egg-rr84.4%
associate-/r/89.4%
+-commutative89.4%
unsub-neg89.4%
Simplified89.4%
if -1.05e95 < t < 3.3e81Initial program 96.8%
Taylor expanded in z around inf 89.5%
associate-/l*91.0%
Simplified91.0%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.15e+95) (not (<= t 3.5e+101))) (+ x (* y (/ (- t z) t))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.15e+95) || !(t <= 3.5e+101)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.15d+95)) .or. (.not. (t <= 3.5d+101))) then
tmp = x + (y * ((t - z) / t))
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.15e+95) || !(t <= 3.5e+101)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.15e+95) or not (t <= 3.5e+101): tmp = x + (y * ((t - z) / t)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.15e+95) || !(t <= 3.5e+101)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.15e+95) || ~((t <= 3.5e+101))) tmp = x + (y * ((t - z) / t)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.15e+95], N[Not[LessEqual[t, 3.5e+101]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+95} \lor \neg \left(t \leq 3.5 \cdot 10^{+101}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -2.15e95 or 3.50000000000000023e101 < t Initial program 99.9%
Taylor expanded in a around 0 95.1%
associate-*r/95.1%
neg-mul-195.1%
Simplified95.1%
if -2.15e95 < t < 3.50000000000000023e101Initial program 96.9%
Taylor expanded in z around inf 88.6%
associate-/l*90.1%
Simplified90.1%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+56) (not (<= t 1.42e+67))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+56) || !(t <= 1.42e+67)) {
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 <= (-1.05d+56)) .or. (.not. (t <= 1.42d+67))) 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 <= -1.05e+56) || !(t <= 1.42e+67)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+56) or not (t <= 1.42e+67): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+56) || !(t <= 1.42e+67)) 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 <= -1.05e+56) || ~((t <= 1.42e+67))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+56], N[Not[LessEqual[t, 1.42e+67]], $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 -1.05 \cdot 10^{+56} \lor \neg \left(t \leq 1.42 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.05000000000000009e56 or 1.41999999999999992e67 < t Initial program 99.9%
Taylor expanded in t around inf 81.6%
if -1.05000000000000009e56 < t < 1.41999999999999992e67Initial program 96.6%
Taylor expanded in t around 0 73.1%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.65e+56) (not (<= t 3.5e+66))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.65e+56) || !(t <= 3.5e+66)) {
tmp = x + y;
} else {
tmp = x + (y / (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 ((t <= (-1.65d+56)) .or. (.not. (t <= 3.5d+66))) then
tmp = x + y
else
tmp = x + (y / (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 ((t <= -1.65e+56) || !(t <= 3.5e+66)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.65e+56) or not (t <= 3.5e+66): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.65e+56) || !(t <= 3.5e+66)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.65e+56) || ~((t <= 3.5e+66))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.65e+56], N[Not[LessEqual[t, 3.5e+66]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+56} \lor \neg \left(t \leq 3.5 \cdot 10^{+66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.65000000000000001e56 or 3.4999999999999997e66 < t Initial program 99.9%
Taylor expanded in t around inf 81.6%
if -1.65000000000000001e56 < t < 3.4999999999999997e66Initial program 96.6%
Taylor expanded in t around 0 73.6%
associate-/l*73.4%
Simplified73.4%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.8e+55) (not (<= t 3.5e+66))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.8e+55) || !(t <= 3.5e+66)) {
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 <= (-8.8d+55)) .or. (.not. (t <= 3.5d+66))) 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 <= -8.8e+55) || !(t <= 3.5e+66)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.8e+55) or not (t <= 3.5e+66): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.8e+55) || !(t <= 3.5e+66)) 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 <= -8.8e+55) || ~((t <= 3.5e+66))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.8e+55], N[Not[LessEqual[t, 3.5e+66]], $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 -8.8 \cdot 10^{+55} \lor \neg \left(t \leq 3.5 \cdot 10^{+66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -8.80000000000000042e55 or 3.4999999999999997e66 < t Initial program 99.9%
Taylor expanded in t around inf 81.6%
if -8.80000000000000042e55 < t < 3.4999999999999997e66Initial program 96.6%
Taylor expanded in t around 0 73.6%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.7e+119) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.7e+119) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-4.7d+119)) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.7e+119) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.7e+119: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.7e+119) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.7e+119) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.7e+119], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{+119}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.70000000000000008e119Initial program 100.0%
Taylor expanded in t around 0 81.7%
Taylor expanded in x around inf 74.3%
if -4.70000000000000008e119 < a Initial program 97.8%
Taylor expanded in t around inf 61.2%
Final simplification63.0%
(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.1%
Taylor expanded in t around 0 61.0%
Taylor expanded in x around inf 53.1%
Final simplification53.1%
(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 2023318
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(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)))))