
(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 9 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 84.8%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.3%
Applied egg-rr99.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e+78)
(+ x y)
(if (<= z -17500.0)
(* y (- 1.0 (/ t z)))
(if (<= z -5.2e-298) x (if (<= z 6e-148) (* t (/ y (- a z))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+78) {
tmp = x + y;
} else if (z <= -17500.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= -5.2e-298) {
tmp = x;
} else if (z <= 6e-148) {
tmp = t * (y / (a - z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.2d+78)) then
tmp = x + y
else if (z <= (-17500.0d0)) then
tmp = y * (1.0d0 - (t / z))
else if (z <= (-5.2d-298)) then
tmp = x
else if (z <= 6d-148) then
tmp = t * (y / (a - z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+78) {
tmp = x + y;
} else if (z <= -17500.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= -5.2e-298) {
tmp = x;
} else if (z <= 6e-148) {
tmp = t * (y / (a - z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.2e+78: tmp = x + y elif z <= -17500.0: tmp = y * (1.0 - (t / z)) elif z <= -5.2e-298: tmp = x elif z <= 6e-148: tmp = t * (y / (a - z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+78) tmp = Float64(x + y); elseif (z <= -17500.0) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (z <= -5.2e-298) tmp = x; elseif (z <= 6e-148) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.2e+78) tmp = x + y; elseif (z <= -17500.0) tmp = y * (1.0 - (t / z)); elseif (z <= -5.2e-298) tmp = x; elseif (z <= 6e-148) tmp = t * (y / (a - z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+78], N[(x + y), $MachinePrecision], If[LessEqual[z, -17500.0], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.2e-298], x, If[LessEqual[z, 6e-148], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+78}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -17500:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-298}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-148}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.1999999999999999e78 or 5.99999999999999996e-148 < z Initial program 76.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6479.2%
Simplified79.2%
if -1.1999999999999999e78 < z < -17500Initial program 92.2%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
/-lowering-/.f64N/A
--lowering--.f6476.2%
Simplified76.2%
Taylor expanded in x around 0
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6468.6%
Simplified68.6%
if -17500 < z < -5.1999999999999998e-298Initial program 95.9%
Taylor expanded in x around inf
Simplified64.9%
if -5.1999999999999998e-298 < z < 5.99999999999999996e-148Initial program 97.7%
frac-2negN/A
div-invN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6457.9%
Simplified57.9%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6460.0%
Applied egg-rr60.0%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.2e-22) (+ x y) (if (<= z -1.6e-298) x (if (<= z 4.4e-149) (* t (/ y (- a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-22) {
tmp = x + y;
} else if (z <= -1.6e-298) {
tmp = x;
} else if (z <= 4.4e-149) {
tmp = t * (y / (a - z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.2d-22)) then
tmp = x + y
else if (z <= (-1.6d-298)) then
tmp = x
else if (z <= 4.4d-149) then
tmp = t * (y / (a - z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-22) {
tmp = x + y;
} else if (z <= -1.6e-298) {
tmp = x;
} else if (z <= 4.4e-149) {
tmp = t * (y / (a - z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.2e-22: tmp = x + y elif z <= -1.6e-298: tmp = x elif z <= 4.4e-149: tmp = t * (y / (a - z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e-22) tmp = Float64(x + y); elseif (z <= -1.6e-298) tmp = x; elseif (z <= 4.4e-149) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.2e-22) tmp = x + y; elseif (z <= -1.6e-298) tmp = x; elseif (z <= 4.4e-149) tmp = t * (y / (a - z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e-22], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.6e-298], x, If[LessEqual[z, 4.4e-149], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-22}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-298}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-149}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -7.1999999999999996e-22 or 4.3999999999999996e-149 < z Initial program 78.3%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6475.1%
Simplified75.1%
if -7.1999999999999996e-22 < z < -1.59999999999999999e-298Initial program 95.6%
Taylor expanded in x around inf
Simplified66.1%
if -1.59999999999999999e-298 < z < 4.3999999999999996e-149Initial program 97.7%
frac-2negN/A
div-invN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6457.9%
Simplified57.9%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6460.0%
Applied egg-rr60.0%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.4e-20) (+ x y) (if (<= z -7e-299) x (if (<= z 1.2e-184) (* t (/ y a)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e-20) {
tmp = x + y;
} else if (z <= -7e-299) {
tmp = x;
} else if (z <= 1.2e-184) {
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.4d-20)) then
tmp = x + y
else if (z <= (-7d-299)) then
tmp = x
else if (z <= 1.2d-184) 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.4e-20) {
tmp = x + y;
} else if (z <= -7e-299) {
tmp = x;
} else if (z <= 1.2e-184) {
tmp = t * (y / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.4e-20: tmp = x + y elif z <= -7e-299: tmp = x elif z <= 1.2e-184: tmp = t * (y / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e-20) tmp = Float64(x + y); elseif (z <= -7e-299) tmp = x; elseif (z <= 1.2e-184) 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.4e-20) tmp = x + y; elseif (z <= -7e-299) tmp = x; elseif (z <= 1.2e-184) tmp = t * (y / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e-20], N[(x + y), $MachinePrecision], If[LessEqual[z, -7e-299], x, If[LessEqual[z, 1.2e-184], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-20}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-299}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-184}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.4000000000000001e-20 or 1.20000000000000012e-184 < z Initial program 79.4%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6473.5%
Simplified73.5%
if -1.4000000000000001e-20 < z < -6.99999999999999981e-299Initial program 95.6%
Taylor expanded in x around inf
Simplified66.1%
if -6.99999999999999981e-299 < z < 1.20000000000000012e-184Initial program 97.3%
frac-2negN/A
div-invN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6458.1%
Simplified58.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6460.7%
Applied egg-rr60.7%
Taylor expanded in a around inf
/-lowering-/.f6457.5%
Simplified57.5%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* y (- 1.0 (/ t z)))))) (if (<= z -6e-66) t_1 (if (<= z 3.3e-50) (+ x (/ y (/ a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -6e-66) {
tmp = t_1;
} else if (z <= 3.3e-50) {
tmp = x + (y / (a / t));
} 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 * (1.0d0 - (t / z)))
if (z <= (-6d-66)) then
tmp = t_1
else if (z <= 3.3d-50) then
tmp = x + (y / (a / t))
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 * (1.0 - (t / z)));
double tmp;
if (z <= -6e-66) {
tmp = t_1;
} else if (z <= 3.3e-50) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -6e-66: tmp = t_1 elif z <= 3.3e-50: tmp = x + (y / (a / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -6e-66) tmp = t_1; elseif (z <= 3.3e-50) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -6e-66) tmp = t_1; elseif (z <= 3.3e-50) tmp = x + (y / (a / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e-66], t$95$1, If[LessEqual[z, 3.3e-50], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-50}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.0000000000000004e-66 or 3.2999999999999998e-50 < z Initial program 77.7%
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-/.f6488.6%
Simplified88.6%
if -6.0000000000000004e-66 < z < 3.2999999999999998e-50Initial program 95.3%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.3%
Applied egg-rr98.3%
Taylor expanded in z around 0
/-lowering-/.f6488.9%
Simplified88.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.3e+16) (+ x y) (if (<= z 0.0012) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+16) {
tmp = x + y;
} else if (z <= 0.0012) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.3d+16)) then
tmp = x + y
else if (z <= 0.0012d0) then
tmp = x + (y / (a / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+16) {
tmp = x + y;
} else if (z <= 0.0012) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+16: tmp = x + y elif z <= 0.0012: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+16) tmp = Float64(x + y); elseif (z <= 0.0012) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+16) tmp = x + y; elseif (z <= 0.0012) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+16], N[(x + y), $MachinePrecision], If[LessEqual[z, 0.0012], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+16}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 0.0012:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.3e16 or 0.00119999999999999989 < z Initial program 74.5%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6482.5%
Simplified82.5%
if -1.3e16 < z < 0.00119999999999999989Initial program 96.0%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.5%
Applied egg-rr98.5%
Taylor expanded in z around 0
/-lowering-/.f6482.9%
Simplified82.9%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.22e-23) (+ x y) (if (<= z 4.6e-40) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.22e-23) {
tmp = x + y;
} else if (z <= 4.6e-40) {
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 <= (-1.22d-23)) then
tmp = x + y
else if (z <= 4.6d-40) 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 <= -1.22e-23) {
tmp = x + y;
} else if (z <= 4.6e-40) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.22e-23: tmp = x + y elif z <= 4.6e-40: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.22e-23) tmp = Float64(x + y); elseif (z <= 4.6e-40) 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 <= -1.22e-23) tmp = x + y; elseif (z <= 4.6e-40) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.22e-23], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.6e-40], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{-23}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-40}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.22000000000000007e-23 or 4.6e-40 < z Initial program 76.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6478.4%
Simplified78.4%
if -1.22000000000000007e-23 < z < 4.6e-40Initial program 95.6%
Taylor expanded in x around inf
Simplified55.2%
Final simplification68.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -6e+134) y (if (<= y 1000.0) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6e+134) {
tmp = y;
} else if (y <= 1000.0) {
tmp = x;
} else {
tmp = 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 <= (-6d+134)) then
tmp = y
else if (y <= 1000.0d0) then
tmp = x
else
tmp = 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 <= -6e+134) {
tmp = y;
} else if (y <= 1000.0) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -6e+134: tmp = y elif y <= 1000.0: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -6e+134) tmp = y; elseif (y <= 1000.0) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -6e+134) tmp = y; elseif (y <= 1000.0) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -6e+134], y, If[LessEqual[y, 1000.0], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+134}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -5.99999999999999993e134 or 1e3 < y Initial program 70.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6456.9%
Simplified56.9%
Taylor expanded in y around inf
Simplified39.7%
if -5.99999999999999993e134 < y < 1e3Initial program 95.9%
Taylor expanded in x around inf
Simplified62.1%
(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 84.8%
Taylor expanded in x around inf
Simplified45.2%
(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 2024160
(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))))