
(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 (fma (/ (- z t) (- z a)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - t) / (z - a)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - t) / Float64(z - a)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - t}{z - a}, y, x\right)
\end{array}
Initial program 98.6%
+-commutativeN/A
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.7%
Applied egg-rr98.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.65e+93)
(+ y x)
(if (<= z -2e-22)
(* (- z t) (/ y (- z a)))
(if (<= z 8.6e+51) (+ x (/ y (/ a t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e+93) {
tmp = y + x;
} else if (z <= -2e-22) {
tmp = (z - t) * (y / (z - a));
} else if (z <= 8.6e+51) {
tmp = x + (y / (a / t));
} 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 <= (-1.65d+93)) then
tmp = y + x
else if (z <= (-2d-22)) then
tmp = (z - t) * (y / (z - a))
else if (z <= 8.6d+51) then
tmp = x + (y / (a / t))
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 <= -1.65e+93) {
tmp = y + x;
} else if (z <= -2e-22) {
tmp = (z - t) * (y / (z - a));
} else if (z <= 8.6e+51) {
tmp = x + (y / (a / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.65e+93: tmp = y + x elif z <= -2e-22: tmp = (z - t) * (y / (z - a)) elif z <= 8.6e+51: tmp = x + (y / (a / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e+93) tmp = Float64(y + x); elseif (z <= -2e-22) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); elseif (z <= 8.6e+51) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.65e+93) tmp = y + x; elseif (z <= -2e-22) tmp = (z - t) * (y / (z - a)); elseif (z <= 8.6e+51) tmp = x + (y / (a / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e+93], N[(y + x), $MachinePrecision], If[LessEqual[z, -2e-22], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e+51], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+93}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-22}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+51}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.65000000000000004e93 or 8.5999999999999994e51 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6482.4%
Simplified82.4%
if -1.65000000000000004e93 < z < -2.0000000000000001e-22Initial program 99.9%
+-commutativeN/A
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6474.9%
Simplified74.9%
if -2.0000000000000001e-22 < z < 8.5999999999999994e51Initial program 97.4%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6476.7%
Simplified76.7%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6477.4%
Applied egg-rr77.4%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6477.7%
Applied egg-rr77.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.6e+43) (+ x (* y (/ z (- z a)))) (if (<= z 4e-12) (+ x (* y (/ (- t z) a))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e+43) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 4e-12) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y * ((z - 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 (z <= (-3.6d+43)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 4d-12) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + (y * ((z - 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 (z <= -3.6e+43) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 4e-12) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.6e+43: tmp = x + (y * (z / (z - a))) elif z <= 4e-12: tmp = x + (y * ((t - z) / a)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e+43) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 4e-12) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.6e+43) tmp = x + (y * (z / (z - a))); elseif (z <= 4e-12) tmp = x + (y * ((t - z) / a)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e+43], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-12], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+43}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -3.6000000000000001e43Initial program 99.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
--lowering--.f6487.2%
Simplified87.2%
if -3.6000000000000001e43 < z < 3.99999999999999992e-12Initial program 97.3%
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--.f6480.4%
Simplified80.4%
if 3.99999999999999992e-12 < z Initial program 100.0%
Taylor expanded in z around inf
Simplified93.3%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e+25) (+ x (* y (/ z (- z a)))) (if (<= z 2e-13) (+ x (/ y (/ a t))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+25) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 2e-13) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y * ((z - 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 (z <= (-2.7d+25)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 2d-13) then
tmp = x + (y / (a / t))
else
tmp = x + (y * ((z - 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 (z <= -2.7e+25) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 2e-13) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e+25: tmp = x + (y * (z / (z - a))) elif z <= 2e-13: tmp = x + (y / (a / t)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e+25) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 2e-13) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e+25) tmp = x + (y * (z / (z - a))); elseif (z <= 2e-13) tmp = x + (y / (a / t)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e+25], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-13], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+25}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-13}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -2.7e25Initial program 99.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
--lowering--.f6487.8%
Simplified87.8%
if -2.7e25 < z < 2.0000000000000001e-13Initial program 97.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6477.9%
Applied egg-rr77.9%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6477.9%
Applied egg-rr77.9%
if 2.0000000000000001e-13 < z Initial program 100.0%
Taylor expanded in z around inf
Simplified93.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- z t) (/ y (- z a)))))
(if (<= t -2.6e+106)
t_1
(if (<= t 7.5e+205) (+ x (* y (/ z (- z a)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (z - a));
double tmp;
if (t <= -2.6e+106) {
tmp = t_1;
} else if (t <= 7.5e+205) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z - t) * (y / (z - a))
if (t <= (-2.6d+106)) then
tmp = t_1
else if (t <= 7.5d+205) then
tmp = x + (y * (z / (z - a)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (z - a));
double tmp;
if (t <= -2.6e+106) {
tmp = t_1;
} else if (t <= 7.5e+205) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) * (y / (z - a)) tmp = 0 if t <= -2.6e+106: tmp = t_1 elif t <= 7.5e+205: tmp = x + (y * (z / (z - a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * Float64(y / Float64(z - a))) tmp = 0.0 if (t <= -2.6e+106) tmp = t_1; elseif (t <= 7.5e+205) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) * (y / (z - a)); tmp = 0.0; if (t <= -2.6e+106) tmp = t_1; elseif (t <= 7.5e+205) tmp = x + (y * (z / (z - a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+106], t$95$1, If[LessEqual[t, 7.5e+205], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+205}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6000000000000002e106 or 7.5000000000000003e205 < t Initial program 96.9%
+-commutativeN/A
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.9%
Applied egg-rr96.9%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.2%
Simplified77.2%
if -2.6000000000000002e106 < t < 7.5000000000000003e205Initial program 99.2%
Taylor expanded in t around 0
/-lowering-/.f64N/A
--lowering--.f6485.4%
Simplified85.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -9e+77) (+ y x) (if (<= z 4.5e+52) (+ x (/ y (/ a t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e+77) {
tmp = y + x;
} else if (z <= 4.5e+52) {
tmp = x + (y / (a / t));
} 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 <= (-9d+77)) then
tmp = y + x
else if (z <= 4.5d+52) then
tmp = x + (y / (a / t))
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 <= -9e+77) {
tmp = y + x;
} else if (z <= 4.5e+52) {
tmp = x + (y / (a / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9e+77: tmp = y + x elif z <= 4.5e+52: tmp = x + (y / (a / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9e+77) tmp = Float64(y + x); elseif (z <= 4.5e+52) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9e+77) tmp = y + x; elseif (z <= 4.5e+52) tmp = x + (y / (a / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9e+77], N[(y + x), $MachinePrecision], If[LessEqual[z, 4.5e+52], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+77}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+52}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -9.00000000000000049e77 or 4.5e52 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6481.8%
Simplified81.8%
if -9.00000000000000049e77 < z < 4.5e52Initial program 97.7%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6473.4%
Simplified73.4%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6474.3%
Applied egg-rr74.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e+79) (+ y x) (if (<= z 3.6e-14) (+ x (/ t (/ a y))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+79) {
tmp = y + x;
} else if (z <= 3.6e-14) {
tmp = x + (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 <= (-7.5d+79)) then
tmp = y + x
else if (z <= 3.6d-14) then
tmp = x + (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 <= -7.5e+79) {
tmp = y + x;
} else if (z <= 3.6e-14) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e+79: tmp = y + x elif z <= 3.6e-14: tmp = x + (t / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e+79) tmp = Float64(y + x); elseif (z <= 3.6e-14) tmp = Float64(x + 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 <= -7.5e+79) tmp = y + x; elseif (z <= 3.6e-14) tmp = x + (t / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e+79], N[(y + x), $MachinePrecision], If[LessEqual[z, 3.6e-14], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+79}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-14}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -7.49999999999999967e79 or 3.5999999999999998e-14 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6480.8%
Simplified80.8%
if -7.49999999999999967e79 < z < 3.5999999999999998e-14Initial program 97.5%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6473.6%
Simplified73.6%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6474.3%
Applied egg-rr74.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+81) (+ y x) (if (<= z 1.04e+52) (+ x (* y (/ t a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+81) {
tmp = y + x;
} else if (z <= 1.04e+52) {
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 <= (-1.1d+81)) then
tmp = y + x
else if (z <= 1.04d+52) 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 <= -1.1e+81) {
tmp = y + x;
} else if (z <= 1.04e+52) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+81: tmp = y + x elif z <= 1.04e+52: tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+81) tmp = Float64(y + x); elseif (z <= 1.04e+52) 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 <= -1.1e+81) tmp = y + x; elseif (z <= 1.04e+52) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+81], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.04e+52], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+81}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.04 \cdot 10^{+52}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.09999999999999993e81 or 1.04e52 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6481.8%
Simplified81.8%
if -1.09999999999999993e81 < z < 1.04e52Initial program 97.7%
Taylor expanded in z around 0
/-lowering-/.f6473.6%
Simplified73.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1e+78) (+ y x) (if (<= z 2.45e-14) (+ x (* t (/ y a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+78) {
tmp = y + x;
} else if (z <= 2.45e-14) {
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 <= (-1d+78)) then
tmp = y + x
else if (z <= 2.45d-14) 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 <= -1e+78) {
tmp = y + x;
} else if (z <= 2.45e-14) {
tmp = x + (t * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e+78: tmp = y + x elif z <= 2.45e-14: tmp = x + (t * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+78) tmp = Float64(y + x); elseif (z <= 2.45e-14) 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 <= -1e+78) tmp = y + x; elseif (z <= 2.45e-14) tmp = x + (t * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+78], N[(y + x), $MachinePrecision], If[LessEqual[z, 2.45e-14], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+78}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-14}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.00000000000000001e78 or 2.44999999999999997e-14 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6480.8%
Simplified80.8%
if -1.00000000000000001e78 < z < 2.44999999999999997e-14Initial program 97.5%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6473.6%
Simplified73.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.4e+21) (+ y x) (if (<= z 1.95e-13) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.4e+21) {
tmp = y + x;
} else if (z <= 1.95e-13) {
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 <= (-8.4d+21)) then
tmp = y + x
else if (z <= 1.95d-13) 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 <= -8.4e+21) {
tmp = y + x;
} else if (z <= 1.95e-13) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.4e+21: tmp = y + x elif z <= 1.95e-13: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.4e+21) tmp = Float64(y + x); elseif (z <= 1.95e-13) 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 <= -8.4e+21) tmp = y + x; elseif (z <= 1.95e-13) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.4e+21], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.95e-13], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.4 \cdot 10^{+21}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -8.4e21 or 1.95000000000000002e-13 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6476.4%
Simplified76.4%
if -8.4e21 < z < 1.95000000000000002e-13Initial program 97.2%
Taylor expanded in x around inf
Simplified52.6%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
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) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 98.6%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.4e+245) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+245) {
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 (z <= (-2.4d+245)) 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 (z <= -2.4e+245) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e+245: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e+245) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.4e+245) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+245], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+245}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.3999999999999998e245Initial program 99.7%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6478.8%
Simplified78.8%
Taylor expanded in y around inf
Simplified54.6%
if -2.3999999999999998e245 < z Initial program 98.6%
Taylor expanded in x around inf
Simplified53.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 98.6%
Taylor expanded in x around inf
Simplified51.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 2024138
(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)))))