
(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 11 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 (<= t_1 (- INFINITY))
(fma y (/ (- z t) (- z a)) x)
(if (<= t_1 5e+233) (+ t_1 x) (- x (/ 1.0 (/ (/ (- a z) y) (- z t))))))))
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)) {
tmp = fma(y, ((z - t) / (z - a)), x);
} else if (t_1 <= 5e+233) {
tmp = t_1 + x;
} else {
tmp = x - (1.0 / (((a - z) / y) / (z - t)));
}
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)) tmp = fma(y, Float64(Float64(z - t) / Float64(z - a)), x); elseif (t_1 <= 5e+233) tmp = Float64(t_1 + x); else tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(a - z) / y) / Float64(z - t)))); 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[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+233], N[(t$95$1 + x), $MachinePrecision], N[(x - N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+233}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{a - z}{y}}{z - t}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 55.9%
+-commutative55.9%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.00000000000000009e233Initial program 99.8%
if 5.00000000000000009e233 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 51.1%
clear-num51.1%
inv-pow51.1%
Applied egg-rr51.1%
unpow-151.1%
associate-/r*99.9%
Simplified99.9%
Final simplification99.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+233)))
(- x (/ 1.0 (/ (/ (- a z) y) (- 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 <= 5e+233)) {
tmp = x - (1.0 / (((a - z) / y) / (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 <= 5e+233)) {
tmp = x - (1.0 / (((a - z) / y) / (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 <= 5e+233): tmp = x - (1.0 / (((a - z) / y) / (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 <= 5e+233)) tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(a - z) / y) / 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 <= 5e+233))) tmp = x - (1.0 / (((a - z) / y) / (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, 5e+233]], $MachinePrecision]], N[(x - N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision] / 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 5 \cdot 10^{+233}\right):\\
\;\;\;\;x - \frac{1}{\frac{\frac{a - z}{y}}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 5.00000000000000009e233 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 52.7%
clear-num52.7%
inv-pow52.7%
Applied egg-rr52.7%
unpow-152.7%
associate-/r*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.00000000000000009e233Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e-24)
(+ y x)
(if (<= z 1.45e-65)
(+ x (/ (* y t) a))
(if (<= z 3.7e-11)
(* (- t z) (/ y (- a z)))
(if (<= z 1e+16) (- x (/ (* y z) a)) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-24) {
tmp = y + x;
} else if (z <= 1.45e-65) {
tmp = x + ((y * t) / a);
} else if (z <= 3.7e-11) {
tmp = (t - z) * (y / (a - z));
} else if (z <= 1e+16) {
tmp = x - ((y * z) / 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 <= (-3.1d-24)) then
tmp = y + x
else if (z <= 1.45d-65) then
tmp = x + ((y * t) / a)
else if (z <= 3.7d-11) then
tmp = (t - z) * (y / (a - z))
else if (z <= 1d+16) then
tmp = x - ((y * z) / 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 <= -3.1e-24) {
tmp = y + x;
} else if (z <= 1.45e-65) {
tmp = x + ((y * t) / a);
} else if (z <= 3.7e-11) {
tmp = (t - z) * (y / (a - z));
} else if (z <= 1e+16) {
tmp = x - ((y * z) / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e-24: tmp = y + x elif z <= 1.45e-65: tmp = x + ((y * t) / a) elif z <= 3.7e-11: tmp = (t - z) * (y / (a - z)) elif z <= 1e+16: tmp = x - ((y * z) / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e-24) tmp = Float64(y + x); elseif (z <= 1.45e-65) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= 3.7e-11) tmp = Float64(Float64(t - z) * Float64(y / Float64(a - z))); elseif (z <= 1e+16) tmp = Float64(x - Float64(Float64(y * z) / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e-24) tmp = y + x; elseif (z <= 1.45e-65) tmp = x + ((y * t) / a); elseif (z <= 3.7e-11) tmp = (t - z) * (y / (a - z)); elseif (z <= 1e+16) tmp = x - ((y * z) / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e-24], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.45e-65], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-11], N[(N[(t - z), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+16], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-24}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-11}:\\
\;\;\;\;\left(t - z\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 10^{+16}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.1e-24 or 1e16 < z Initial program 82.4%
Taylor expanded in z around inf 80.8%
+-commutative80.8%
Simplified80.8%
if -3.1e-24 < z < 1.4499999999999999e-65Initial program 97.5%
Taylor expanded in z around 0 79.2%
if 1.4499999999999999e-65 < z < 3.7000000000000001e-11Initial program 99.1%
Taylor expanded in x around 0 99.1%
associate-*l/99.7%
Simplified99.7%
if 3.7000000000000001e-11 < z < 1e16Initial program 100.0%
Taylor expanded in a around inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) (- z a)))) (if (<= t_1 5e+233) (+ t_1 x) (* (- t z) (/ y (- a z))))))
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 <= 5e+233) {
tmp = t_1 + x;
} else {
tmp = (t - z) * (y / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / (z - a)
if (t_1 <= 5d+233) then
tmp = t_1 + x
else
tmp = (t - z) * (y / (a - z))
end if
code = tmp
end function
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 <= 5e+233) {
tmp = t_1 + x;
} else {
tmp = (t - z) * (y / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= 5e+233: tmp = t_1 + x else: tmp = (t - z) * (y / (a - z)) 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 <= 5e+233) tmp = Float64(t_1 + x); else tmp = Float64(Float64(t - z) * Float64(y / Float64(a - z))); 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 <= 5e+233) tmp = t_1 + x; else tmp = (t - z) * (y / (a - z)); 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[LessEqual[t$95$1, 5e+233], N[(t$95$1 + x), $MachinePrecision], N[(N[(t - z), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+233}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;\left(t - z\right) \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.00000000000000009e233Initial program 96.4%
if 5.00000000000000009e233 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 51.1%
Taylor expanded in x around 0 51.1%
associate-*l/91.4%
Simplified91.4%
Final simplification95.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e-19) (not (<= z 1.8e+31))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e-19) || !(z <= 1.8e+31)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * ((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 <= (-4.2d-19)) .or. (.not. (z <= 1.8d+31))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y * ((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 <= -4.2e-19) || !(z <= 1.8e+31)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e-19) or not (z <= 1.8e+31): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e-19) || !(z <= 1.8e+31)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.2e-19) || ~((z <= 1.8e+31))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e-19], N[Not[LessEqual[z, 1.8e+31]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-19} \lor \neg \left(z \leq 1.8 \cdot 10^{+31}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -4.1999999999999998e-19 or 1.79999999999999998e31 < z Initial program 82.7%
Taylor expanded in a around 0 71.7%
associate-/l*87.4%
div-sub87.4%
*-inverses87.4%
Simplified87.4%
if -4.1999999999999998e-19 < z < 1.79999999999999998e31Initial program 97.0%
Taylor expanded in a around inf 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*79.1%
Simplified79.1%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-93) (not (<= z 2.3e-70))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-93) || !(z <= 2.3e-70)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-4.5d-93)) .or. (.not. (z <= 2.3d-70))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -4.5e-93) || !(z <= 2.3e-70)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-93) or not (z <= 2.3e-70): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-93) || !(z <= 2.3e-70)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -4.5e-93) || ~((z <= 2.3e-70))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-93], N[Not[LessEqual[z, 2.3e-70]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-93} \lor \neg \left(z \leq 2.3 \cdot 10^{-70}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.5000000000000002e-93 or 2.30000000000000001e-70 < z Initial program 85.2%
Taylor expanded in a around 0 71.0%
associate-/l*83.2%
div-sub83.2%
*-inverses83.2%
Simplified83.2%
if -4.5000000000000002e-93 < z < 2.30000000000000001e-70Initial program 97.9%
Taylor expanded in z around 0 81.5%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e-18) (not (<= z 7.8e-70))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-18) || !(z <= 7.8e-70)) {
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 <= (-4.8d-18)) .or. (.not. (z <= 7.8d-70))) 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 <= -4.8e-18) || !(z <= 7.8e-70)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e-18) or not (z <= 7.8e-70): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e-18) || !(z <= 7.8e-70)) 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 <= -4.8e-18) || ~((z <= 7.8e-70))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e-18], N[Not[LessEqual[z, 7.8e-70]], $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 -4.8 \cdot 10^{-18} \lor \neg \left(z \leq 7.8 \cdot 10^{-70}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.79999999999999988e-18 or 7.80000000000000038e-70 < z Initial program 83.8%
Taylor expanded in z around inf 78.8%
+-commutative78.8%
Simplified78.8%
if -4.79999999999999988e-18 < z < 7.80000000000000038e-70Initial program 97.4%
Taylor expanded in z around 0 79.1%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-22) (not (<= z 1.45e-69))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-22) || !(z <= 1.45e-69)) {
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.35d-22)) .or. (.not. (z <= 1.45d-69))) 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.35e-22) || !(z <= 1.45e-69)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-22) or not (z <= 1.45e-69): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-22) || !(z <= 1.45e-69)) 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.35e-22) || ~((z <= 1.45e-69))) 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.35e-22], N[Not[LessEqual[z, 1.45e-69]], $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.35 \cdot 10^{-22} \lor \neg \left(z \leq 1.45 \cdot 10^{-69}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-22 or 1.4499999999999999e-69 < z Initial program 83.8%
Taylor expanded in z around inf 78.8%
+-commutative78.8%
Simplified78.8%
if -1.3500000000000001e-22 < z < 1.4499999999999999e-69Initial program 97.4%
Taylor expanded in z around 0 79.1%
*-commutative79.1%
associate-/l*77.8%
Applied egg-rr77.8%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e-56) (not (<= z 3.5e-46))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e-56) || !(z <= 3.5e-46)) {
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 <= (-9.5d-56)) .or. (.not. (z <= 3.5d-46))) 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 <= -9.5e-56) || !(z <= 3.5e-46)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e-56) or not (z <= 3.5e-46): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e-56) || !(z <= 3.5e-46)) 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 <= -9.5e-56) || ~((z <= 3.5e-46))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e-56], N[Not[LessEqual[z, 3.5e-46]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-56} \lor \neg \left(z \leq 3.5 \cdot 10^{-46}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.4999999999999991e-56 or 3.5000000000000002e-46 < z Initial program 84.1%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -9.4999999999999991e-56 < z < 3.5000000000000002e-46Initial program 98.1%
Taylor expanded in x around inf 52.6%
Final simplification66.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -8.5e-76) x (if (<= x 7.5e-179) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -8.5e-76) {
tmp = x;
} else if (x <= 7.5e-179) {
tmp = 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 (x <= (-8.5d-76)) then
tmp = x
else if (x <= 7.5d-179) then
tmp = 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 (x <= -8.5e-76) {
tmp = x;
} else if (x <= 7.5e-179) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -8.5e-76: tmp = x elif x <= 7.5e-179: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -8.5e-76) tmp = x; elseif (x <= 7.5e-179) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -8.5e-76) tmp = x; elseif (x <= 7.5e-179) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -8.5e-76], x, If[LessEqual[x, 7.5e-179], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-179}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -8.50000000000000038e-76 or 7.4999999999999996e-179 < x Initial program 91.6%
Taylor expanded in x around inf 64.7%
if -8.50000000000000038e-76 < x < 7.4999999999999996e-179Initial program 86.6%
Taylor expanded in x around 0 72.1%
associate-*l/71.2%
Simplified71.2%
Taylor expanded in z around inf 36.8%
Taylor expanded in z around inf 36.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 90.2%
Taylor expanded in x around inf 51.7%
(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 2024087
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))