
(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 (if (<= (* y (/ (- z t) (- z a))) (- INFINITY)) (/ (* y (- z t)) (- z a)) (+ x (/ y (/ (- z a) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * ((z - t) / (z - a))) <= -((double) INFINITY)) {
tmp = (y * (z - t)) / (z - a);
} else {
tmp = x + (y / ((z - a) / (z - t)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * ((z - t) / (z - a))) <= -Double.POSITIVE_INFINITY) {
tmp = (y * (z - t)) / (z - a);
} else {
tmp = x + (y / ((z - a) / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y * ((z - t) / (z - a))) <= -math.inf: tmp = (y * (z - t)) / (z - a) else: tmp = x + (y / ((z - a) / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(y * Float64(Float64(z - t) / Float64(z - a))) <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(z - t)) / Float64(z - a)); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y * ((z - t) / (z - a))) <= -Inf) tmp = (y * (z - t)) / (z - a); else tmp = x + (y / ((z - a) / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \frac{z - t}{z - a} \leq -\infty:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < -inf.0Initial program 66.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 99.1%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.1%
Applied egg-rr99.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- z a))))) (if (<= t_1 (- INFINITY)) (/ (* y (- z t)) (- z a)) (+ 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)) {
tmp = (y * (z - t)) / (z - a);
} 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) {
tmp = (y * (z - t)) / (z - a);
} 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: tmp = (y * (z - t)) / (z - a) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(z - t)) / Float64(z - a)); 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) tmp = (y * (z - t)) / (z - a); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < -inf.0Initial program 66.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 99.1%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e+18) (+ y x) (if (<= z -6e-281) x (if (<= z 4.55e-234) (/ t (/ a y)) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+18) {
tmp = y + x;
} else if (z <= -6e-281) {
tmp = x;
} else if (z <= 4.55e-234) {
tmp = t / (a / y);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-6d+18)) then
tmp = y + x
else if (z <= (-6d-281)) then
tmp = x
else if (z <= 4.55d-234) then
tmp = t / (a / y)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+18) {
tmp = y + x;
} else if (z <= -6e-281) {
tmp = x;
} else if (z <= 4.55e-234) {
tmp = t / (a / y);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+18: tmp = y + x elif z <= -6e-281: tmp = x elif z <= 4.55e-234: tmp = t / (a / y) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+18) tmp = Float64(y + x); elseif (z <= -6e-281) tmp = x; elseif (z <= 4.55e-234) tmp = Float64(t / Float64(a / y)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e+18) tmp = y + x; elseif (z <= -6e-281) tmp = x; elseif (z <= 4.55e-234) tmp = t / (a / y); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+18], N[(y + x), $MachinePrecision], If[LessEqual[z, -6e-281], x, If[LessEqual[z, 4.55e-234], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+18}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-281}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.55 \cdot 10^{-234}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -6e18 or 4.54999999999999995e-234 < z Initial program 98.1%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6469.9%
Simplified69.9%
if -6e18 < z < -5.9999999999999995e-281Initial program 97.3%
Taylor expanded in x around inf
Simplified59.1%
if -5.9999999999999995e-281 < z < 4.54999999999999995e-234Initial program 93.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.6%
Simplified93.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6455.6%
Simplified55.6%
associate-*l/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6459.2%
Applied egg-rr59.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.5e+18) (+ y x) (if (<= z -7e-282) x (if (<= z 3.9e-234) (* t (/ y a)) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+18) {
tmp = y + x;
} else if (z <= -7e-282) {
tmp = x;
} else if (z <= 3.9e-234) {
tmp = t * (y / 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.5d+18)) then
tmp = y + x
else if (z <= (-7d-282)) then
tmp = x
else if (z <= 3.9d-234) then
tmp = t * (y / 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.5e+18) {
tmp = y + x;
} else if (z <= -7e-282) {
tmp = x;
} else if (z <= 3.9e-234) {
tmp = t * (y / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+18: tmp = y + x elif z <= -7e-282: tmp = x elif z <= 3.9e-234: tmp = t * (y / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+18) tmp = Float64(y + x); elseif (z <= -7e-282) tmp = x; elseif (z <= 3.9e-234) tmp = Float64(t * Float64(y / 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.5e+18) tmp = y + x; elseif (z <= -7e-282) tmp = x; elseif (z <= 3.9e-234) tmp = t * (y / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+18], N[(y + x), $MachinePrecision], If[LessEqual[z, -7e-282], x, If[LessEqual[z, 3.9e-234], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+18}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-282}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-234}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -6.5e18 or 3.9000000000000001e-234 < z Initial program 98.1%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6469.9%
Simplified69.9%
if -6.5e18 < z < -7.00000000000000013e-282Initial program 97.3%
Taylor expanded in x around inf
Simplified59.1%
if -7.00000000000000013e-282 < z < 3.9000000000000001e-234Initial program 93.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.6%
Simplified93.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6455.6%
Simplified55.6%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6458.8%
Applied egg-rr58.8%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.02e-24) (+ x (* t (/ y a))) (if (<= a 2.9e-54) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.02e-24) {
tmp = x + (t * (y / a));
} else if (a <= 2.9e-54) {
tmp = x + (y * ((z - 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 (a <= (-1.02d-24)) then
tmp = x + (t * (y / a))
else if (a <= 2.9d-54) then
tmp = x + (y * ((z - 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 (a <= -1.02e-24) {
tmp = x + (t * (y / a));
} else if (a <= 2.9e-54) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.02e-24: tmp = x + (t * (y / a)) elif a <= 2.9e-54: tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.02e-24) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 2.9e-54) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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 (a <= -1.02e-24) tmp = x + (t * (y / a)); elseif (a <= 2.9e-54) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.02e-24], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e-54], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{-24}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{-54}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -1.0200000000000001e-24Initial program 97.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6483.7%
Simplified83.7%
if -1.0200000000000001e-24 < a < 2.90000000000000015e-54Initial program 96.1%
Taylor expanded in z around inf
Simplified86.0%
if 2.90000000000000015e-54 < a Initial program 99.9%
Taylor expanded in z around 0
/-lowering-/.f6485.5%
Simplified85.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.8e-14) (+ y x) (if (<= z 5.5e+19) (+ x (* y (/ t a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e-14) {
tmp = y + x;
} else if (z <= 5.5e+19) {
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 <= (-3.8d-14)) then
tmp = y + x
else if (z <= 5.5d+19) 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 <= -3.8e-14) {
tmp = y + x;
} else if (z <= 5.5e+19) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e-14: tmp = y + x elif z <= 5.5e+19: tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e-14) tmp = Float64(y + x); elseif (z <= 5.5e+19) 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 <= -3.8e-14) tmp = y + x; elseif (z <= 5.5e+19) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e-14], N[(y + x), $MachinePrecision], If[LessEqual[z, 5.5e+19], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-14}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+19}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.8000000000000002e-14 or 5.5e19 < z Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6479.2%
Simplified79.2%
if -3.8000000000000002e-14 < z < 5.5e19Initial program 95.5%
Taylor expanded in z around 0
/-lowering-/.f6479.6%
Simplified79.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.2e+18) (+ y x) (if (<= z 1.3e+22) (+ x (* t (/ y a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e+18) {
tmp = y + x;
} else if (z <= 1.3e+22) {
tmp = x + (t * (y / 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 <= (-7.2d+18)) then
tmp = y + x
else if (z <= 1.3d+22) then
tmp = x + (t * (y / 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 <= -7.2e+18) {
tmp = y + x;
} else if (z <= 1.3e+22) {
tmp = x + (t * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.2e+18: tmp = y + x elif z <= 1.3e+22: tmp = x + (t * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e+18) tmp = Float64(y + x); elseif (z <= 1.3e+22) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.2e+18) tmp = y + x; elseif (z <= 1.3e+22) tmp = x + (t * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e+18], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.3e+22], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+18}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+22}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -7.2e18 or 1.3e22 < z Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6478.9%
Simplified78.9%
if -7.2e18 < z < 1.3e22Initial program 95.7%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6476.0%
Simplified76.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e+238) (* (- z t) (/ y z)) (if (<= t 7e+143) (+ y x) (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+238) {
tmp = (z - t) * (y / z);
} else if (t <= 7e+143) {
tmp = y + x;
} else {
tmp = 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 (t <= (-7d+238)) then
tmp = (z - t) * (y / z)
else if (t <= 7d+143) then
tmp = y + x
else
tmp = 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 (t <= -7e+238) {
tmp = (z - t) * (y / z);
} else if (t <= 7e+143) {
tmp = y + x;
} else {
tmp = y / (a / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e+238: tmp = (z - t) * (y / z) elif t <= 7e+143: tmp = y + x else: tmp = y / (a / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+238) tmp = Float64(Float64(z - t) * Float64(y / z)); elseif (t <= 7e+143) tmp = Float64(y + x); else tmp = Float64(y / Float64(a / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e+238) tmp = (z - t) * (y / z); elseif (t <= 7e+143) tmp = y + x; else tmp = y / (a / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+238], N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+143], N[(y + x), $MachinePrecision], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+238}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+143}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if t < -7.00000000000000005e238Initial program 80.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6455.4%
Simplified55.4%
Taylor expanded in z around inf
Simplified46.9%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6472.3%
Applied egg-rr72.3%
if -7.00000000000000005e238 < t < 7.00000000000000017e143Initial program 98.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6466.0%
Simplified66.0%
if 7.00000000000000017e143 < t Initial program 97.3%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6467.7%
Simplified67.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6447.3%
Simplified47.3%
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6455.1%
Applied egg-rr55.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -7.2e+145) (* y (- 1.0 (/ t z))) (if (<= y 4.7e+226) x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7.2e+145) {
tmp = y * (1.0 - (t / z));
} else if (y <= 4.7e+226) {
tmp = x;
} else {
tmp = t / (a / 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 <= (-7.2d+145)) then
tmp = y * (1.0d0 - (t / z))
else if (y <= 4.7d+226) then
tmp = x
else
tmp = t / (a / 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 <= -7.2e+145) {
tmp = y * (1.0 - (t / z));
} else if (y <= 4.7e+226) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -7.2e+145: tmp = y * (1.0 - (t / z)) elif y <= 4.7e+226: tmp = x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7.2e+145) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (y <= 4.7e+226) tmp = x; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -7.2e+145) tmp = y * (1.0 - (t / z)); elseif (y <= 4.7e+226) tmp = x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7.2e+145], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+226], x, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+145}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+226}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -7.19999999999999948e145Initial program 97.1%
Taylor expanded in z around inf
Simplified70.6%
Taylor expanded in x around 0
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6465.7%
Simplified65.7%
if -7.19999999999999948e145 < y < 4.69999999999999991e226Initial program 97.6%
Taylor expanded in x around inf
Simplified64.1%
if 4.69999999999999991e226 < y Initial program 95.1%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.1%
Simplified66.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6465.8%
Simplified65.8%
associate-*l/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6466.1%
Applied egg-rr66.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e+18) (+ y x) (if (<= z 1.7e-217) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+18) {
tmp = y + x;
} else if (z <= 1.7e-217) {
tmp = x;
} 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 <= (-6d+18)) then
tmp = y + x
else if (z <= 1.7d-217) then
tmp = x
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 <= -6e+18) {
tmp = y + x;
} else if (z <= 1.7e-217) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+18: tmp = y + x elif z <= 1.7e-217: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+18) tmp = Float64(y + x); elseif (z <= 1.7e-217) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e+18) tmp = y + x; elseif (z <= 1.7e-217) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+18], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.7e-217], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+18}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-217}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -6e18 or 1.70000000000000008e-217 < z Initial program 98.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6470.5%
Simplified70.5%
if -6e18 < z < 1.70000000000000008e-217Initial program 96.3%
Taylor expanded in x around inf
Simplified52.9%
(FPCore (x y z t a) :precision binary64 (if (<= y 4.2e+243) (+ y x) (* y (/ t a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.2e+243) {
tmp = y + x;
} else {
tmp = 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 (y <= 4.2d+243) then
tmp = y + x
else
tmp = 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 (y <= 4.2e+243) {
tmp = y + x;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 4.2e+243: tmp = y + x else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 4.2e+243) tmp = Float64(y + x); else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 4.2e+243) tmp = y + x; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 4.2e+243], N[(y + x), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{+243}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if y < 4.1999999999999999e243Initial program 97.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6461.1%
Simplified61.1%
if 4.1999999999999999e243 < y Initial program 93.5%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6480.9%
Simplified80.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.5%
Simplified80.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6474.2%
Applied egg-rr74.2%
Final simplification61.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.5e+154) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.5e+154) {
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 (y <= (-2.5d+154)) 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 (y <= -2.5e+154) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.5e+154: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.5e+154) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.5e+154) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.5e+154], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+154}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.50000000000000002e154Initial program 99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6439.9%
Simplified39.9%
Taylor expanded in z around inf
Simplified48.0%
if -2.50000000000000002e154 < y Initial program 97.0%
Taylor expanded in x around inf
Simplified58.0%
(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 97.3%
Taylor expanded in x around inf
Simplified53.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 2024161
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))