
(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 12 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+285)))
(fma (/ y (- z a)) (- z t) x)
(+ t_1 x))))
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+285)) {
tmp = fma((y / (z - a)), (z - t), x);
} else {
tmp = t_1 + x;
}
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+285)) tmp = fma(Float64(y / Float64(z - a)), Float64(z - t), x); else tmp = Float64(t_1 + x); end return 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+285]], $MachinePrecision]], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], N[(t$95$1 + x), $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^{+285}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 5.00000000000000016e285 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 39.6%
+-commutative39.6%
associate-*l/100.0%
fma-def99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.00000000000000016e285Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+288)))
(+ x (/ y (/ z (- z t))))
(+ t_1 x))))
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 <= 1e+288)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = t_1 + x;
}
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 <= 1e+288)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = t_1 + x;
}
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 <= 1e+288): tmp = x + (y / (z / (z - t))) else: tmp = t_1 + x 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 <= 1e+288)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(t_1 + x); 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 <= 1e+288))) tmp = x + (y / (z / (z - t))); else tmp = t_1 + x; 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, 1e+288]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $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 10^{+288}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;t_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 1e288 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 38.6%
Taylor expanded in a around 0 33.3%
+-commutative33.3%
associate-/l*82.1%
Simplified82.1%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1e288Initial program 99.9%
Final simplification95.8%
(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+285)))
(+ x (/ (- z t) (/ (- z a) y)))
(+ t_1 x))))
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+285)) {
tmp = x + ((z - t) / ((z - a) / y));
} else {
tmp = t_1 + x;
}
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+285)) {
tmp = x + ((z - t) / ((z - a) / y));
} else {
tmp = t_1 + x;
}
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+285): tmp = x + ((z - t) / ((z - a) / y)) else: tmp = t_1 + x 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+285)) tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))); else tmp = Float64(t_1 + x); 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+285))) tmp = x + ((z - t) / ((z - a) / y)); else tmp = t_1 + x; 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+285]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $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^{+285}\right):\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 5.00000000000000016e285 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 39.6%
*-commutative39.6%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.00000000000000016e285Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- z a))))))
(if (<= z -1.35e+56)
t_1
(if (<= z -1.3e-84)
(- x (/ y (/ z t)))
(if (<= z -2.4e-245)
(+ x (/ (* y t) a))
(if (<= z 2.1e-76) (+ x (* y (/ t a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (z - a)));
double tmp;
if (z <= -1.35e+56) {
tmp = t_1;
} else if (z <= -1.3e-84) {
tmp = x - (y / (z / t));
} else if (z <= -2.4e-245) {
tmp = x + ((y * t) / a);
} else if (z <= 2.1e-76) {
tmp = x + (y * (t / 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 + (z * (y / (z - a)))
if (z <= (-1.35d+56)) then
tmp = t_1
else if (z <= (-1.3d-84)) then
tmp = x - (y / (z / t))
else if (z <= (-2.4d-245)) then
tmp = x + ((y * t) / a)
else if (z <= 2.1d-76) then
tmp = x + (y * (t / 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 + (z * (y / (z - a)));
double tmp;
if (z <= -1.35e+56) {
tmp = t_1;
} else if (z <= -1.3e-84) {
tmp = x - (y / (z / t));
} else if (z <= -2.4e-245) {
tmp = x + ((y * t) / a);
} else if (z <= 2.1e-76) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (z - a))) tmp = 0 if z <= -1.35e+56: tmp = t_1 elif z <= -1.3e-84: tmp = x - (y / (z / t)) elif z <= -2.4e-245: tmp = x + ((y * t) / a) elif z <= 2.1e-76: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(z - a)))) tmp = 0.0 if (z <= -1.35e+56) tmp = t_1; elseif (z <= -1.3e-84) tmp = Float64(x - Float64(y / Float64(z / t))); elseif (z <= -2.4e-245) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= 2.1e-76) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (z - a))); tmp = 0.0; if (z <= -1.35e+56) tmp = t_1; elseif (z <= -1.3e-84) tmp = x - (y / (z / t)); elseif (z <= -2.4e-245) tmp = x + ((y * t) / a); elseif (z <= 2.1e-76) tmp = x + (y * (t / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+56], t$95$1, If[LessEqual[z, -1.3e-84], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-245], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-76], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{z - a}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-84}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-245}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-76}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.35000000000000005e56 or 2.09999999999999992e-76 < z Initial program 74.4%
Taylor expanded in t around 0 69.1%
+-commutative69.1%
associate-*l/85.1%
*-commutative85.1%
Simplified85.1%
if -1.35000000000000005e56 < z < -1.3e-84Initial program 92.6%
Taylor expanded in a around 0 78.2%
Taylor expanded in z around 0 84.9%
associate-*r/84.9%
*-commutative84.9%
neg-mul-184.9%
distribute-lft-neg-in84.9%
associate-/l*84.9%
Simplified84.9%
if -1.3e-84 < z < -2.4e-245Initial program 100.0%
Taylor expanded in z around 0 83.7%
if -2.4e-245 < z < 2.09999999999999992e-76Initial program 98.4%
Taylor expanded in z around 0 84.3%
+-commutative84.3%
associate-/l*83.6%
associate-/r/85.7%
Simplified85.7%
Final simplification85.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.8e+100)
(+ y x)
(if (<= z -1.3e-84)
(- x (* y (/ t z)))
(if (<= z 6.8e-76) (+ x (* y (/ t a))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+100) {
tmp = y + x;
} else if (z <= -1.3e-84) {
tmp = x - (y * (t / z));
} else if (z <= 6.8e-76) {
tmp = x + (y * (t / a));
} 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 <= (-6.8d+100)) then
tmp = y + x
else if (z <= (-1.3d-84)) then
tmp = x - (y * (t / z))
else if (z <= 6.8d-76) then
tmp = x + (y * (t / a))
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 <= -6.8e+100) {
tmp = y + x;
} else if (z <= -1.3e-84) {
tmp = x - (y * (t / z));
} else if (z <= 6.8e-76) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e+100: tmp = y + x elif z <= -1.3e-84: tmp = x - (y * (t / z)) elif z <= 6.8e-76: tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+100) tmp = Float64(y + x); elseif (z <= -1.3e-84) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 6.8e-76) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.8e+100) tmp = y + x; elseif (z <= -1.3e-84) tmp = x - (y * (t / z)); elseif (z <= 6.8e-76) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+100], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.3e-84], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e-76], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+100}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-84}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-76}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -6.79999999999999988e100 or 6.7999999999999998e-76 < z Initial program 73.5%
Taylor expanded in z around inf 84.4%
+-commutative84.4%
Simplified84.4%
if -6.79999999999999988e100 < z < -1.3e-84Initial program 88.5%
Taylor expanded in a around 0 74.3%
Taylor expanded in z around 0 76.3%
associate-*r/76.3%
*-commutative76.3%
neg-mul-176.3%
distribute-lft-neg-in76.3%
associate-/l*78.6%
Simplified78.6%
Taylor expanded in x around 0 76.3%
mul-1-neg76.3%
associate-*l/78.6%
distribute-lft-neg-out78.6%
*-commutative78.6%
distribute-rgt-neg-in78.6%
sub-neg78.6%
Simplified78.6%
if -1.3e-84 < z < 6.7999999999999998e-76Initial program 99.0%
Taylor expanded in z around 0 84.1%
+-commutative84.1%
associate-/l*81.5%
associate-/r/84.4%
Simplified84.4%
Final simplification83.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+100)
(+ y x)
(if (<= z -1.85e-82)
(- x (/ y (/ z t)))
(if (<= z 1.9e-73) (+ x (* y (/ t a))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+100) {
tmp = y + x;
} else if (z <= -1.85e-82) {
tmp = x - (y / (z / t));
} else if (z <= 1.9e-73) {
tmp = x + (y * (t / a));
} 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 <= (-5.2d+100)) then
tmp = y + x
else if (z <= (-1.85d-82)) then
tmp = x - (y / (z / t))
else if (z <= 1.9d-73) then
tmp = x + (y * (t / a))
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 <= -5.2e+100) {
tmp = y + x;
} else if (z <= -1.85e-82) {
tmp = x - (y / (z / t));
} else if (z <= 1.9e-73) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+100: tmp = y + x elif z <= -1.85e-82: tmp = x - (y / (z / t)) elif z <= 1.9e-73: tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+100) tmp = Float64(y + x); elseif (z <= -1.85e-82) tmp = Float64(x - Float64(y / Float64(z / t))); elseif (z <= 1.9e-73) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+100) tmp = y + x; elseif (z <= -1.85e-82) tmp = x - (y / (z / t)); elseif (z <= 1.9e-73) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+100], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.85e-82], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-73], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+100}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-82}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-73}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -5.2000000000000003e100 or 1.9000000000000001e-73 < z Initial program 73.5%
Taylor expanded in z around inf 84.4%
+-commutative84.4%
Simplified84.4%
if -5.2000000000000003e100 < z < -1.85e-82Initial program 88.5%
Taylor expanded in a around 0 74.3%
Taylor expanded in z around 0 76.3%
associate-*r/76.3%
*-commutative76.3%
neg-mul-176.3%
distribute-lft-neg-in76.3%
associate-/l*78.6%
Simplified78.6%
if -1.85e-82 < z < 1.9000000000000001e-73Initial program 99.0%
Taylor expanded in z around 0 84.1%
+-commutative84.1%
associate-/l*81.5%
associate-/r/84.4%
Simplified84.4%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e-82) (not (<= z 0.032))) (+ x (/ y (/ z (- z t)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e-82) || !(z <= 0.032)) {
tmp = x + (y / (z / (z - t)));
} 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.85d-82)) .or. (.not. (z <= 0.032d0))) then
tmp = x + (y / (z / (z - t)))
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.85e-82) || !(z <= 0.032)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e-82) or not (z <= 0.032): tmp = x + (y / (z / (z - t))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e-82) || !(z <= 0.032)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e-82) || ~((z <= 0.032))) tmp = x + (y / (z / (z - t))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e-82], N[Not[LessEqual[z, 0.032]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-82} \lor \neg \left(z \leq 0.032\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.85e-82 or 0.032000000000000001 < z Initial program 75.7%
Taylor expanded in a around 0 67.6%
+-commutative67.6%
associate-/l*87.9%
Simplified87.9%
if -1.85e-82 < z < 0.032000000000000001Initial program 98.2%
Taylor expanded in z around 0 84.4%
+-commutative84.4%
associate-/l*82.3%
associate-/r/84.7%
Simplified84.7%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e-52) (not (<= z 4.2e-73))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e-52) || !(z <= 4.2e-73)) {
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 <= (-6.8d-52)) .or. (.not. (z <= 4.2d-73))) 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 <= -6.8e-52) || !(z <= 4.2e-73)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e-52) or not (z <= 4.2e-73): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.8e-52) || !(z <= 4.2e-73)) 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 <= -6.8e-52) || ~((z <= 4.2e-73))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.8e-52], N[Not[LessEqual[z, 4.2e-73]], $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 -6.8 \cdot 10^{-52} \lor \neg \left(z \leq 4.2 \cdot 10^{-73}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -6.80000000000000035e-52 or 4.1999999999999997e-73 < z Initial program 76.9%
Taylor expanded in z around inf 77.0%
+-commutative77.0%
Simplified77.0%
if -6.80000000000000035e-52 < z < 4.1999999999999997e-73Initial program 99.0%
Taylor expanded in z around 0 83.6%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e-19) (not (<= z 4e-73))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e-19) || !(z <= 4e-73)) {
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.85d-19)) .or. (.not. (z <= 4d-73))) 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.85e-19) || !(z <= 4e-73)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e-19) or not (z <= 4e-73): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e-19) || !(z <= 4e-73)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e-19) || ~((z <= 4e-73))) 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.85e-19], N[Not[LessEqual[z, 4e-73]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-19} \lor \neg \left(z \leq 4 \cdot 10^{-73}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.85000000000000003e-19 or 3.99999999999999999e-73 < z Initial program 77.3%
Taylor expanded in z around inf 78.6%
+-commutative78.6%
Simplified78.6%
if -1.85000000000000003e-19 < z < 3.99999999999999999e-73Initial program 97.2%
Taylor expanded in z around 0 79.9%
+-commutative79.9%
associate-/l*79.3%
associate-/r/82.0%
Simplified82.0%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.02e+55) (not (<= z 4.7e-74))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e+55) || !(z <= 4.7e-74)) {
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 ((z <= (-1.02d+55)) .or. (.not. (z <= 4.7d-74))) 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 ((z <= -1.02e+55) || !(z <= 4.7e-74)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.02e+55) or not (z <= 4.7e-74): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.02e+55) || !(z <= 4.7e-74)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.02e+55) || ~((z <= 4.7e-74))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.02e+55], N[Not[LessEqual[z, 4.7e-74]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+55} \lor \neg \left(z \leq 4.7 \cdot 10^{-74}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.02000000000000002e55 or 4.7000000000000001e-74 < z Initial program 74.4%
Taylor expanded in z around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -1.02000000000000002e55 < z < 4.7000000000000001e-74Initial program 97.6%
Taylor expanded in x around inf 59.7%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.6e+239) y (if (<= y 5.1e+188) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.6e+239) {
tmp = y;
} else if (y <= 5.1e+188) {
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 <= (-2.6d+239)) then
tmp = y
else if (y <= 5.1d+188) 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 <= -2.6e+239) {
tmp = y;
} else if (y <= 5.1e+188) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.6e+239: tmp = y elif y <= 5.1e+188: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.6e+239) tmp = y; elseif (y <= 5.1e+188) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.6e+239) tmp = y; elseif (y <= 5.1e+188) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.6e+239], y, If[LessEqual[y, 5.1e+188], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+239}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+188}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -2.6000000000000002e239 or 5.1000000000000002e188 < y Initial program 60.4%
Taylor expanded in x around 0 50.7%
Taylor expanded in z around inf 47.4%
if -2.6000000000000002e239 < y < 5.1000000000000002e188Initial program 90.5%
Taylor expanded in x around inf 66.0%
Final simplification62.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.6%
Taylor expanded in x around inf 57.5%
Final simplification57.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 2024018
(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))))