
(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 14 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 (+ 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 98.0%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.1%
Applied egg-rr98.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ y (/ (- z a) z))))) (if (<= z -5.1e-48) t_1 (if (<= z 1.7e-67) (+ x (* (/ y a) (- t z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -5.1e-48) {
tmp = t_1;
} else if (z <= 1.7e-67) {
tmp = x + ((y / a) * (t - 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 / ((z - a) / z))
if (z <= (-5.1d-48)) then
tmp = t_1
else if (z <= 1.7d-67) then
tmp = x + ((y / a) * (t - 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 / ((z - a) / z));
double tmp;
if (z <= -5.1e-48) {
tmp = t_1;
} else if (z <= 1.7e-67) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((z - a) / z)) tmp = 0 if z <= -5.1e-48: tmp = t_1 elif z <= 1.7e-67: tmp = x + ((y / a) * (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(z - a) / z))) tmp = 0.0 if (z <= -5.1e-48) tmp = t_1; elseif (z <= 1.7e-67) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((z - a) / z)); tmp = 0.0; if (z <= -5.1e-48) tmp = t_1; elseif (z <= 1.7e-67) tmp = x + ((y / a) * (t - 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[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.1e-48], t$95$1, If[LessEqual[z, 1.7e-67], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{if}\;z \leq -5.1 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-67}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.10000000000000011e-48 or 1.70000000000000005e-67 < z Initial program 99.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified88.3%
if -5.10000000000000011e-48 < z < 1.70000000000000005e-67Initial program 94.7%
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--.f6482.6%
Simplified82.6%
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.9%
Applied egg-rr85.9%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ y (/ (- z a) z))))) (if (<= z -2e-47) t_1 (if (<= z 3.9e-65) (+ x (* y (/ (- t z) a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -2e-47) {
tmp = t_1;
} else if (z <= 3.9e-65) {
tmp = x + (y * ((t - 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 = x + (y / ((z - a) / z))
if (z <= (-2d-47)) then
tmp = t_1
else if (z <= 3.9d-65) then
tmp = x + (y * ((t - 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 = x + (y / ((z - a) / z));
double tmp;
if (z <= -2e-47) {
tmp = t_1;
} else if (z <= 3.9e-65) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((z - a) / z)) tmp = 0 if z <= -2e-47: tmp = t_1 elif z <= 3.9e-65: tmp = x + (y * ((t - z) / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(z - a) / z))) tmp = 0.0 if (z <= -2e-47) tmp = t_1; elseif (z <= 3.9e-65) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((z - a) / z)); tmp = 0.0; if (z <= -2e-47) tmp = t_1; elseif (z <= 3.9e-65) tmp = x + (y * ((t - z) / a)); 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[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e-47], t$95$1, If[LessEqual[z, 3.9e-65], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{if}\;z \leq -2 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-65}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9999999999999999e-47 or 3.9000000000000004e-65 < z Initial program 99.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified88.3%
if -1.9999999999999999e-47 < z < 3.9000000000000004e-65Initial program 94.7%
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--.f6482.6%
Simplified82.6%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ y (/ (- z a) z))))) (if (<= z -1.96e-47) t_1 (if (<= z 1.06e-104) (+ x (* t (/ y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -1.96e-47) {
tmp = t_1;
} else if (z <= 1.06e-104) {
tmp = x + (t * (y / 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 = x + (y / ((z - a) / z))
if (z <= (-1.96d-47)) then
tmp = t_1
else if (z <= 1.06d-104) then
tmp = x + (t * (y / 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 = x + (y / ((z - a) / z));
double tmp;
if (z <= -1.96e-47) {
tmp = t_1;
} else if (z <= 1.06e-104) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((z - a) / z)) tmp = 0 if z <= -1.96e-47: tmp = t_1 elif z <= 1.06e-104: tmp = x + (t * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(z - a) / z))) tmp = 0.0 if (z <= -1.96e-47) tmp = t_1; elseif (z <= 1.06e-104) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((z - a) / z)); tmp = 0.0; if (z <= -1.96e-47) tmp = t_1; elseif (z <= 1.06e-104) tmp = x + (t * (y / a)); 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[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.96e-47], t$95$1, If[LessEqual[z, 1.06e-104], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{if}\;z \leq -1.96 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-104}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9600000000000001e-47 or 1.06e-104 < z Initial program 99.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified86.9%
if -1.9600000000000001e-47 < z < 1.06e-104Initial program 94.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6485.0%
Simplified85.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* y (/ z (- z a)))))) (if (<= z -1.25e-46) t_1 (if (<= z 2.6e-111) (+ x (* t (/ y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.25e-46) {
tmp = t_1;
} else if (z <= 2.6e-111) {
tmp = x + (t * (y / 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 = x + (y * (z / (z - a)))
if (z <= (-1.25d-46)) then
tmp = t_1
else if (z <= 2.6d-111) then
tmp = x + (t * (y / 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 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.25e-46) {
tmp = t_1;
} else if (z <= 2.6e-111) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -1.25e-46: tmp = t_1 elif z <= 2.6e-111: tmp = x + (t * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -1.25e-46) tmp = t_1; elseif (z <= 2.6e-111) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -1.25e-46) tmp = t_1; elseif (z <= 2.6e-111) tmp = x + (t * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e-46], t$95$1, If[LessEqual[z, 2.6e-111], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-111}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.24999999999999998e-46 or 2.59999999999999982e-111 < z Initial program 99.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
--lowering--.f6486.9%
Simplified86.9%
if -1.24999999999999998e-46 < z < 2.59999999999999982e-111Initial program 94.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6485.0%
Simplified85.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ t a)))))
(if (<= a -1.55e-10)
t_1
(if (<= a 1.2e+81) (+ x (* y (- 1.0 (/ t z)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (t / a));
double tmp;
if (a <= -1.55e-10) {
tmp = t_1;
} else if (a <= 1.2e+81) {
tmp = x + (y * (1.0 - (t / 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 / a))
if (a <= (-1.55d-10)) then
tmp = t_1
else if (a <= 1.2d+81) then
tmp = x + (y * (1.0d0 - (t / 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 / a));
double tmp;
if (a <= -1.55e-10) {
tmp = t_1;
} else if (a <= 1.2e+81) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (t / a)) tmp = 0 if a <= -1.55e-10: tmp = t_1 elif a <= 1.2e+81: tmp = x + (y * (1.0 - (t / z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(t / a))) tmp = 0.0 if (a <= -1.55e-10) tmp = t_1; elseif (a <= 1.2e+81) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (t / a)); tmp = 0.0; if (a <= -1.55e-10) tmp = t_1; elseif (a <= 1.2e+81) tmp = x + (y * (1.0 - (t / 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[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.55e-10], t$95$1, If[LessEqual[a, 1.2e+81], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{t}{a}\\
\mathbf{if}\;a \leq -1.55 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+81}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.55000000000000008e-10 or 1.19999999999999995e81 < a Initial program 99.9%
Taylor expanded in z around 0
/-lowering-/.f6480.6%
Simplified80.6%
if -1.55000000000000008e-10 < a < 1.19999999999999995e81Initial program 96.8%
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-/.f6484.7%
Simplified84.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.65e-38) (+ x y) (if (<= z 2.3e-51) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e-38) {
tmp = x + y;
} else if (z <= 2.3e-51) {
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.65d-38)) then
tmp = x + y
else if (z <= 2.3d-51) 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.65e-38) {
tmp = x + y;
} else if (z <= 2.3e-51) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.65e-38: tmp = x + y elif z <= 2.3e-51: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e-38) tmp = Float64(x + y); elseif (z <= 2.3e-51) 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.65e-38) tmp = x + y; elseif (z <= 2.3e-51) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e-38], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.3e-51], 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.65 \cdot 10^{-38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-51}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.6500000000000001e-38 or 2.30000000000000002e-51 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6477.9%
Simplified77.9%
if -1.6500000000000001e-38 < z < 2.30000000000000002e-51Initial program 95.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.5%
Simplified81.5%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e+242) (* y (- 0.0 (/ t z))) (if (<= t 3.25e+246) (+ x y) (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+242) {
tmp = y * (0.0 - (t / z));
} else if (t <= 3.25e+246) {
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 (t <= (-2.5d+242)) then
tmp = y * (0.0d0 - (t / z))
else if (t <= 3.25d+246) 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 (t <= -2.5e+242) {
tmp = y * (0.0 - (t / z));
} else if (t <= 3.25e+246) {
tmp = x + y;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.5e+242: tmp = y * (0.0 - (t / z)) elif t <= 3.25e+246: tmp = x + y else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e+242) tmp = Float64(y * Float64(0.0 - Float64(t / z))); elseif (t <= 3.25e+246) tmp = Float64(x + y); else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.5e+242) tmp = y * (0.0 - (t / z)); elseif (t <= 3.25e+246) tmp = x + y; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e+242], N[(y * N[(0.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.25e+246], N[(x + y), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+242}:\\
\;\;\;\;y \cdot \left(0 - \frac{t}{z}\right)\\
\mathbf{elif}\;t \leq 3.25 \cdot 10^{+246}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -2.5000000000000002e242Initial program 92.9%
Taylor expanded in z around inf
Simplified71.2%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6459.7%
Simplified59.7%
sub0-negN/A
neg-lowering-neg.f6459.7%
Applied egg-rr59.7%
associate-/l*N/A
*-commutativeN/A
distribute-frac-negN/A
distribute-lft-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6459.7%
Applied egg-rr59.7%
if -2.5000000000000002e242 < t < 3.24999999999999988e246Initial program 98.7%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6471.2%
Simplified71.2%
if 3.24999999999999988e246 < t Initial program 92.1%
Taylor expanded in z around 0
/-lowering-/.f6468.0%
Simplified68.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6475.8%
Simplified75.8%
Final simplification70.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e+238) (* t (/ (- 0.0 y) z)) (if (<= t 1.8e+246) (+ x y) (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e+238) {
tmp = t * ((0.0 - y) / z);
} else if (t <= 1.8e+246) {
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 (t <= (-3.8d+238)) then
tmp = t * ((0.0d0 - y) / z)
else if (t <= 1.8d+246) 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 (t <= -3.8e+238) {
tmp = t * ((0.0 - y) / z);
} else if (t <= 1.8e+246) {
tmp = x + y;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e+238: tmp = t * ((0.0 - y) / z) elif t <= 1.8e+246: tmp = x + y else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e+238) tmp = Float64(t * Float64(Float64(0.0 - y) / z)); elseif (t <= 1.8e+246) tmp = Float64(x + y); else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.8e+238) tmp = t * ((0.0 - y) / z); elseif (t <= 1.8e+246) tmp = x + y; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e+238], N[(t * N[(N[(0.0 - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+246], N[(x + y), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+238}:\\
\;\;\;\;t \cdot \frac{0 - y}{z}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+246}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -3.80000000000000024e238Initial program 92.9%
Taylor expanded in z around inf
Simplified71.2%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6459.7%
Simplified59.7%
sub0-negN/A
neg-lowering-neg.f6459.7%
Applied egg-rr59.7%
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6459.3%
Applied egg-rr59.3%
if -3.80000000000000024e238 < t < 1.8e246Initial program 98.7%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6471.2%
Simplified71.2%
if 1.8e246 < t Initial program 92.1%
Taylor expanded in z around 0
/-lowering-/.f6468.0%
Simplified68.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6475.8%
Simplified75.8%
Final simplification70.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y t) a))) (if (<= t -5.8e+258) t_1 (if (<= t 1.05e+245) (+ x y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / a;
double tmp;
if (t <= -5.8e+258) {
tmp = t_1;
} else if (t <= 1.05e+245) {
tmp = x + y;
} 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 = (y * t) / a
if (t <= (-5.8d+258)) then
tmp = t_1
else if (t <= 1.05d+245) then
tmp = x + y
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 = (y * t) / a;
double tmp;
if (t <= -5.8e+258) {
tmp = t_1;
} else if (t <= 1.05e+245) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * t) / a tmp = 0 if t <= -5.8e+258: tmp = t_1 elif t <= 1.05e+245: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * t) / a) tmp = 0.0 if (t <= -5.8e+258) tmp = t_1; elseif (t <= 1.05e+245) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * t) / a; tmp = 0.0; if (t <= -5.8e+258) tmp = t_1; elseif (t <= 1.05e+245) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t, -5.8e+258], t$95$1, If[LessEqual[t, 1.05e+245], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot t}{a}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+258}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+245}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.8000000000000002e258 or 1.04999999999999998e245 < t Initial program 92.0%
Taylor expanded in z around 0
/-lowering-/.f6467.7%
Simplified67.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6467.7%
Simplified67.7%
if -5.8000000000000002e258 < t < 1.04999999999999998e245Initial program 98.7%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6470.7%
Simplified70.7%
Final simplification70.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.5e+112) y (if (<= y 2.6e+106) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.5e+112) {
tmp = y;
} else if (y <= 2.6e+106) {
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 <= (-5.5d+112)) then
tmp = y
else if (y <= 2.6d+106) 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 <= -5.5e+112) {
tmp = y;
} else if (y <= 2.6e+106) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.5e+112: tmp = y elif y <= 2.6e+106: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.5e+112) tmp = y; elseif (y <= 2.6e+106) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.5e+112) tmp = y; elseif (y <= 2.6e+106) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.5e+112], y, If[LessEqual[y, 2.6e+106], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+112}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -5.50000000000000026e112 or 2.6000000000000002e106 < y Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6453.4%
Simplified53.4%
Taylor expanded in y around inf
Simplified44.3%
if -5.50000000000000026e112 < y < 2.6000000000000002e106Initial program 97.1%
Taylor expanded in x around inf
Simplified65.5%
(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}
Initial program 98.0%
(FPCore (x y z t a) :precision binary64 (if (<= a 2e+116) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2e+116) {
tmp = x + 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 (a <= 2d+116) then
tmp = x + 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 (a <= 2e+116) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2e+116: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2e+116) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 2e+116) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2e+116], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2 \cdot 10^{+116}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.00000000000000003e116Initial program 97.7%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6469.4%
Simplified69.4%
if 2.00000000000000003e116 < a Initial program 99.9%
Taylor expanded in x around inf
Simplified63.5%
Final simplification68.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.0%
Taylor expanded in x around inf
Simplified48.6%
(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 2024158
(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)))))