
(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 12 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 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 85.5%
+-commutative85.5%
associate-/l*99.1%
fma-define99.1%
Simplified99.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e+111)
(+ y x)
(if (<= z -1.28e-85)
(+ x (/ (* y (- z t)) z))
(if (<= z 19000000000000.0)
(+ x (* y (/ t a)))
(if (<= z 3e+48) (- x (* y (/ z a))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+111) {
tmp = y + x;
} else if (z <= -1.28e-85) {
tmp = x + ((y * (z - t)) / z);
} else if (z <= 19000000000000.0) {
tmp = x + (y * (t / a));
} else if (z <= 3e+48) {
tmp = x - (y * (z / 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 <= (-5.5d+111)) then
tmp = y + x
else if (z <= (-1.28d-85)) then
tmp = x + ((y * (z - t)) / z)
else if (z <= 19000000000000.0d0) then
tmp = x + (y * (t / a))
else if (z <= 3d+48) then
tmp = x - (y * (z / 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 <= -5.5e+111) {
tmp = y + x;
} else if (z <= -1.28e-85) {
tmp = x + ((y * (z - t)) / z);
} else if (z <= 19000000000000.0) {
tmp = x + (y * (t / a));
} else if (z <= 3e+48) {
tmp = x - (y * (z / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+111: tmp = y + x elif z <= -1.28e-85: tmp = x + ((y * (z - t)) / z) elif z <= 19000000000000.0: tmp = x + (y * (t / a)) elif z <= 3e+48: tmp = x - (y * (z / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+111) tmp = Float64(y + x); elseif (z <= -1.28e-85) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / z)); elseif (z <= 19000000000000.0) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 3e+48) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+111) tmp = y + x; elseif (z <= -1.28e-85) tmp = x + ((y * (z - t)) / z); elseif (z <= 19000000000000.0) tmp = x + (y * (t / a)); elseif (z <= 3e+48) tmp = x - (y * (z / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+111], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.28e-85], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 19000000000000.0], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+48], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+111}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.28 \cdot 10^{-85}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z}\\
\mathbf{elif}\;z \leq 19000000000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+48}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -5.4999999999999998e111 or 3e48 < z Initial program 67.5%
Taylor expanded in z around inf 88.0%
+-commutative88.0%
Simplified88.0%
if -5.4999999999999998e111 < z < -1.28000000000000002e-85Initial program 97.5%
Taylor expanded in a around 0 83.3%
if -1.28000000000000002e-85 < z < 1.9e13Initial program 93.4%
associate-/l*98.2%
*-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 85.3%
if 1.9e13 < z < 3e48Initial program 92.7%
Taylor expanded in a around inf 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in z around inf 76.9%
associate-/l*84.0%
Simplified84.0%
Final simplification85.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -2.4e-71)
t_1
(if (<= z 4.8e-54)
(+ x (/ y (/ a (- t z))))
(if (<= z 1.2e+50) t_1 (+ x (* y (/ (- z t) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -2.4e-71) {
tmp = t_1;
} else if (z <= 4.8e-54) {
tmp = x + (y / (a / (t - z)));
} else if (z <= 1.2e+50) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y * (z / (z - a)))
if (z <= (-2.4d-71)) then
tmp = t_1
else if (z <= 4.8d-54) then
tmp = x + (y / (a / (t - z)))
else if (z <= 1.2d+50) then
tmp = t_1
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 t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -2.4e-71) {
tmp = t_1;
} else if (z <= 4.8e-54) {
tmp = x + (y / (a / (t - z)));
} else if (z <= 1.2e+50) {
tmp = t_1;
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -2.4e-71: tmp = t_1 elif z <= 4.8e-54: tmp = x + (y / (a / (t - z))) elif z <= 1.2e+50: tmp = t_1 else: tmp = x + (y * ((z - t) / z)) 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 <= -2.4e-71) tmp = t_1; elseif (z <= 4.8e-54) tmp = Float64(x + Float64(y / Float64(a / Float64(t - z)))); elseif (z <= 1.2e+50) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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 <= -2.4e-71) tmp = t_1; elseif (z <= 4.8e-54) tmp = x + (y / (a / (t - z))); elseif (z <= 1.2e+50) tmp = t_1; else tmp = x + (y * ((z - t) / z)); 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, -2.4e-71], t$95$1, If[LessEqual[z, 4.8e-54], N[(x + N[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+50], t$95$1, N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-54}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -2.4e-71 or 4.80000000000000026e-54 < z < 1.2000000000000001e50Initial program 81.9%
Taylor expanded in t around 0 72.3%
+-commutative72.3%
associate-/l*87.8%
Simplified87.8%
if -2.4e-71 < z < 4.80000000000000026e-54Initial program 94.2%
Taylor expanded in a around inf 85.1%
mul-1-neg85.1%
unsub-neg85.1%
associate-/l*88.3%
Simplified88.3%
clear-num88.3%
un-div-inv88.3%
Applied egg-rr88.3%
if 1.2000000000000001e50 < z Initial program 69.4%
Taylor expanded in a around 0 67.8%
+-commutative67.8%
associate-/l*98.4%
Simplified98.4%
Final simplification89.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -1.75e-78)
t_1
(if (<= z 2.4e-55)
(+ x (* y (/ (- t z) a)))
(if (<= z 1.12e+52) t_1 (+ x (* y (/ (- z t) z))))))))
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.75e-78) {
tmp = t_1;
} else if (z <= 2.4e-55) {
tmp = x + (y * ((t - z) / a));
} else if (z <= 1.12e+52) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y * (z / (z - a)))
if (z <= (-1.75d-78)) then
tmp = t_1
else if (z <= 2.4d-55) then
tmp = x + (y * ((t - z) / a))
else if (z <= 1.12d+52) then
tmp = t_1
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 t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.75e-78) {
tmp = t_1;
} else if (z <= 2.4e-55) {
tmp = x + (y * ((t - z) / a));
} else if (z <= 1.12e+52) {
tmp = t_1;
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -1.75e-78: tmp = t_1 elif z <= 2.4e-55: tmp = x + (y * ((t - z) / a)) elif z <= 1.12e+52: tmp = t_1 else: tmp = x + (y * ((z - t) / z)) 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.75e-78) tmp = t_1; elseif (z <= 2.4e-55) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (z <= 1.12e+52) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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.75e-78) tmp = t_1; elseif (z <= 2.4e-55) tmp = x + (y * ((t - z) / a)); elseif (z <= 1.12e+52) tmp = t_1; else tmp = x + (y * ((z - t) / z)); 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.75e-78], t$95$1, If[LessEqual[z, 2.4e-55], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+52], t$95$1, N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-55}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -1.75e-78 or 2.39999999999999991e-55 < z < 1.12000000000000002e52Initial program 81.9%
Taylor expanded in t around 0 72.3%
+-commutative72.3%
associate-/l*87.8%
Simplified87.8%
if -1.75e-78 < z < 2.39999999999999991e-55Initial program 94.2%
Taylor expanded in a around inf 85.1%
mul-1-neg85.1%
unsub-neg85.1%
associate-/l*88.3%
Simplified88.3%
if 1.12000000000000002e52 < z Initial program 69.4%
Taylor expanded in a around 0 67.8%
+-commutative67.8%
associate-/l*98.4%
Simplified98.4%
Final simplification89.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -3.9e-72)
t_1
(if (<= z 2e-53)
(+ x (* y (/ t a)))
(if (<= z 4.8e+51) t_1 (+ x (* y (/ (- z t) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -3.9e-72) {
tmp = t_1;
} else if (z <= 2e-53) {
tmp = x + (y * (t / a));
} else if (z <= 4.8e+51) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y * (z / (z - a)))
if (z <= (-3.9d-72)) then
tmp = t_1
else if (z <= 2d-53) then
tmp = x + (y * (t / a))
else if (z <= 4.8d+51) then
tmp = t_1
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 t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -3.9e-72) {
tmp = t_1;
} else if (z <= 2e-53) {
tmp = x + (y * (t / a));
} else if (z <= 4.8e+51) {
tmp = t_1;
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -3.9e-72: tmp = t_1 elif z <= 2e-53: tmp = x + (y * (t / a)) elif z <= 4.8e+51: tmp = t_1 else: tmp = x + (y * ((z - t) / z)) 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 <= -3.9e-72) tmp = t_1; elseif (z <= 2e-53) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 4.8e+51) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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 <= -3.9e-72) tmp = t_1; elseif (z <= 2e-53) tmp = x + (y * (t / a)); elseif (z <= 4.8e+51) tmp = t_1; else tmp = x + (y * ((z - t) / z)); 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, -3.9e-72], t$95$1, If[LessEqual[z, 2e-53], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+51], t$95$1, N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -3.9e-72 or 2.00000000000000006e-53 < z < 4.7999999999999997e51Initial program 81.9%
Taylor expanded in t around 0 72.3%
+-commutative72.3%
associate-/l*87.8%
Simplified87.8%
if -3.9e-72 < z < 2.00000000000000006e-53Initial program 94.2%
associate-/l*98.2%
*-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 86.4%
if 4.7999999999999997e51 < z Initial program 69.4%
Taylor expanded in a around 0 67.8%
+-commutative67.8%
associate-/l*98.4%
Simplified98.4%
Final simplification88.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.9e-69)
(+ y x)
(if (<= z 11600000000000.0)
(+ x (* y (/ t a)))
(if (<= z 2.2e+49) (- x (* y (/ z a))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-69) {
tmp = y + x;
} else if (z <= 11600000000000.0) {
tmp = x + (y * (t / a));
} else if (z <= 2.2e+49) {
tmp = x - (y * (z / 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.9d-69)) then
tmp = y + x
else if (z <= 11600000000000.0d0) then
tmp = x + (y * (t / a))
else if (z <= 2.2d+49) then
tmp = x - (y * (z / 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.9e-69) {
tmp = y + x;
} else if (z <= 11600000000000.0) {
tmp = x + (y * (t / a));
} else if (z <= 2.2e+49) {
tmp = x - (y * (z / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-69: tmp = y + x elif z <= 11600000000000.0: tmp = x + (y * (t / a)) elif z <= 2.2e+49: tmp = x - (y * (z / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-69) tmp = Float64(y + x); elseif (z <= 11600000000000.0) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 2.2e+49) tmp = Float64(x - Float64(y * Float64(z / 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.9e-69) tmp = y + x; elseif (z <= 11600000000000.0) tmp = x + (y * (t / a)); elseif (z <= 2.2e+49) tmp = x - (y * (z / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-69], N[(y + x), $MachinePrecision], If[LessEqual[z, 11600000000000.0], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+49], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-69}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 11600000000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+49}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-69 or 2.2000000000000001e49 < z Initial program 76.0%
Taylor expanded in z around inf 82.4%
+-commutative82.4%
Simplified82.4%
if -1.8999999999999999e-69 < z < 1.16e13Initial program 93.8%
associate-/l*98.3%
*-commutative98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 85.2%
if 1.16e13 < z < 2.2000000000000001e49Initial program 92.7%
Taylor expanded in a around inf 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in z around inf 76.9%
associate-/l*84.0%
Simplified84.0%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e-73) (not (<= z 6.8e-53))) (+ x (* y (/ z (- z a)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e-73) || !(z <= 6.8e-53)) {
tmp = x + (y * (z / (z - a)));
} 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 ((z <= (-8.2d-73)) .or. (.not. (z <= 6.8d-53))) then
tmp = x + (y * (z / (z - a)))
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 ((z <= -8.2e-73) || !(z <= 6.8e-53)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e-73) or not (z <= 6.8e-53): tmp = x + (y * (z / (z - a))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e-73) || !(z <= 6.8e-53)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); 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 ((z <= -8.2e-73) || ~((z <= 6.8e-53))) tmp = x + (y * (z / (z - a))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e-73], N[Not[LessEqual[z, 6.8e-53]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-73} \lor \neg \left(z \leq 6.8 \cdot 10^{-53}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -8.20000000000000032e-73 or 6.8e-53 < z Initial program 78.4%
Taylor expanded in t around 0 70.1%
+-commutative70.1%
associate-/l*88.0%
Simplified88.0%
if -8.20000000000000032e-73 < z < 6.8e-53Initial program 94.2%
associate-/l*98.2%
*-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 86.4%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e-65) (+ x (* y (/ z (- z a)))) (if (<= z 3.6e+48) (- x (* t (/ y (- z a)))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-65) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3.6e+48) {
tmp = x - (t * (y / (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 <= (-8d-65)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 3.6d+48) then
tmp = x - (t * (y / (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 <= -8e-65) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3.6e+48) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e-65: tmp = x + (y * (z / (z - a))) elif z <= 3.6e+48: tmp = x - (t * (y / (z - a))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e-65) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 3.6e+48) tmp = Float64(x - Float64(t * Float64(y / Float64(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 <= -8e-65) tmp = x + (y * (z / (z - a))); elseif (z <= 3.6e+48) tmp = x - (t * (y / (z - a))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e-65], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+48], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $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 -8 \cdot 10^{-65}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+48}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -7.99999999999999939e-65Initial program 79.1%
Taylor expanded in t around 0 71.5%
+-commutative71.5%
associate-/l*90.5%
Simplified90.5%
if -7.99999999999999939e-65 < z < 3.59999999999999983e48Initial program 93.7%
Taylor expanded in t around inf 86.8%
mul-1-neg86.8%
distribute-neg-frac286.8%
associate-*r/87.9%
sub-neg87.9%
distribute-neg-in87.9%
remove-double-neg87.9%
Simplified87.9%
if 3.59999999999999983e48 < z Initial program 69.4%
Taylor expanded in a around 0 67.8%
+-commutative67.8%
associate-/l*98.4%
Simplified98.4%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e-72) (not (<= z 6.6e-54))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e-72) || !(z <= 6.6e-54)) {
tmp = y + x;
} 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 ((z <= (-8.5d-72)) .or. (.not. (z <= 6.6d-54))) then
tmp = y + x
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 ((z <= -8.5e-72) || !(z <= 6.6e-54)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e-72) or not (z <= 6.6e-54): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e-72) || !(z <= 6.6e-54)) tmp = Float64(y + x); 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 ((z <= -8.5e-72) || ~((z <= 6.6e-54))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e-72], N[Not[LessEqual[z, 6.6e-54]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-72} \lor \neg \left(z \leq 6.6 \cdot 10^{-54}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -8.50000000000000008e-72 or 6.59999999999999986e-54 < z Initial program 78.4%
Taylor expanded in z around inf 78.6%
+-commutative78.6%
Simplified78.6%
if -8.50000000000000008e-72 < z < 6.59999999999999986e-54Initial program 94.2%
associate-/l*98.2%
*-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 86.4%
Final simplification82.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.8e+125) x (if (<= a 9.6e+35) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.8e+125) {
tmp = x;
} else if (a <= 9.6e+35) {
tmp = y + x;
} 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 <= (-4.8d+125)) then
tmp = x
else if (a <= 9.6d+35) then
tmp = y + x
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 <= -4.8e+125) {
tmp = x;
} else if (a <= 9.6e+35) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.8e+125: tmp = x elif a <= 9.6e+35: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.8e+125) tmp = x; elseif (a <= 9.6e+35) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.8e+125) tmp = x; elseif (a <= 9.6e+35) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.8e+125], x, If[LessEqual[a, 9.6e+35], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{+125}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{+35}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.7999999999999999e125 or 9.60000000000000058e35 < a Initial program 89.0%
Taylor expanded in x around inf 72.4%
if -4.7999999999999999e125 < a < 9.60000000000000058e35Initial program 83.4%
Taylor expanded in z around inf 67.1%
+-commutative67.1%
Simplified67.1%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 85.5%
associate-/l*99.1%
*-commutative99.1%
Applied egg-rr99.1%
Final simplification99.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 85.5%
Taylor expanded in x around inf 55.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 2024091
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))