
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ 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 87.5%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.4%
Applied egg-rr97.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+19) (+ x y) (if (<= z -7e-282) x (if (<= z 2.4e-234) (* t (/ y a)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+19) {
tmp = x + y;
} else if (z <= -7e-282) {
tmp = x;
} else if (z <= 2.4e-234) {
tmp = t * (y / a);
} 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 (z <= (-1.9d+19)) then
tmp = x + y
else if (z <= (-7d-282)) then
tmp = x
else if (z <= 2.4d-234) then
tmp = t * (y / a)
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 (z <= -1.9e+19) {
tmp = x + y;
} else if (z <= -7e-282) {
tmp = x;
} else if (z <= 2.4e-234) {
tmp = t * (y / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+19: tmp = x + y elif z <= -7e-282: tmp = x elif z <= 2.4e-234: tmp = t * (y / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+19) tmp = Float64(x + y); elseif (z <= -7e-282) tmp = x; elseif (z <= 2.4e-234) tmp = Float64(t * Float64(y / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e+19) tmp = x + y; elseif (z <= -7e-282) tmp = x; elseif (z <= 2.4e-234) tmp = t * (y / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+19], N[(x + y), $MachinePrecision], If[LessEqual[z, -7e-282], x, If[LessEqual[z, 2.4e-234], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+19}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-282}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-234}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.9e19 or 2.3999999999999999e-234 < z Initial program 81.7%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6469.9%
Simplified69.9%
if -1.9e19 < z < -7.00000000000000013e-282Initial program 95.9%
Taylor expanded in x around inf
Simplified59.1%
if -7.00000000000000013e-282 < z < 2.3999999999999999e-234Initial program 96.7%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6493.5%
Simplified93.5%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.6%
Applied egg-rr93.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6458.8%
Simplified58.8%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* y (/ (- t z) a))))) (if (<= a -6.2e-25) t_1 (if (<= a 7.8e-54) (+ x (* (- z t) (/ y z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((t - z) / a));
double tmp;
if (a <= -6.2e-25) {
tmp = t_1;
} else if (a <= 7.8e-54) {
tmp = x + ((z - t) * (y / z));
} 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 + (y * ((t - z) / a))
if (a <= (-6.2d-25)) then
tmp = t_1
else if (a <= 7.8d-54) then
tmp = x + ((z - t) * (y / z))
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 + (y * ((t - z) / a));
double tmp;
if (a <= -6.2e-25) {
tmp = t_1;
} else if (a <= 7.8e-54) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((t - z) / a)) tmp = 0 if a <= -6.2e-25: tmp = t_1 elif a <= 7.8e-54: tmp = x + ((z - t) * (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(t - z) / a))) tmp = 0.0 if (a <= -6.2e-25) tmp = t_1; elseif (a <= 7.8e-54) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((t - z) / a)); tmp = 0.0; if (a <= -6.2e-25) tmp = t_1; elseif (a <= 7.8e-54) tmp = x + ((z - t) * (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.2e-25], t$95$1, If[LessEqual[a, 7.8e-54], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{t - z}{a}\\
\mathbf{if}\;a \leq -6.2 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-54}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.19999999999999989e-25 or 7.8e-54 < a Initial program 87.1%
Taylor expanded in a around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6487.9%
Simplified87.9%
if -6.19999999999999989e-25 < a < 7.8e-54Initial program 87.9%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.9%
Applied egg-rr96.9%
Taylor expanded in z around inf
Simplified86.5%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.8e-25) (+ x (* t (/ y a))) (if (<= a 4.9e-54) (+ x (* (- z t) (/ y z))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.8e-25) {
tmp = x + (t * (y / a));
} else if (a <= 4.9e-54) {
tmp = x + ((z - t) * (y / 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 <= (-2.8d-25)) then
tmp = x + (t * (y / a))
else if (a <= 4.9d-54) then
tmp = x + ((z - t) * (y / 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 <= -2.8e-25) {
tmp = x + (t * (y / a));
} else if (a <= 4.9e-54) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.8e-25: tmp = x + (t * (y / a)) elif a <= 4.9e-54: tmp = x + ((z - t) * (y / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.8e-25) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 4.9e-54) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / 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 <= -2.8e-25) tmp = x + (t * (y / a)); elseif (a <= 4.9e-54) tmp = x + ((z - t) * (y / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.8e-25], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.9e-54], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-25}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -2.79999999999999988e-25Initial program 87.1%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.8%
Simplified80.8%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6483.7%
Applied egg-rr83.7%
if -2.79999999999999988e-25 < a < 4.90000000000000021e-54Initial program 87.9%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.9%
Applied egg-rr96.9%
Taylor expanded in z around inf
Simplified86.5%
if 4.90000000000000021e-54 < a Initial program 87.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6479.9%
Simplified79.9%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6485.5%
Applied egg-rr85.5%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.6e-27) (+ x (* t (/ y a))) (if (<= a 3.3e-55) (- x (* y (+ (/ t z) -1.0))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.6e-27) {
tmp = x + (t * (y / a));
} else if (a <= 3.3e-55) {
tmp = x - (y * ((t / z) + -1.0));
} 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 <= (-5.6d-27)) then
tmp = x + (t * (y / a))
else if (a <= 3.3d-55) then
tmp = x - (y * ((t / z) + (-1.0d0)))
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 <= -5.6e-27) {
tmp = x + (t * (y / a));
} else if (a <= 3.3e-55) {
tmp = x - (y * ((t / z) + -1.0));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.6e-27: tmp = x + (t * (y / a)) elif a <= 3.3e-55: tmp = x - (y * ((t / z) + -1.0)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.6e-27) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 3.3e-55) tmp = Float64(x - Float64(y * Float64(Float64(t / z) + -1.0))); 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 <= -5.6e-27) tmp = x + (t * (y / a)); elseif (a <= 3.3e-55) tmp = x - (y * ((t / z) + -1.0)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.6e-27], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e-55], N[(x - N[(y * N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{-27}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-55}:\\
\;\;\;\;x - y \cdot \left(\frac{t}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -5.5999999999999999e-27Initial program 87.1%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.8%
Simplified80.8%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6483.7%
Applied egg-rr83.7%
if -5.5999999999999999e-27 < a < 3.2999999999999999e-55Initial program 87.9%
Taylor expanded in a around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6486.0%
Simplified86.0%
if 3.2999999999999999e-55 < a Initial program 87.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6479.9%
Simplified79.9%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6485.5%
Applied egg-rr85.5%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e-14) (+ x y) (if (<= z 2.9e+21) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-14) {
tmp = x + y;
} else if (z <= 2.9e+21) {
tmp = x + (y * (t / a));
} 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 (z <= (-1.6d-14)) then
tmp = x + y
else if (z <= 2.9d+21) then
tmp = x + (y * (t / a))
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 (z <= -1.6e-14) {
tmp = x + y;
} else if (z <= 2.9e+21) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-14: tmp = x + y elif z <= 2.9e+21: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-14) tmp = Float64(x + y); elseif (z <= 2.9e+21) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e-14) tmp = x + y; elseif (z <= 2.9e+21) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-14], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.9e+21], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+21}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.6000000000000001e-14 or 2.9e21 < z Initial program 75.4%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6479.2%
Simplified79.2%
if -1.6000000000000001e-14 < z < 2.9e21Initial program 96.1%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.1%
Simplified77.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6479.6%
Applied egg-rr79.6%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.05e+19) (+ x y) (if (<= z 6.2e+18) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+19) {
tmp = x + y;
} else if (z <= 6.2e+18) {
tmp = x + (t * (y / a));
} 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 (z <= (-1.05d+19)) then
tmp = x + y
else if (z <= 6.2d+18) then
tmp = x + (t * (y / a))
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 (z <= -1.05e+19) {
tmp = x + y;
} else if (z <= 6.2e+18) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+19: tmp = x + y elif z <= 6.2e+18: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+19) tmp = Float64(x + y); elseif (z <= 6.2e+18) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+19) tmp = x + y; elseif (z <= 6.2e+18) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+19], N[(x + y), $MachinePrecision], If[LessEqual[z, 6.2e+18], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+19}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+18}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.05e19 or 6.2e18 < z Initial program 73.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6478.9%
Simplified78.9%
if -1.05e19 < z < 6.2e18Initial program 96.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6477.3%
Simplified77.3%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6476.0%
Applied egg-rr76.0%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.25e+135) (* y (- 1.0 (/ t z))) (if (<= y 4.7e+226) x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.25e+135) {
tmp = y * (1.0 - (t / z));
} else if (y <= 4.7e+226) {
tmp = x;
} else {
tmp = 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 (y <= (-2.25d+135)) then
tmp = y * (1.0d0 - (t / z))
else if (y <= 4.7d+226) then
tmp = x
else
tmp = 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 (y <= -2.25e+135) {
tmp = y * (1.0 - (t / z));
} else if (y <= 4.7e+226) {
tmp = x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.25e+135: tmp = y * (1.0 - (t / z)) elif y <= 4.7e+226: tmp = x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.25e+135) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (y <= 4.7e+226) tmp = x; else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.25e+135) tmp = y * (1.0 - (t / z)); elseif (y <= 4.7e+226) tmp = x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.25e+135], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+226], x, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+135}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+226}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -2.25000000000000004e135Initial program 52.3%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.0%
Applied egg-rr97.0%
Taylor expanded in z around inf
Simplified70.5%
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 -2.25000000000000004e135 < y < 4.69999999999999991e226Initial program 94.3%
Taylor expanded in x around inf
Simplified64.1%
if 4.69999999999999991e226 < y Initial program 76.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6465.9%
Simplified65.9%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.1%
Applied egg-rr66.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.0%
Simplified66.0%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e+18) (+ x y) (if (<= z 2e-217) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+18) {
tmp = x + y;
} else if (z <= 2e-217) {
tmp = x;
} 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 (z <= (-6d+18)) then
tmp = x + y
else if (z <= 2d-217) then
tmp = x
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 (z <= -6e+18) {
tmp = x + y;
} else if (z <= 2e-217) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+18: tmp = x + y elif z <= 2e-217: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+18) tmp = Float64(x + y); elseif (z <= 2e-217) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e+18) tmp = x + y; elseif (z <= 2e-217) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+18], N[(x + y), $MachinePrecision], If[LessEqual[z, 2e-217], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+18}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-217}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6e18 or 2.00000000000000016e-217 < z Initial program 82.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6470.5%
Simplified70.5%
if -6e18 < z < 2.00000000000000016e-217Initial program 95.4%
Taylor expanded in x around inf
Simplified52.9%
Final simplification63.2%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 87.5%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.0%
Applied egg-rr97.0%
Final simplification97.0%
(FPCore (x y z t a) :precision binary64 (if (<= y 4.1e+243) (+ x y) (* y (/ t a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.1e+243) {
tmp = x + y;
} 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.1d+243) then
tmp = x + y
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.1e+243) {
tmp = x + y;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 4.1e+243: tmp = x + y else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 4.1e+243) tmp = Float64(x + y); 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.1e+243) tmp = x + y; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 4.1e+243], N[(x + y), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.1 \cdot 10^{+243}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if y < 4.10000000000000008e243Initial program 87.5%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6461.1%
Simplified61.1%
if 4.10000000000000008e243 < y Initial program 87.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.7%
Simplified80.7%
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 -1.05e+154) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.05e+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 <= (-1.05d+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 <= -1.05e+154) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.05e+154: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.05e+154) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.05e+154) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.05e+154], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+154}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.04999999999999997e154Initial program 52.3%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6453.3%
Simplified53.3%
Taylor expanded in y around inf
Simplified48.0%
if -1.04999999999999997e154 < y Initial program 92.4%
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 87.5%
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:renderAxisTicks 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))))