
(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 10 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 (let* ((t_1 (/ (- t z) (- a z)))) (if (<= t_1 (- INFINITY)) (+ x (/ (* y t) (- a z))) (+ x (* y t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y * t_1);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - z) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y * t) / (a - z)) else: tmp = x + (y * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(y * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - z) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y * t) / (a - z)); else tmp = x + (y * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -inf.0Initial program 52.7%
Taylor expanded in t around inf 99.7%
mul-1-neg99.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if -inf.0 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.7%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ t a))))
(if (<= t -2.6e+272)
t_1
(if (<= t 1.15e+86)
(+ x y)
(if (<= t 9.4e+148)
t_1
(if (<= t 2.6e+158)
(+ x y)
(if (or (<= t 2.7e+215) (not (<= t 1.65e+220))) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (t / a);
double tmp;
if (t <= -2.6e+272) {
tmp = t_1;
} else if (t <= 1.15e+86) {
tmp = x + y;
} else if (t <= 9.4e+148) {
tmp = t_1;
} else if (t <= 2.6e+158) {
tmp = x + y;
} else if ((t <= 2.7e+215) || !(t <= 1.65e+220)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (t / a)
if (t <= (-2.6d+272)) then
tmp = t_1
else if (t <= 1.15d+86) then
tmp = x + y
else if (t <= 9.4d+148) then
tmp = t_1
else if (t <= 2.6d+158) then
tmp = x + y
else if ((t <= 2.7d+215) .or. (.not. (t <= 1.65d+220))) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (t / a);
double tmp;
if (t <= -2.6e+272) {
tmp = t_1;
} else if (t <= 1.15e+86) {
tmp = x + y;
} else if (t <= 9.4e+148) {
tmp = t_1;
} else if (t <= 2.6e+158) {
tmp = x + y;
} else if ((t <= 2.7e+215) || !(t <= 1.65e+220)) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (t / a) tmp = 0 if t <= -2.6e+272: tmp = t_1 elif t <= 1.15e+86: tmp = x + y elif t <= 9.4e+148: tmp = t_1 elif t <= 2.6e+158: tmp = x + y elif (t <= 2.7e+215) or not (t <= 1.65e+220): tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(t / a)) tmp = 0.0 if (t <= -2.6e+272) tmp = t_1; elseif (t <= 1.15e+86) tmp = Float64(x + y); elseif (t <= 9.4e+148) tmp = t_1; elseif (t <= 2.6e+158) tmp = Float64(x + y); elseif ((t <= 2.7e+215) || !(t <= 1.65e+220)) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (t / a); tmp = 0.0; if (t <= -2.6e+272) tmp = t_1; elseif (t <= 1.15e+86) tmp = x + y; elseif (t <= 9.4e+148) tmp = t_1; elseif (t <= 2.6e+158) tmp = x + y; elseif ((t <= 2.7e+215) || ~((t <= 1.65e+220))) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+272], t$95$1, If[LessEqual[t, 1.15e+86], N[(x + y), $MachinePrecision], If[LessEqual[t, 9.4e+148], t$95$1, If[LessEqual[t, 2.6e+158], N[(x + y), $MachinePrecision], If[Or[LessEqual[t, 2.7e+215], N[Not[LessEqual[t, 1.65e+220]], $MachinePrecision]], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{a}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+86}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 9.4 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+158}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+215} \lor \neg \left(t \leq 1.65 \cdot 10^{+220}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.59999999999999999e272 or 1.14999999999999995e86 < t < 9.3999999999999994e148 or 2.6e158 < t < 2.7e215 or 1.65000000000000011e220 < t Initial program 94.1%
Taylor expanded in t around inf 78.5%
mul-1-neg78.5%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in x around 0 78.5%
Taylor expanded in x around inf 68.8%
mul-1-neg68.8%
unsub-neg68.8%
associate-/l*80.4%
associate-/r*78.4%
Simplified78.4%
Taylor expanded in x around 0 66.2%
associate-*r/66.2%
associate-*r*66.2%
neg-mul-166.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in z around 0 50.1%
*-commutative50.1%
associate-/l*61.5%
Simplified61.5%
if -2.59999999999999999e272 < t < 1.14999999999999995e86 or 9.3999999999999994e148 < t < 2.6e158Initial program 97.6%
Taylor expanded in z around inf 66.8%
if 2.7e215 < t < 1.65000000000000011e220Initial program 100.0%
Taylor expanded in t around inf 100.0%
mul-1-neg100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification65.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -1.5e+91)
t_1
(if (<= z 7e-23)
(+ x (/ (* y t) (- a z)))
(if (<= z 8.5e+136)
(- x (/ y (/ (- a z) z)))
(if (<= z 1.6e+156)
(+ x (* t (/ y a)))
(if (<= z 5e+234) (+ x (* y (/ z (- z a)))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -1.5e+91) {
tmp = t_1;
} else if (z <= 7e-23) {
tmp = x + ((y * t) / (a - z));
} else if (z <= 8.5e+136) {
tmp = x - (y / ((a - z) / z));
} else if (z <= 1.6e+156) {
tmp = x + (t * (y / a));
} else if (z <= 5e+234) {
tmp = x + (y * (z / (z - a)));
} 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 * (1.0d0 - (t / z)))
if (z <= (-1.5d+91)) then
tmp = t_1
else if (z <= 7d-23) then
tmp = x + ((y * t) / (a - z))
else if (z <= 8.5d+136) then
tmp = x - (y / ((a - z) / z))
else if (z <= 1.6d+156) then
tmp = x + (t * (y / a))
else if (z <= 5d+234) then
tmp = x + (y * (z / (z - a)))
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 * (1.0 - (t / z)));
double tmp;
if (z <= -1.5e+91) {
tmp = t_1;
} else if (z <= 7e-23) {
tmp = x + ((y * t) / (a - z));
} else if (z <= 8.5e+136) {
tmp = x - (y / ((a - z) / z));
} else if (z <= 1.6e+156) {
tmp = x + (t * (y / a));
} else if (z <= 5e+234) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -1.5e+91: tmp = t_1 elif z <= 7e-23: tmp = x + ((y * t) / (a - z)) elif z <= 8.5e+136: tmp = x - (y / ((a - z) / z)) elif z <= 1.6e+156: tmp = x + (t * (y / a)) elif z <= 5e+234: tmp = x + (y * (z / (z - a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -1.5e+91) tmp = t_1; elseif (z <= 7e-23) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); elseif (z <= 8.5e+136) tmp = Float64(x - Float64(y / Float64(Float64(a - z) / z))); elseif (z <= 1.6e+156) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 5e+234) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -1.5e+91) tmp = t_1; elseif (z <= 7e-23) tmp = x + ((y * t) / (a - z)); elseif (z <= 8.5e+136) tmp = x - (y / ((a - z) / z)); elseif (z <= 1.6e+156) tmp = x + (t * (y / a)); elseif (z <= 5e+234) tmp = x + (y * (z / (z - a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+91], t$95$1, If[LessEqual[z, 7e-23], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+136], N[(x - N[(y / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+156], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+234], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+136}:\\
\;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+156}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+234}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.50000000000000003e91 or 5.0000000000000003e234 < z Initial program 99.9%
Taylor expanded in a around 0 59.6%
associate-/l*92.5%
div-sub92.5%
*-inverses92.5%
Simplified92.5%
if -1.50000000000000003e91 < z < 6.99999999999999987e-23Initial program 94.8%
Taylor expanded in t around inf 85.6%
mul-1-neg85.6%
associate-/l*90.7%
Simplified90.7%
Taylor expanded in x around 0 85.6%
if 6.99999999999999987e-23 < z < 8.49999999999999966e136Initial program 99.9%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 83.7%
if 8.49999999999999966e136 < z < 1.60000000000000001e156Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-/l*100.0%
Simplified100.0%
if 1.60000000000000001e156 < z < 5.0000000000000003e234Initial program 100.0%
Taylor expanded in t around 0 53.1%
associate-/l*95.3%
Simplified95.3%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* t (/ y a)))))
(if (<= z -6.3e-18)
(+ x (/ y (- 1.0 (/ a z))))
(if (<= z -2.9e-186)
t_1
(if (<= z -6.2e-195)
(* t (/ y (- a z)))
(if (<= z 1e-252)
t_1
(if (<= z 5.5e-55)
(+ x (* y (/ t a)))
(+ x (* y (/ z (- z a)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t * (y / a));
double tmp;
if (z <= -6.3e-18) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= -2.9e-186) {
tmp = t_1;
} else if (z <= -6.2e-195) {
tmp = t * (y / (a - z));
} else if (z <= 1e-252) {
tmp = t_1;
} else if (z <= 5.5e-55) {
tmp = x + (y * (t / a));
} 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) :: t_1
real(8) :: tmp
t_1 = x + (t * (y / a))
if (z <= (-6.3d-18)) then
tmp = x + (y / (1.0d0 - (a / z)))
else if (z <= (-2.9d-186)) then
tmp = t_1
else if (z <= (-6.2d-195)) then
tmp = t * (y / (a - z))
else if (z <= 1d-252) then
tmp = t_1
else if (z <= 5.5d-55) then
tmp = x + (y * (t / a))
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 t_1 = x + (t * (y / a));
double tmp;
if (z <= -6.3e-18) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= -2.9e-186) {
tmp = t_1;
} else if (z <= -6.2e-195) {
tmp = t * (y / (a - z));
} else if (z <= 1e-252) {
tmp = t_1;
} else if (z <= 5.5e-55) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t * (y / a)) tmp = 0 if z <= -6.3e-18: tmp = x + (y / (1.0 - (a / z))) elif z <= -2.9e-186: tmp = t_1 elif z <= -6.2e-195: tmp = t * (y / (a - z)) elif z <= 1e-252: tmp = t_1 elif z <= 5.5e-55: tmp = x + (y * (t / a)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t * Float64(y / a))) tmp = 0.0 if (z <= -6.3e-18) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); elseif (z <= -2.9e-186) tmp = t_1; elseif (z <= -6.2e-195) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (z <= 1e-252) tmp = t_1; elseif (z <= 5.5e-55) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t * (y / a)); tmp = 0.0; if (z <= -6.3e-18) tmp = x + (y / (1.0 - (a / z))); elseif (z <= -2.9e-186) tmp = t_1; elseif (z <= -6.2e-195) tmp = t * (y / (a - z)); elseif (z <= 1e-252) tmp = t_1; elseif (z <= 5.5e-55) tmp = x + (y * (t / a)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.3e-18], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.9e-186], t$95$1, If[LessEqual[z, -6.2e-195], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-252], t$95$1, If[LessEqual[z, 5.5e-55], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -6.3 \cdot 10^{-18}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-195}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 10^{-252}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-55}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -6.3000000000000004e-18Initial program 99.8%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 85.7%
div-sub85.7%
*-inverses85.7%
Simplified85.7%
if -6.3000000000000004e-18 < z < -2.90000000000000019e-186 or -6.20000000000000005e-195 < z < 9.99999999999999943e-253Initial program 94.4%
Taylor expanded in z around 0 82.0%
associate-/l*87.4%
Simplified87.4%
if -2.90000000000000019e-186 < z < -6.20000000000000005e-195Initial program 100.0%
Taylor expanded in t around inf 76.3%
mul-1-neg76.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 76.3%
Taylor expanded in x around 0 76.3%
associate-*r/76.3%
mul-1-neg76.3%
distribute-rgt-neg-in76.3%
associate-*r/100.0%
Simplified100.0%
if 9.99999999999999943e-253 < z < 5.4999999999999999e-55Initial program 92.1%
Taylor expanded in z around 0 70.1%
*-commutative70.1%
associate-/l*77.5%
Simplified77.5%
if 5.4999999999999999e-55 < z Initial program 100.0%
Taylor expanded in t around 0 65.4%
associate-/l*83.9%
Simplified83.9%
Final simplification84.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ t z))))) (t_2 (+ x (* t (/ y a)))))
(if (<= a -1.2e-45)
t_2
(if (<= a 3e-166)
t_1
(if (<= a 4.5e-139)
(* t (/ y (- a z)))
(if (<= a 1.55e-53) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double t_2 = x + (t * (y / a));
double tmp;
if (a <= -1.2e-45) {
tmp = t_2;
} else if (a <= 3e-166) {
tmp = t_1;
} else if (a <= 4.5e-139) {
tmp = t * (y / (a - z));
} else if (a <= 1.55e-53) {
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 * (1.0d0 - (t / z)))
t_2 = x + (t * (y / a))
if (a <= (-1.2d-45)) then
tmp = t_2
else if (a <= 3d-166) then
tmp = t_1
else if (a <= 4.5d-139) then
tmp = t * (y / (a - z))
else if (a <= 1.55d-53) 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 * (1.0 - (t / z)));
double t_2 = x + (t * (y / a));
double tmp;
if (a <= -1.2e-45) {
tmp = t_2;
} else if (a <= 3e-166) {
tmp = t_1;
} else if (a <= 4.5e-139) {
tmp = t * (y / (a - z));
} else if (a <= 1.55e-53) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (t / z))) t_2 = x + (t * (y / a)) tmp = 0 if a <= -1.2e-45: tmp = t_2 elif a <= 3e-166: tmp = t_1 elif a <= 4.5e-139: tmp = t * (y / (a - z)) elif a <= 1.55e-53: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) t_2 = Float64(x + Float64(t * Float64(y / a))) tmp = 0.0 if (a <= -1.2e-45) tmp = t_2; elseif (a <= 3e-166) tmp = t_1; elseif (a <= 4.5e-139) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (a <= 1.55e-53) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (t / z))); t_2 = x + (t * (y / a)); tmp = 0.0; if (a <= -1.2e-45) tmp = t_2; elseif (a <= 3e-166) tmp = t_1; elseif (a <= 4.5e-139) tmp = t * (y / (a - z)); elseif (a <= 1.55e-53) 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[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.2e-45], t$95$2, If[LessEqual[a, 3e-166], t$95$1, If[LessEqual[a, 4.5e-139], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e-53], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
t_2 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;a \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{-139}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -1.19999999999999995e-45 or 1.55000000000000008e-53 < a Initial program 99.2%
Taylor expanded in z around 0 73.0%
associate-/l*79.6%
Simplified79.6%
if -1.19999999999999995e-45 < a < 3.0000000000000003e-166 or 4.50000000000000023e-139 < a < 1.55000000000000008e-53Initial program 95.8%
Taylor expanded in a around 0 71.9%
associate-/l*83.9%
div-sub83.9%
*-inverses83.9%
Simplified83.9%
if 3.0000000000000003e-166 < a < 4.50000000000000023e-139Initial program 42.7%
Taylor expanded in t around inf 99.4%
mul-1-neg99.4%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.4%
associate-*r/99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
associate-*r/99.7%
Simplified99.7%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+153) (+ x (/ y (/ z (- z t)))) (if (<= z 2.9e-44) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+153) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 2.9e-44) {
tmp = x + (t * (y / (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 (z <= (-1.9d+153)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 2.9d-44) then
tmp = x + (t * (y / (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 (z <= -1.9e+153) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 2.9e-44) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+153: tmp = x + (y / (z / (z - t))) elif z <= 2.9e-44: tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+153) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 2.9e-44) tmp = Float64(x + Float64(t * Float64(y / 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 (z <= -1.9e+153) tmp = x + (y / (z / (z - t))); elseif (z <= 2.9e-44) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+153], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-44], N[(x + N[(t * N[(y / 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}\;z \leq -1.9 \cdot 10^{+153}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-44}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.89999999999999983e153Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 93.2%
if -1.89999999999999983e153 < z < 2.9000000000000001e-44Initial program 95.0%
Taylor expanded in t around inf 84.6%
mul-1-neg84.6%
associate-/l*89.6%
Simplified89.6%
if 2.9000000000000001e-44 < z Initial program 100.0%
Taylor expanded in t around 0 65.8%
associate-/l*85.8%
Simplified85.8%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+153) (not (<= z 5e-55))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+153) || !(z <= 5e-55)) {
tmp = x + y;
} else {
tmp = x + (t * (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 ((z <= (-1.9d+153)) .or. (.not. (z <= 5d-55))) then
tmp = x + y
else
tmp = x + (t * (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 ((z <= -1.9e+153) || !(z <= 5e-55)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+153) or not (z <= 5e-55): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+153) || !(z <= 5e-55)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+153) || ~((z <= 5e-55))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+153], N[Not[LessEqual[z, 5e-55]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+153} \lor \neg \left(z \leq 5 \cdot 10^{-55}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.89999999999999983e153 or 5.0000000000000002e-55 < z Initial program 99.9%
Taylor expanded in z around inf 77.3%
if -1.89999999999999983e153 < z < 5.0000000000000002e-55Initial program 94.9%
Taylor expanded in z around 0 73.1%
associate-/l*78.1%
Simplified78.1%
Final simplification77.8%
(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}
Initial program 96.9%
clear-num96.9%
un-div-inv97.5%
Applied egg-rr97.5%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 96.9%
Taylor expanded in z around inf 57.5%
(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 96.9%
Taylor expanded in t around inf 73.6%
mul-1-neg73.6%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in x around inf 47.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 2024107
(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)))))