
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+240)))
(+ x (/ -1.0 (/ (/ (- z a) y) (- t z))))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+240)) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+240)) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+240): tmp = x + (-1.0 / (((z - a) / y) / (t - z))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+240)) tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(z - a) / y) / Float64(t - z)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+240))) tmp = x + (-1.0 / (((z - a) / y) / (t - z))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+240]], $MachinePrecision]], N[(x + N[(-1.0 / N[(N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+240}\right):\\
\;\;\;\;x + \frac{-1}{\frac{\frac{z - a}{y}}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 5.0000000000000003e240 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 29.7%
clear-num29.7%
inv-pow29.7%
Applied egg-rr29.7%
unpow-129.7%
associate-/r*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.0000000000000003e240Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (fma y (/ -1.0 (/ (- z a) (- t z))) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, (-1.0 / ((z - a) / (t - z))), x);
}
function code(x, y, z, t, a) return fma(y, Float64(-1.0 / Float64(Float64(z - a) / Float64(t - z))), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(-1.0 / N[(N[(z - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{-1}{\frac{z - a}{t - z}}, x\right)
\end{array}
Initial program 81.5%
+-commutative81.5%
associate-/l*99.1%
fma-define99.1%
Simplified99.1%
clear-num99.2%
inv-pow99.2%
Applied egg-rr99.2%
unpow-199.2%
Simplified99.2%
Final simplification99.2%
(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 81.5%
+-commutative81.5%
associate-/l*99.1%
fma-define99.1%
Simplified99.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.45e+125)
(+ y x)
(if (<= z -5.6e+59)
(- x (* t (/ y z)))
(if (<= z 8.2e-47) (+ x (/ y (/ a t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e+125) {
tmp = y + x;
} else if (z <= -5.6e+59) {
tmp = x - (t * (y / z));
} else if (z <= 8.2e-47) {
tmp = x + (y / (a / t));
} 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 (z <= (-1.45d+125)) then
tmp = y + x
else if (z <= (-5.6d+59)) then
tmp = x - (t * (y / z))
else if (z <= 8.2d-47) then
tmp = x + (y / (a / t))
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 (z <= -1.45e+125) {
tmp = y + x;
} else if (z <= -5.6e+59) {
tmp = x - (t * (y / z));
} else if (z <= 8.2e-47) {
tmp = x + (y / (a / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.45e+125: tmp = y + x elif z <= -5.6e+59: tmp = x - (t * (y / z)) elif z <= 8.2e-47: tmp = x + (y / (a / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e+125) tmp = Float64(y + x); elseif (z <= -5.6e+59) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 8.2e-47) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.45e+125) tmp = y + x; elseif (z <= -5.6e+59) tmp = x - (t * (y / z)); elseif (z <= 8.2e-47) tmp = x + (y / (a / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e+125], N[(y + x), $MachinePrecision], If[LessEqual[z, -5.6e+59], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-47], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+125}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{+59}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-47}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.44999999999999997e125 or 8.20000000000000003e-47 < z Initial program 68.6%
+-commutative68.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -1.44999999999999997e125 < z < -5.5999999999999996e59Initial program 84.8%
clear-num84.8%
associate-/r/84.8%
Applied egg-rr84.8%
Taylor expanded in t around inf 84.8%
mul-1-neg84.8%
associate-/l*89.7%
*-lft-identity89.7%
associate-*l/89.7%
distribute-lft-neg-out89.7%
*-commutative89.7%
associate-*l/89.7%
*-lft-identity89.7%
Simplified89.7%
Taylor expanded in z around inf 84.9%
mul-1-neg84.9%
unsub-neg84.9%
associate-/l*89.8%
Simplified89.8%
if -5.5999999999999996e59 < z < 8.20000000000000003e-47Initial program 95.0%
+-commutative95.0%
associate-/l*98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in a around inf 81.5%
mul-1-neg81.5%
unsub-neg81.5%
associate-/l*83.9%
Simplified83.9%
clear-num84.0%
un-div-inv84.8%
Applied egg-rr84.8%
Taylor expanded in z around 0 82.3%
mul-1-neg82.3%
distribute-neg-frac282.3%
Simplified82.3%
Final simplification80.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.7e+125)
(+ y x)
(if (<= z -4.4e+59)
(- x (* t (/ y z)))
(if (<= z 8.2e-47) (+ x (/ t (/ a y))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+125) {
tmp = y + x;
} else if (z <= -4.4e+59) {
tmp = x - (t * (y / z));
} else if (z <= 8.2e-47) {
tmp = x + (t / (a / y));
} 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 (z <= (-1.7d+125)) then
tmp = y + x
else if (z <= (-4.4d+59)) then
tmp = x - (t * (y / z))
else if (z <= 8.2d-47) then
tmp = x + (t / (a / y))
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 (z <= -1.7e+125) {
tmp = y + x;
} else if (z <= -4.4e+59) {
tmp = x - (t * (y / z));
} else if (z <= 8.2e-47) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+125: tmp = y + x elif z <= -4.4e+59: tmp = x - (t * (y / z)) elif z <= 8.2e-47: tmp = x + (t / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+125) tmp = Float64(y + x); elseif (z <= -4.4e+59) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 8.2e-47) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.7e+125) tmp = y + x; elseif (z <= -4.4e+59) tmp = x - (t * (y / z)); elseif (z <= 8.2e-47) tmp = x + (t / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+125], N[(y + x), $MachinePrecision], If[LessEqual[z, -4.4e+59], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-47], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+125}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{+59}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-47}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.6999999999999999e125 or 8.20000000000000003e-47 < z Initial program 68.6%
+-commutative68.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -1.6999999999999999e125 < z < -4.3999999999999999e59Initial program 84.8%
clear-num84.8%
associate-/r/84.8%
Applied egg-rr84.8%
Taylor expanded in t around inf 84.8%
mul-1-neg84.8%
associate-/l*89.7%
*-lft-identity89.7%
associate-*l/89.7%
distribute-lft-neg-out89.7%
*-commutative89.7%
associate-*l/89.7%
*-lft-identity89.7%
Simplified89.7%
Taylor expanded in z around inf 84.9%
mul-1-neg84.9%
unsub-neg84.9%
associate-/l*89.8%
Simplified89.8%
if -4.3999999999999999e59 < z < 8.20000000000000003e-47Initial program 95.0%
+-commutative95.0%
associate-/l*98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in z around 0 79.0%
+-commutative79.0%
associate-/l*80.6%
Simplified80.6%
clear-num80.6%
un-div-inv81.4%
Applied egg-rr81.4%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.6e+101)
(- x (* y (/ z (- a z))))
(if (<= z 3.6e+140)
(+ x (/ (* y (- z t)) (- z a)))
(+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.6e+101) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 3.6e+140) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y * (1.0 - (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 (z <= (-7.6d+101)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 3.6d+140) then
tmp = x + ((y * (z - t)) / (z - a))
else
tmp = x + (y * (1.0d0 - (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 (z <= -7.6e+101) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 3.6e+140) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.6e+101: tmp = x - (y * (z / (a - z))) elif z <= 3.6e+140: tmp = x + ((y * (z - t)) / (z - a)) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.6e+101) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 3.6e+140) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.6e+101) tmp = x - (y * (z / (a - z))); elseif (z <= 3.6e+140) tmp = x + ((y * (z - t)) / (z - a)); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.6e+101], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+140], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+101}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+140}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -7.5999999999999996e101Initial program 55.4%
Taylor expanded in t around 0 52.7%
associate-/l*94.6%
Simplified94.6%
if -7.5999999999999996e101 < z < 3.6e140Initial program 93.8%
if 3.6e140 < z Initial program 45.7%
Taylor expanded in a around 0 42.9%
associate-/l*96.8%
div-sub96.8%
*-inverses96.8%
Simplified96.8%
Final simplification94.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e+79) (not (<= t 2.5e+134))) (- x (* t (/ y (- z a)))) (- x (* y (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e+79) || !(t <= 2.5e+134)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x - (y * (z / (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 <= (-2.5d+79)) .or. (.not. (t <= 2.5d+134))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x - (y * (z / (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 <= -2.5e+79) || !(t <= 2.5e+134)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.5e+79) or not (t <= 2.5e+134): tmp = x - (t * (y / (z - a))) else: tmp = x - (y * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e+79) || !(t <= 2.5e+134)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.5e+79) || ~((t <= 2.5e+134))) tmp = x - (t * (y / (z - a))); else tmp = x - (y * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e+79], N[Not[LessEqual[t, 2.5e+134]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+79} \lor \neg \left(t \leq 2.5 \cdot 10^{+134}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if t < -2.5e79 or 2.4999999999999999e134 < t Initial program 76.5%
Taylor expanded in t around inf 71.9%
mul-1-neg71.9%
associate-/l*86.4%
distribute-rgt-neg-in86.4%
distribute-frac-neg286.4%
Simplified86.4%
if -2.5e79 < t < 2.4999999999999999e134Initial program 83.8%
Taylor expanded in t around 0 78.2%
associate-/l*94.3%
Simplified94.3%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e+81) (not (<= t 3.05e+134))) (+ x (* y (/ t (- a z)))) (- x (* y (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+81) || !(t <= 3.05e+134)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (y * (z / (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 <= (-7d+81)) .or. (.not. (t <= 3.05d+134))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x - (y * (z / (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 <= -7e+81) || !(t <= 3.05e+134)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e+81) or not (t <= 3.05e+134): tmp = x + (y * (t / (a - z))) else: tmp = x - (y * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e+81) || !(t <= 3.05e+134)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7e+81) || ~((t <= 3.05e+134))) tmp = x + (y * (t / (a - z))); else tmp = x - (y * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7e+81], N[Not[LessEqual[t, 3.05e+134]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+81} \lor \neg \left(t \leq 3.05 \cdot 10^{+134}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if t < -7.0000000000000001e81 or 3.04999999999999989e134 < t Initial program 76.5%
clear-num76.4%
associate-/r/76.5%
Applied egg-rr76.5%
Taylor expanded in t around inf 71.9%
mul-1-neg71.9%
associate-/l*86.4%
*-lft-identity86.4%
associate-*l/86.3%
distribute-lft-neg-out86.3%
*-commutative86.3%
associate-*l/86.4%
*-lft-identity86.4%
Simplified86.4%
*-commutative86.4%
add-sqr-sqrt43.8%
sqrt-unprod17.7%
sqr-neg17.7%
sqrt-unprod14.1%
add-sqr-sqrt33.2%
cancel-sign-sub-inv33.2%
*-commutative33.2%
associate-*l/28.1%
associate-/l*33.2%
add-sqr-sqrt14.1%
sqrt-unprod17.9%
sqr-neg17.9%
sqrt-unprod43.4%
add-sqr-sqrt84.8%
Applied egg-rr84.8%
if -7.0000000000000001e81 < t < 3.04999999999999989e134Initial program 83.8%
Taylor expanded in t around 0 78.2%
associate-/l*94.3%
Simplified94.3%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.8e-13) (not (<= z 1.08e-76))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.8e-13) || !(z <= 1.08e-76)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-7.8d-13)) .or. (.not. (z <= 1.08d-76))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -7.8e-13) || !(z <= 1.08e-76)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.8e-13) or not (z <= 1.08e-76): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.8e-13) || !(z <= 1.08e-76)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -7.8e-13) || ~((z <= 1.08e-76))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.8e-13], N[Not[LessEqual[z, 1.08e-76]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-13} \lor \neg \left(z \leq 1.08 \cdot 10^{-76}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -7.80000000000000009e-13 or 1.08e-76 < z Initial program 73.8%
Taylor expanded in a around 0 62.2%
associate-/l*84.1%
div-sub84.1%
*-inverses84.1%
Simplified84.1%
if -7.80000000000000009e-13 < z < 1.08e-76Initial program 95.8%
+-commutative95.8%
associate-/l*97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in a around inf 88.3%
mul-1-neg88.3%
unsub-neg88.3%
associate-/l*89.2%
Simplified89.2%
clear-num89.2%
un-div-inv90.3%
Applied egg-rr90.3%
Taylor expanded in z around 0 87.1%
mul-1-neg87.1%
distribute-neg-frac287.1%
Simplified87.1%
Final simplification85.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.3e-115) (- x (* y (/ z (- a z)))) (if (<= z 2.55e-77) (+ x (/ t (/ a y))) (+ x (- y (* t (/ y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-115) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 2.55e-77) {
tmp = x + (t / (a / y));
} else {
tmp = x + (y - (t * (y / 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 <= (-2.3d-115)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 2.55d-77) then
tmp = x + (t / (a / y))
else
tmp = x + (y - (t * (y / 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 <= -2.3e-115) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 2.55e-77) {
tmp = x + (t / (a / y));
} else {
tmp = x + (y - (t * (y / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e-115: tmp = x - (y * (z / (a - z))) elif z <= 2.55e-77: tmp = x + (t / (a / y)) else: tmp = x + (y - (t * (y / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e-115) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 2.55e-77) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + Float64(y - Float64(t * Float64(y / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e-115) tmp = x - (y * (z / (a - z))); elseif (z <= 2.55e-77) tmp = x + (t / (a / y)); else tmp = x + (y - (t * (y / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e-115], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e-77], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-115}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-77}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -2.29999999999999985e-115Initial program 77.4%
Taylor expanded in t around 0 71.3%
associate-/l*87.9%
Simplified87.9%
if -2.29999999999999985e-115 < z < 2.55000000000000016e-77Initial program 97.1%
+-commutative97.1%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in z around 0 90.0%
+-commutative90.0%
associate-/l*88.6%
Simplified88.6%
clear-num88.6%
un-div-inv90.0%
Applied egg-rr90.0%
if 2.55000000000000016e-77 < z Initial program 74.3%
+-commutative74.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 66.3%
associate--l+66.3%
associate--l+66.3%
distribute-lft-out--66.3%
div-sub66.3%
+-commutative66.3%
mul-1-neg66.3%
unsub-neg66.3%
div-sub66.3%
associate-/l*74.6%
associate-/l*81.9%
distribute-rgt-out--81.9%
Simplified81.9%
Taylor expanded in t around inf 85.2%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.95e-115) (- x (* y (/ z (- a z)))) (if (<= z 1.08e-76) (+ x (/ t (/ a y))) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e-115) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 1.08e-76) {
tmp = x + (t / (a / y));
} else {
tmp = x + (y * (1.0 - (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 (z <= (-1.95d-115)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 1.08d-76) then
tmp = x + (t / (a / y))
else
tmp = x + (y * (1.0d0 - (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 (z <= -1.95e-115) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 1.08e-76) {
tmp = x + (t / (a / y));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e-115: tmp = x - (y * (z / (a - z))) elif z <= 1.08e-76: tmp = x + (t / (a / y)) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e-115) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 1.08e-76) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e-115) tmp = x - (y * (z / (a - z))); elseif (z <= 1.08e-76) tmp = x + (t / (a / y)); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e-115], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e-76], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-115}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-76}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -1.9499999999999999e-115Initial program 77.4%
Taylor expanded in t around 0 71.3%
associate-/l*87.9%
Simplified87.9%
if -1.9499999999999999e-115 < z < 1.08e-76Initial program 97.1%
+-commutative97.1%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in z around 0 90.0%
+-commutative90.0%
associate-/l*88.6%
Simplified88.6%
clear-num88.6%
un-div-inv90.0%
Applied egg-rr90.0%
if 1.08e-76 < z Initial program 74.3%
Taylor expanded in a around 0 61.6%
associate-/l*85.1%
div-sub85.1%
*-inverses85.1%
Simplified85.1%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-20) (not (<= z 45000000000000.0))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-20) || !(z <= 45000000000000.0)) {
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-20)) .or. (.not. (z <= 45000000000000.0d0))) 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-20) || !(z <= 45000000000000.0)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e-20) or not (z <= 45000000000000.0): 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-20) || !(z <= 45000000000000.0)) 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-20) || ~((z <= 45000000000000.0))) 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-20], N[Not[LessEqual[z, 45000000000000.0]], $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^{-20} \lor \neg \left(z \leq 45000000000000\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.8999999999999999e-20 or 4.5e13 < z Initial program 70.0%
+-commutative70.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -1.8999999999999999e-20 < z < 4.5e13Initial program 97.3%
Taylor expanded in z around 0 82.3%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.2e+147) x (if (<= a 3.2e+201) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.2e+147) {
tmp = x;
} else if (a <= 3.2e+201) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.2d+147)) then
tmp = x
else if (a <= 3.2d+201) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.2e+147) {
tmp = x;
} else if (a <= 3.2e+201) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.2e+147: tmp = x elif a <= 3.2e+201: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.2e+147) tmp = x; elseif (a <= 3.2e+201) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.2e+147) tmp = x; elseif (a <= 3.2e+201) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.2e+147], x, If[LessEqual[a, 3.2e+201], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{+147}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+201}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.2000000000000002e147 or 3.1999999999999999e201 < a Initial program 85.8%
+-commutative85.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 82.0%
if -2.2000000000000002e147 < a < 3.1999999999999999e201Initial program 80.2%
+-commutative80.2%
associate-/l*98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in z around inf 66.8%
+-commutative66.8%
Simplified66.8%
(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 81.5%
+-commutative81.5%
associate-/l*99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in y around 0 54.0%
(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 2024185
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))