
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(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 2e+287)))
(+ x (/ (- z t) (/ (- z a) y)))
(+ 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 <= 2e+287)) {
tmp = x + ((z - t) / ((z - a) / y));
} 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 <= 2e+287)) {
tmp = x + ((z - t) / ((z - a) / y));
} 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 <= 2e+287): tmp = x + ((z - t) / ((z - a) / y)) 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 <= 2e+287)) tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))); 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 <= 2e+287))) tmp = x + ((z - t) / ((z - a) / y)); 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, 2e+287]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $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 2 \cdot 10^{+287}\right):\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 2.0000000000000002e287 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 45.6%
*-commutative45.6%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000002e287Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.35e+25)
(+ y x)
(if (<= z -4.7e-73)
(- x (* t (/ y z)))
(if (<= z 3.15e+38) (+ x (/ y (/ a t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.35e+25) {
tmp = y + x;
} else if (z <= -4.7e-73) {
tmp = x - (t * (y / z));
} else if (z <= 3.15e+38) {
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 <= (-2.35d+25)) then
tmp = y + x
else if (z <= (-4.7d-73)) then
tmp = x - (t * (y / z))
else if (z <= 3.15d+38) 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 <= -2.35e+25) {
tmp = y + x;
} else if (z <= -4.7e-73) {
tmp = x - (t * (y / z));
} else if (z <= 3.15e+38) {
tmp = x + (y / (a / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.35e+25: tmp = y + x elif z <= -4.7e-73: tmp = x - (t * (y / z)) elif z <= 3.15e+38: tmp = x + (y / (a / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.35e+25) tmp = Float64(y + x); elseif (z <= -4.7e-73) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 3.15e+38) 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 <= -2.35e+25) tmp = y + x; elseif (z <= -4.7e-73) tmp = x - (t * (y / z)); elseif (z <= 3.15e+38) tmp = x + (y / (a / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.35e+25], N[(y + x), $MachinePrecision], If[LessEqual[z, -4.7e-73], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.15e+38], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+25}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-73}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -2.3499999999999999e25 or 3.15000000000000001e38 < z Initial program 76.4%
+-commutative76.4%
associate-*l/91.1%
fma-def91.1%
Simplified91.1%
Taylor expanded in z around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -2.3499999999999999e25 < z < -4.69999999999999994e-73Initial program 99.8%
+-commutative99.8%
associate-*l/99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in a around 0 86.1%
+-commutative86.1%
associate-/l*86.2%
associate-/r/86.1%
Simplified86.1%
Taylor expanded in z around 0 81.4%
mul-1-neg81.4%
associate-*r/81.5%
distribute-lft-neg-in81.5%
Simplified81.5%
Taylor expanded in t around 0 81.4%
mul-1-neg81.4%
associate-*r/81.5%
sub-neg81.5%
Simplified81.5%
if -4.69999999999999994e-73 < z < 3.15000000000000001e38Initial program 97.8%
+-commutative97.8%
associate-*l/93.6%
fma-def93.6%
Simplified93.6%
Taylor expanded in z around 0 85.1%
+-commutative85.1%
associate-/l*82.9%
Simplified82.9%
clear-num82.9%
associate-/r/82.8%
clear-num83.1%
Applied egg-rr83.1%
associate-*l/85.1%
associate-/l*85.3%
Applied egg-rr85.3%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+33) (not (<= z 2.2e+116))) (+ x (* y (/ z (- z a)))) (+ x (/ (* y (- z t)) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+33) || !(z <= 2.2e+116)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((y * (z - t)) / (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 <= (-8.2d+33)) .or. (.not. (z <= 2.2d+116))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + ((y * (z - t)) / (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 <= -8.2e+33) || !(z <= 2.2e+116)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((y * (z - t)) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e+33) or not (z <= 2.2e+116): tmp = x + (y * (z / (z - a))) else: tmp = x + ((y * (z - t)) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+33) || !(z <= 2.2e+116)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.2e+33) || ~((z <= 2.2e+116))) tmp = x + (y * (z / (z - a))); else tmp = x + ((y * (z - t)) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+33], N[Not[LessEqual[z, 2.2e+116]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+33} \lor \neg \left(z \leq 2.2 \cdot 10^{+116}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\end{array}
\end{array}
if z < -8.1999999999999999e33 or 2.2e116 < z Initial program 73.3%
+-commutative73.3%
associate-*l/90.0%
fma-def90.0%
Simplified90.0%
fma-udef90.0%
associate-/r/99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 89.9%
if -8.1999999999999999e33 < z < 2.2e116Initial program 98.2%
Final simplification95.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e+33) (not (<= z 3.2e+117))) (+ y x) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e+33) || !(z <= 3.2e+117)) {
tmp = y + x;
} else {
tmp = x + (y / ((a - z) / 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.5d+33)) .or. (.not. (z <= 3.2d+117))) then
tmp = y + x
else
tmp = x + (y / ((a - z) / 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.5e+33) || !(z <= 3.2e+117)) {
tmp = y + x;
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e+33) or not (z <= 3.2e+117): tmp = y + x else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e+33) || !(z <= 3.2e+117)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.5e+33) || ~((z <= 3.2e+117))) tmp = y + x; else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+33], N[Not[LessEqual[z, 3.2e+117]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+33} \lor \neg \left(z \leq 3.2 \cdot 10^{+117}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -7.50000000000000046e33 or 3.20000000000000005e117 < z Initial program 73.3%
+-commutative73.3%
associate-*l/90.0%
fma-def90.0%
Simplified90.0%
Taylor expanded in z around inf 78.5%
+-commutative78.5%
Simplified78.5%
if -7.50000000000000046e33 < z < 3.20000000000000005e117Initial program 98.2%
Taylor expanded in t around inf 91.7%
associate-*r/90.1%
neg-mul-190.1%
*-commutative90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
associate-*l/91.7%
frac-2neg91.7%
add-sqr-sqrt43.4%
sqrt-unprod66.6%
sqr-neg66.6%
sqrt-unprod30.2%
add-sqr-sqrt50.5%
distribute-rgt-neg-out50.5%
add-sqr-sqrt20.3%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod48.2%
add-sqr-sqrt91.7%
Applied egg-rr91.7%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
mul-1-neg88.9%
sub-neg88.9%
div-sub90.2%
Simplified90.2%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e+30) (not (<= z 1.5e+112))) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e+30) || !(z <= 1.5e+112)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / 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 <= (-3d+30)) .or. (.not. (z <= 1.5d+112))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y / ((a - z) / 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 <= -3e+30) || !(z <= 1.5e+112)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e+30) or not (z <= 1.5e+112): tmp = x + (y * (z / (z - a))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e+30) || !(z <= 1.5e+112)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3e+30) || ~((z <= 1.5e+112))) tmp = x + (y * (z / (z - a))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e+30], N[Not[LessEqual[z, 1.5e+112]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+30} \lor \neg \left(z \leq 1.5 \cdot 10^{+112}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -2.99999999999999978e30 or 1.4999999999999999e112 < z Initial program 73.3%
+-commutative73.3%
associate-*l/90.0%
fma-def90.0%
Simplified90.0%
fma-udef90.0%
associate-/r/99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 89.9%
if -2.99999999999999978e30 < z < 1.4999999999999999e112Initial program 98.2%
Taylor expanded in t around inf 91.7%
associate-*r/90.1%
neg-mul-190.1%
*-commutative90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
associate-*l/91.7%
frac-2neg91.7%
add-sqr-sqrt43.4%
sqrt-unprod66.6%
sqr-neg66.6%
sqrt-unprod30.2%
add-sqr-sqrt50.5%
distribute-rgt-neg-out50.5%
add-sqr-sqrt20.3%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod48.2%
add-sqr-sqrt91.7%
Applied egg-rr91.7%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
mul-1-neg88.9%
sub-neg88.9%
div-sub90.2%
Simplified90.2%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.95e+31) (+ x (* y (/ z (- z a)))) (if (<= z 3e+38) (+ x (/ y (/ (- a z) t))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.95e+31) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3e+38) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y / (z / (z - 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 <= (-2.95d+31)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 3d+38) then
tmp = x + (y / ((a - z) / t))
else
tmp = x + (y / (z / (z - 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 <= -2.95e+31) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3e+38) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.95e+31: tmp = x + (y * (z / (z - a))) elif z <= 3e+38: tmp = x + (y / ((a - z) / t)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.95e+31) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 3e+38) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.95e+31) tmp = x + (y * (z / (z - a))); elseif (z <= 3e+38) tmp = x + (y / ((a - z) / t)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.95e+31], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+38], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.95 \cdot 10^{+31}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -2.9500000000000002e31Initial program 80.0%
+-commutative80.0%
associate-*l/92.0%
fma-def92.0%
Simplified92.0%
fma-udef92.0%
associate-/r/99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 90.5%
if -2.9500000000000002e31 < z < 3.0000000000000001e38Initial program 98.0%
Taylor expanded in t around inf 91.7%
associate-*r/90.0%
neg-mul-190.0%
*-commutative90.0%
distribute-rgt-neg-out90.0%
Simplified90.0%
associate-*l/91.7%
frac-2neg91.7%
add-sqr-sqrt42.8%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-unprod29.9%
add-sqr-sqrt49.2%
distribute-rgt-neg-out49.2%
add-sqr-sqrt19.3%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod48.7%
add-sqr-sqrt91.7%
Applied egg-rr91.7%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in z around 0 88.7%
+-commutative88.7%
mul-1-neg88.7%
sub-neg88.7%
div-sub90.1%
Simplified90.1%
if 3.0000000000000001e38 < z Initial program 73.4%
+-commutative73.4%
associate-*l/90.4%
fma-def90.4%
Simplified90.4%
Taylor expanded in a around 0 71.8%
+-commutative71.8%
associate-/l*91.2%
Simplified91.2%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e+28) (+ x (* y (/ z (- z a)))) (if (<= z 6.6e+36) (- x (/ (* y t) (- z a))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+28) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 6.6e+36) {
tmp = x - ((y * t) / (z - a));
} else {
tmp = x + (y / (z / (z - 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 <= (-2.7d+28)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 6.6d+36) then
tmp = x - ((y * t) / (z - a))
else
tmp = x + (y / (z / (z - 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 <= -2.7e+28) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 6.6e+36) {
tmp = x - ((y * t) / (z - a));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e+28: tmp = x + (y * (z / (z - a))) elif z <= 6.6e+36: tmp = x - ((y * t) / (z - a)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e+28) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 6.6e+36) tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e+28) tmp = x + (y * (z / (z - a))); elseif (z <= 6.6e+36) tmp = x - ((y * t) / (z - a)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e+28], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+36], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+28}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+36}:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -2.7000000000000002e28Initial program 80.0%
+-commutative80.0%
associate-*l/92.0%
fma-def92.0%
Simplified92.0%
fma-udef92.0%
associate-/r/99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 90.5%
if -2.7000000000000002e28 < z < 6.5999999999999997e36Initial program 98.0%
Taylor expanded in z around 0 91.7%
mul-1-neg91.7%
distribute-lft-neg-out91.7%
*-commutative91.7%
Simplified91.7%
if 6.5999999999999997e36 < z Initial program 73.4%
+-commutative73.4%
associate-*l/90.4%
fma-def90.4%
Simplified90.4%
Taylor expanded in a around 0 71.8%
+-commutative71.8%
associate-/l*91.2%
Simplified91.2%
Final simplification91.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+21) (not (<= z 4.4e+37))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+21) || !(z <= 4.4e+37)) {
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 <= (-7d+21)) .or. (.not. (z <= 4.4d+37))) 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 <= -7e+21) || !(z <= 4.4e+37)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+21) or not (z <= 4.4e+37): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+21) || !(z <= 4.4e+37)) 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 <= -7e+21) || ~((z <= 4.4e+37))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+21], N[Not[LessEqual[z, 4.4e+37]], $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 -7 \cdot 10^{+21} \lor \neg \left(z \leq 4.4 \cdot 10^{+37}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7e21 or 4.4000000000000001e37 < z Initial program 76.8%
+-commutative76.8%
associate-*l/91.3%
fma-def91.3%
Simplified91.3%
Taylor expanded in z around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -7e21 < z < 4.4000000000000001e37Initial program 98.0%
Taylor expanded in z around 0 81.1%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+17) (not (<= z 2e+39))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+17) || !(z <= 2e+39)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.45d+17)) .or. (.not. (z <= 2d+39))) then
tmp = y + x
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+17) || !(z <= 2e+39)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+17) or not (z <= 2e+39): tmp = y + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+17) || !(z <= 2e+39)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e+17) || ~((z <= 2e+39))) tmp = y + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+17], N[Not[LessEqual[z, 2e+39]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+17} \lor \neg \left(z \leq 2 \cdot 10^{+39}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.45e17 or 1.99999999999999988e39 < z Initial program 76.8%
+-commutative76.8%
associate-*l/91.3%
fma-def91.3%
Simplified91.3%
Taylor expanded in z around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -1.45e17 < z < 1.99999999999999988e39Initial program 98.0%
+-commutative98.0%
associate-*l/94.4%
fma-def94.4%
Simplified94.4%
Taylor expanded in z around 0 81.1%
+-commutative81.1%
associate-/l*79.3%
Simplified79.3%
clear-num79.2%
associate-/r/79.2%
clear-num79.4%
Applied egg-rr79.4%
associate-*l/81.1%
associate-/l*81.3%
Applied egg-rr81.3%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.5e+28) x (if (<= a 4.4e+201) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+28) {
tmp = x;
} else if (a <= 4.4e+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 <= (-9.5d+28)) then
tmp = x
else if (a <= 4.4d+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 <= -9.5e+28) {
tmp = x;
} else if (a <= 4.4e+201) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e+28: tmp = x elif a <= 4.4e+201: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+28) tmp = x; elseif (a <= 4.4e+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 <= -9.5e+28) tmp = x; elseif (a <= 4.4e+201) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+28], x, If[LessEqual[a, 4.4e+201], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{+201}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.49999999999999927e28 or 4.4e201 < a Initial program 89.0%
+-commutative89.0%
associate-*l/96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in y around 0 74.0%
if -9.49999999999999927e28 < a < 4.4e201Initial program 89.4%
+-commutative89.4%
associate-*l/91.5%
fma-def91.5%
Simplified91.5%
Taylor expanded in z around inf 58.0%
+-commutative58.0%
Simplified58.0%
Final simplification62.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.1e+176) y (if (<= y 3.4e+63) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+176) {
tmp = y;
} else if (y <= 3.4e+63) {
tmp = x;
} else {
tmp = 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 (y <= (-3.1d+176)) then
tmp = y
else if (y <= 3.4d+63) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+176) {
tmp = y;
} else if (y <= 3.4e+63) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e+176: tmp = y elif y <= 3.4e+63: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e+176) tmp = y; elseif (y <= 3.4e+63) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.1e+176) tmp = y; elseif (y <= 3.4e+63) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+176], y, If[LessEqual[y, 3.4e+63], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+176}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -3.0999999999999999e176 or 3.3999999999999999e63 < y Initial program 65.8%
+-commutative65.8%
associate-*l/92.2%
fma-def92.2%
Simplified92.2%
Taylor expanded in a around 0 30.1%
+-commutative30.1%
associate-/l*51.2%
associate-/r/48.5%
Simplified48.5%
Taylor expanded in y around inf 49.9%
Taylor expanded in t around 0 32.7%
if -3.0999999999999999e176 < y < 3.3999999999999999e63Initial program 98.8%
+-commutative98.8%
associate-*l/93.5%
fma-def93.5%
Simplified93.5%
Taylor expanded in y around 0 63.2%
Final simplification54.4%
(FPCore (x y z t a) :precision binary64 (+ (* y (/ (- z t) (- z a))) x))
double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (z - a))) + 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 = (y * ((z - t) / (z - a))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (z - a))) + x;
}
def code(x, y, z, t, a): return (y * ((z - t) / (z - a))) + x
function code(x, y, z, t, a) return Float64(Float64(y * Float64(Float64(z - t) / Float64(z - a))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y * ((z - t) / (z - a))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{z - t}{z - a} + x
\end{array}
Initial program 89.3%
+-commutative89.3%
associate-*l/93.1%
fma-def93.1%
Simplified93.1%
fma-udef93.1%
associate-/r/97.8%
div-inv97.6%
clear-num97.6%
Applied egg-rr97.6%
Final simplification97.6%
(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 89.3%
+-commutative89.3%
associate-*l/93.1%
fma-def93.1%
Simplified93.1%
Taylor expanded in y around 0 49.1%
Final simplification49.1%
(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 2024031
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))