
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 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(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- t z) (- a z)))) (if (<= t_1 (- INFINITY)) (+ x (/ (* y t) (- a z))) (+ x (* y t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y * t_1);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - z) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y * t) / (a - z)) else: tmp = x + (y * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(y * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - z) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y * t) / (a - z)); else tmp = x + (y * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -inf.0Initial program 52.7%
Taylor expanded in t around inf 99.7%
mul-1-neg99.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if -inf.0 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.7%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-17) (not (<= z 4e-29))) (+ x (* y (/ z (- z a)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-17) || !(z <= 4e-29)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1d-17)) .or. (.not. (z <= 4d-29))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-17) || !(z <= 4e-29)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-17) or not (z <= 4e-29): tmp = x + (y * (z / (z - a))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-17) || !(z <= 4e-29)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e-17) || ~((z <= 4e-29))) tmp = x + (y * (z / (z - a))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-17], N[Not[LessEqual[z, 4e-29]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-17} \lor \neg \left(z \leq 4 \cdot 10^{-29}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.00000000000000007e-17 or 3.99999999999999977e-29 < z Initial program 99.9%
Taylor expanded in t around 0 64.5%
associate-/l*86.9%
Simplified86.9%
if -1.00000000000000007e-17 < z < 3.99999999999999977e-29Initial program 94.0%
Taylor expanded in z around 0 75.3%
associate-/l*81.8%
Simplified81.8%
Final simplification84.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.6e+44) (not (<= z 2.6e-9))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.6e+44) || !(z <= 2.6e-9)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.6d+44)) .or. (.not. (z <= 2.6d-9))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.6e+44) || !(z <= 2.6e-9)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.6e+44) or not (z <= 2.6e-9): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.6e+44) || !(z <= 2.6e-9)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.6e+44) || ~((z <= 2.6e-9))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.6e+44], N[Not[LessEqual[z, 2.6e-9]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+44} \lor \neg \left(z \leq 2.6 \cdot 10^{-9}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.6000000000000002e44 or 2.6000000000000001e-9 < z Initial program 99.9%
Taylor expanded in a around 0 62.6%
associate-/l*87.2%
div-sub87.2%
*-inverses87.2%
Simplified87.2%
if -5.6000000000000002e44 < z < 2.6000000000000001e-9Initial program 94.5%
Taylor expanded in z around 0 73.9%
associate-/l*79.8%
Simplified79.8%
Final simplification83.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.2e-15) (+ x (/ y (- 1.0 (/ a z)))) (if (<= z 1.55e+14) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-15) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 1.55e+14) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.2d-15)) then
tmp = x + (y / (1.0d0 - (a / z)))
else if (z <= 1.55d+14) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-15) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 1.55e+14) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.2e-15: tmp = x + (y / (1.0 - (a / z))) elif z <= 1.55e+14: tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e-15) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); elseif (z <= 1.55e+14) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.2e-15) tmp = x + (y / (1.0 - (a / z))); elseif (z <= 1.55e+14) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e-15], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+14], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-15}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+14}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -7.2000000000000002e-15Initial program 99.8%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 85.7%
div-sub85.7%
*-inverses85.7%
Simplified85.7%
if -7.2000000000000002e-15 < z < 1.55e14Initial program 94.4%
Taylor expanded in t around inf 87.9%
mul-1-neg87.9%
associate-/l*93.4%
Simplified93.4%
if 1.55e14 < z Initial program 100.0%
Taylor expanded in t around 0 66.0%
associate-/l*90.4%
Simplified90.4%
Final simplification90.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.15e-16)
(+ x (/ y (- 1.0 (/ a z))))
(if (<= z 55000000000000.0)
(+ x (/ (* y t) (- a z)))
(+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-16) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 55000000000000.0) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.15d-16)) then
tmp = x + (y / (1.0d0 - (a / z)))
else if (z <= 55000000000000.0d0) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-16) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 55000000000000.0) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.15e-16: tmp = x + (y / (1.0 - (a / z))) elif z <= 55000000000000.0: tmp = x + ((y * t) / (a - z)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.15e-16) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); elseif (z <= 55000000000000.0) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.15e-16) tmp = x + (y / (1.0 - (a / z))); elseif (z <= 55000000000000.0) tmp = x + ((y * t) / (a - z)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e-16], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 55000000000000.0], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{elif}\;z \leq 55000000000000:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.15e-16Initial program 99.8%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 85.7%
div-sub85.7%
*-inverses85.7%
Simplified85.7%
if -1.15e-16 < z < 5.5e13Initial program 94.4%
Taylor expanded in t around inf 87.9%
mul-1-neg87.9%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in x around 0 87.9%
if 5.5e13 < z Initial program 100.0%
Taylor expanded in t around 0 66.0%
associate-/l*90.4%
Simplified90.4%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.7e-15) (+ x (/ y (- 1.0 (/ a z)))) (if (<= z 1.35e-23) (+ x (* t (/ y a))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.7e-15) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 1.35e-23) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.7d-15)) then
tmp = x + (y / (1.0d0 - (a / z)))
else if (z <= 1.35d-23) then
tmp = x + (t * (y / a))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.7e-15) {
tmp = x + (y / (1.0 - (a / z)));
} else if (z <= 1.35e-23) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.7e-15: tmp = x + (y / (1.0 - (a / z))) elif z <= 1.35e-23: tmp = x + (t * (y / a)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.7e-15) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); elseif (z <= 1.35e-23) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.7e-15) tmp = x + (y / (1.0 - (a / z))); elseif (z <= 1.35e-23) tmp = x + (t * (y / a)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.7e-15], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-23], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{-15}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-23}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -5.7000000000000003e-15Initial program 99.8%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 85.7%
div-sub85.7%
*-inverses85.7%
Simplified85.7%
if -5.7000000000000003e-15 < z < 1.34999999999999992e-23Initial program 94.0%
Taylor expanded in z around 0 75.3%
associate-/l*81.8%
Simplified81.8%
if 1.34999999999999992e-23 < z Initial program 100.0%
Taylor expanded in t around 0 67.4%
associate-/l*88.4%
Simplified88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+153) (not (<= z 3.2e-9))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+153) || !(z <= 3.2e-9)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.9d+153)) .or. (.not. (z <= 3.2d-9))) then
tmp = x + y
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+153) || !(z <= 3.2e-9)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+153) or not (z <= 3.2e-9): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+153) || !(z <= 3.2e-9)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+153) || ~((z <= 3.2e-9))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+153], N[Not[LessEqual[z, 3.2e-9]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+153} \lor \neg \left(z \leq 3.2 \cdot 10^{-9}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.89999999999999983e153 or 3.20000000000000012e-9 < z Initial program 99.9%
Taylor expanded in z around inf 81.9%
if -1.89999999999999983e153 < z < 3.20000000000000012e-9Initial program 95.2%
Taylor expanded in z around 0 71.9%
associate-/l*77.7%
Simplified77.7%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e+224) (not (<= t 8.6e+195))) (* t (/ y (- z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e+224) || !(t <= 8.6e+195)) {
tmp = t * (y / -z);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.6d+224)) .or. (.not. (t <= 8.6d+195))) then
tmp = t * (y / -z)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e+224) || !(t <= 8.6e+195)) {
tmp = t * (y / -z);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.6e+224) or not (t <= 8.6e+195): tmp = t * (y / -z) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e+224) || !(t <= 8.6e+195)) tmp = Float64(t * Float64(y / Float64(-z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.6e+224) || ~((t <= 8.6e+195))) tmp = t * (y / -z); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.6e+224], N[Not[LessEqual[t, 8.6e+195]], $MachinePrecision]], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+224} \lor \neg \left(t \leq 8.6 \cdot 10^{+195}\right):\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.6e224 or 8.59999999999999962e195 < t Initial program 89.0%
Taylor expanded in t around inf 84.9%
mul-1-neg84.9%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 53.6%
mul-1-neg53.6%
sub-neg53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in x around 0 49.3%
mul-1-neg49.3%
associate-*l/43.0%
*-commutative43.0%
distribute-rgt-neg-in43.0%
distribute-neg-frac43.0%
Simplified43.0%
Taylor expanded in y around 0 49.3%
associate-*r/49.3%
*-commutative49.3%
associate-*r*49.3%
rem-cube-cbrt49.3%
associate-/l*49.2%
rem-cube-cbrt49.2%
*-commutative49.2%
mul-1-neg49.2%
Simplified49.2%
if -3.6e224 < t < 8.59999999999999962e195Initial program 98.6%
Taylor expanded in z around inf 66.1%
Final simplification63.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.9e+221) (not (<= t 4.1e+192))) (/ y (/ z (- t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.9e+221) || !(t <= 4.1e+192)) {
tmp = y / (z / -t);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.9d+221)) .or. (.not. (t <= 4.1d+192))) then
tmp = y / (z / -t)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.9e+221) || !(t <= 4.1e+192)) {
tmp = y / (z / -t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.9e+221) or not (t <= 4.1e+192): tmp = y / (z / -t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.9e+221) || !(t <= 4.1e+192)) tmp = Float64(y / Float64(z / Float64(-t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.9e+221) || ~((t <= 4.1e+192))) tmp = y / (z / -t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.9e+221], N[Not[LessEqual[t, 4.1e+192]], $MachinePrecision]], N[(y / N[(z / (-t)), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.9 \cdot 10^{+221} \lor \neg \left(t \leq 4.1 \cdot 10^{+192}\right):\\
\;\;\;\;\frac{y}{\frac{z}{-t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.9e221 or 4.10000000000000003e192 < t Initial program 89.0%
Taylor expanded in t around inf 84.9%
mul-1-neg84.9%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 53.6%
mul-1-neg53.6%
sub-neg53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in x around 0 49.3%
mul-1-neg49.3%
associate-*l/43.0%
*-commutative43.0%
distribute-rgt-neg-in43.0%
distribute-neg-frac43.0%
Simplified43.0%
distribute-frac-neg43.0%
distribute-rgt-neg-out43.0%
add-sqr-sqrt26.5%
sqrt-unprod22.4%
sqr-neg22.4%
sqrt-unprod2.8%
add-sqr-sqrt8.2%
clear-num8.2%
un-div-inv8.2%
add-sqr-sqrt2.8%
sqrt-unprod22.4%
sqr-neg22.4%
sqrt-unprod26.5%
add-sqr-sqrt44.2%
Applied egg-rr44.2%
if -6.9e221 < t < 4.10000000000000003e192Initial program 98.6%
Taylor expanded in z around inf 66.1%
Final simplification62.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -2e+223) (* t (/ y (- z))) (if (<= t 1.4e+197) (+ x y) (/ (* y t) (- z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e+223) {
tmp = t * (y / -z);
} else if (t <= 1.4e+197) {
tmp = x + y;
} else {
tmp = (y * t) / -z;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2d+223)) then
tmp = t * (y / -z)
else if (t <= 1.4d+197) then
tmp = x + y
else
tmp = (y * t) / -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e+223) {
tmp = t * (y / -z);
} else if (t <= 1.4e+197) {
tmp = x + y;
} else {
tmp = (y * t) / -z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2e+223: tmp = t * (y / -z) elif t <= 1.4e+197: tmp = x + y else: tmp = (y * t) / -z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2e+223) tmp = Float64(t * Float64(y / Float64(-z))); elseif (t <= 1.4e+197) tmp = Float64(x + y); else tmp = Float64(Float64(y * t) / Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2e+223) tmp = t * (y / -z); elseif (t <= 1.4e+197) tmp = x + y; else tmp = (y * t) / -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2e+223], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+197], N[(x + y), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+223}:\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+197}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{-z}\\
\end{array}
\end{array}
if t < -2.00000000000000009e223Initial program 88.0%
Taylor expanded in t around inf 82.2%
mul-1-neg82.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 50.5%
mul-1-neg50.5%
sub-neg50.5%
*-commutative50.5%
Simplified50.5%
Taylor expanded in x around 0 50.5%
mul-1-neg50.5%
associate-*l/45.2%
*-commutative45.2%
distribute-rgt-neg-in45.2%
distribute-neg-frac45.2%
Simplified45.2%
Taylor expanded in y around 0 50.5%
associate-*r/50.5%
*-commutative50.5%
associate-*r*50.5%
rem-cube-cbrt50.5%
associate-/l*56.3%
rem-cube-cbrt56.3%
*-commutative56.3%
mul-1-neg56.3%
Simplified56.3%
if -2.00000000000000009e223 < t < 1.3999999999999999e197Initial program 98.6%
Taylor expanded in z around inf 66.1%
if 1.3999999999999999e197 < t Initial program 89.6%
Taylor expanded in t around inf 86.5%
mul-1-neg86.5%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 55.3%
mul-1-neg55.3%
sub-neg55.3%
*-commutative55.3%
Simplified55.3%
Taylor expanded in x around 0 48.6%
associate-*r/48.6%
neg-mul-148.6%
*-commutative48.6%
distribute-rgt-neg-in48.6%
Simplified48.6%
Final simplification63.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e-17) (not (<= z 2.2e-27))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e-17) || !(z <= 2.2e-27)) {
tmp = x + y;
} 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 <= (-2.2d-17)) .or. (.not. (z <= 2.2d-27))) then
tmp = x + y
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 <= -2.2e-17) || !(z <= 2.2e-27)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e-17) or not (z <= 2.2e-27): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e-17) || !(z <= 2.2e-27)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.2e-17) || ~((z <= 2.2e-27))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e-17], N[Not[LessEqual[z, 2.2e-27]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-17} \lor \neg \left(z \leq 2.2 \cdot 10^{-27}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.2e-17 or 2.19999999999999987e-27 < z Initial program 99.9%
Taylor expanded in z around inf 75.2%
if -2.2e-17 < z < 2.19999999999999987e-27Initial program 94.0%
Taylor expanded in t around inf 88.6%
mul-1-neg88.6%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in x around inf 48.4%
Final simplification61.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 96.9%
clear-num96.9%
un-div-inv97.5%
Applied egg-rr97.5%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.9%
Taylor expanded in t around inf 73.6%
mul-1-neg73.6%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in x around inf 47.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024107
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))