
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / 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)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / 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)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (* (- z t) (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
return ((z - t) * (y / a)) + 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 = ((z - t) * (y / a)) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return ((z - t) * (y / a)) + x;
}
def code(x, y, z, t, a): return ((z - t) * (y / a)) + x
function code(x, y, z, t, a) return Float64(Float64(Float64(z - t) * Float64(y / a)) + x) end
function tmp = code(x, y, z, t, a) tmp = ((z - t) * (y / a)) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(z - t\right) \cdot \frac{y}{a} + x
\end{array}
Initial program 96.2%
+-commutative96.2%
associate-/l*91.3%
fma-define91.3%
Simplified91.3%
fma-undefine91.3%
associate-*r/96.2%
*-commutative96.2%
associate-/l*98.7%
Applied egg-rr98.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ t (- a)))))
(if (<= a -1.6e+44)
x
(if (<= a -5.5e-81)
t_1
(if (<= a 3.1e-88)
(* z (/ y a))
(if (<= a 9.5e-17) t_1 (if (<= a 5.2e+48) (* y (/ z a)) x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (t / -a);
double tmp;
if (a <= -1.6e+44) {
tmp = x;
} else if (a <= -5.5e-81) {
tmp = t_1;
} else if (a <= 3.1e-88) {
tmp = z * (y / a);
} else if (a <= 9.5e-17) {
tmp = t_1;
} else if (a <= 5.2e+48) {
tmp = y * (z / a);
} 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) :: t_1
real(8) :: tmp
t_1 = y * (t / -a)
if (a <= (-1.6d+44)) then
tmp = x
else if (a <= (-5.5d-81)) then
tmp = t_1
else if (a <= 3.1d-88) then
tmp = z * (y / a)
else if (a <= 9.5d-17) then
tmp = t_1
else if (a <= 5.2d+48) then
tmp = y * (z / a)
else
tmp = x
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 (a <= -1.6e+44) {
tmp = x;
} else if (a <= -5.5e-81) {
tmp = t_1;
} else if (a <= 3.1e-88) {
tmp = z * (y / a);
} else if (a <= 9.5e-17) {
tmp = t_1;
} else if (a <= 5.2e+48) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (t / -a) tmp = 0 if a <= -1.6e+44: tmp = x elif a <= -5.5e-81: tmp = t_1 elif a <= 3.1e-88: tmp = z * (y / a) elif a <= 9.5e-17: tmp = t_1 elif a <= 5.2e+48: tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(t / Float64(-a))) tmp = 0.0 if (a <= -1.6e+44) tmp = x; elseif (a <= -5.5e-81) tmp = t_1; elseif (a <= 3.1e-88) tmp = Float64(z * Float64(y / a)); elseif (a <= 9.5e-17) tmp = t_1; elseif (a <= 5.2e+48) tmp = Float64(y * Float64(z / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (t / -a); tmp = 0.0; if (a <= -1.6e+44) tmp = x; elseif (a <= -5.5e-81) tmp = t_1; elseif (a <= 3.1e-88) tmp = z * (y / a); elseif (a <= 9.5e-17) tmp = t_1; elseif (a <= 5.2e+48) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.6e+44], x, If[LessEqual[a, -5.5e-81], t$95$1, If[LessEqual[a, 3.1e-88], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-17], t$95$1, If[LessEqual[a, 5.2e+48], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{-a}\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{+44}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -5.5 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-88}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.60000000000000002e44 or 5.1999999999999999e48 < a Initial program 92.8%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in x around inf 66.3%
if -1.60000000000000002e44 < a < -5.50000000000000026e-81 or 3.0999999999999998e-88 < a < 9.50000000000000029e-17Initial program 99.7%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in y around inf 88.1%
associate--l+88.1%
div-sub88.1%
Simplified88.1%
Taylor expanded in t around inf 57.4%
associate-*r/57.4%
mul-1-neg57.4%
Simplified57.4%
if -5.50000000000000026e-81 < a < 3.0999999999999998e-88Initial program 98.9%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in y around inf 72.2%
associate--l+72.2%
div-sub74.5%
Simplified74.5%
Taylor expanded in x around 0 67.8%
div-sub70.2%
Simplified70.2%
Taylor expanded in z around inf 59.6%
associate-*l/63.8%
Applied egg-rr63.8%
if 9.50000000000000029e-17 < a < 5.1999999999999999e48Initial program 92.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 92.4%
associate--l+92.4%
div-sub92.4%
Simplified92.4%
Taylor expanded in z around inf 66.9%
Final simplification63.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e+155) (not (<= z 1.72e+162))) (+ x (* z (/ y a))) (+ x (/ y (/ a (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+155) || !(z <= 1.72e+162)) {
tmp = x + (z * (y / a));
} else {
tmp = x + (y / (a / (z - t)));
}
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.7d+155)) .or. (.not. (z <= 1.72d+162))) then
tmp = x + (z * (y / a))
else
tmp = x + (y / (a / (z - t)))
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.7e+155) || !(z <= 1.72e+162)) {
tmp = x + (z * (y / a));
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e+155) or not (z <= 1.72e+162): tmp = x + (z * (y / a)) else: tmp = x + (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e+155) || !(z <= 1.72e+162)) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e+155) || ~((z <= 1.72e+162))) tmp = x + (z * (y / a)); else tmp = x + (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e+155], N[Not[LessEqual[z, 1.72e+162]], $MachinePrecision]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+155} \lor \neg \left(z \leq 1.72 \cdot 10^{+162}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if z < -1.7e155 or 1.72e162 < z Initial program 92.9%
+-commutative92.9%
associate-/l*80.2%
fma-define80.2%
Simplified80.2%
fma-undefine80.2%
associate-*r/92.9%
*-commutative92.9%
associate-/l*98.4%
Applied egg-rr98.4%
Taylor expanded in z around inf 92.9%
associate-*l/97.0%
*-commutative97.0%
Simplified97.0%
if -1.7e155 < z < 1.72e162Initial program 97.4%
associate-/l*95.3%
Simplified95.3%
clear-num95.2%
un-div-inv95.5%
Applied egg-rr95.5%
Final simplification95.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -8.2e-120) (not (<= y 2.1e-230))) (+ x (* y (/ (- z t) a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -8.2e-120) || !(y <= 2.1e-230)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-8.2d-120)) .or. (.not. (y <= 2.1d-230))) then
tmp = x + (y * ((z - t) / a))
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -8.2e-120) || !(y <= 2.1e-230)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -8.2e-120) or not (y <= 2.1e-230): tmp = x + (y * ((z - t) / a)) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -8.2e-120) || !(y <= 2.1e-230)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -8.2e-120) || ~((y <= 2.1e-230))) tmp = x + (y * ((z - t) / a)); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -8.2e-120], N[Not[LessEqual[y, 2.1e-230]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-120} \lor \neg \left(y \leq 2.1 \cdot 10^{-230}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -8.20000000000000068e-120 or 2.0999999999999998e-230 < y Initial program 95.8%
associate-/l*97.1%
Simplified97.1%
if -8.20000000000000068e-120 < y < 2.0999999999999998e-230Initial program 98.0%
+-commutative98.0%
associate-/l*68.0%
fma-define68.0%
Simplified68.0%
fma-undefine68.0%
associate-*r/98.0%
*-commutative98.0%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 88.7%
associate-*l/90.5%
*-commutative90.5%
Simplified90.5%
Final simplification95.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (- z t) y))) (if (<= t_1 (- INFINITY)) (+ x (/ y (/ a (- z t)))) (+ x (/ t_1 a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * y;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + (t_1 / a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * y;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + (t_1 / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) * y tmp = 0 if t_1 <= -math.inf: tmp = x + (y / (a / (z - t))) else: tmp = x + (t_1 / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * y) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(t_1 / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) * y; tmp = 0.0; if (t_1 <= -Inf) tmp = x + (y / (a / (z - t))); else tmp = x + (t_1 / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t\_1}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -inf.0Initial program 78.5%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
if -inf.0 < (*.f64 y (-.f64 z t)) Initial program 97.9%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+46) (not (<= t 2.85e+51))) (- x (* t (/ y a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+46) || !(t <= 2.85e+51)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.8d+46)) .or. (.not. (t <= 2.85d+51))) then
tmp = x - (t * (y / a))
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+46) || !(t <= 2.85e+51)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+46) or not (t <= 2.85e+51): tmp = x - (t * (y / a)) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+46) || !(t <= 2.85e+51)) tmp = Float64(x - Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e+46) || ~((t <= 2.85e+51))) tmp = x - (t * (y / a)); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+46], N[Not[LessEqual[t, 2.85e+51]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+46} \lor \neg \left(t \leq 2.85 \cdot 10^{+51}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.80000000000000017e46 or 2.8500000000000001e51 < t Initial program 96.2%
+-commutative96.2%
associate-/l*88.9%
fma-define89.0%
Simplified89.0%
fma-undefine88.9%
associate-*r/96.2%
*-commutative96.2%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 89.2%
associate-*l/86.4%
*-commutative86.4%
neg-mul-186.4%
sub-neg86.4%
associate-*r/89.2%
associate-*l/92.8%
*-commutative92.8%
Simplified92.8%
if -4.80000000000000017e46 < t < 2.8500000000000001e51Initial program 96.2%
+-commutative96.2%
associate-/l*93.0%
fma-define93.0%
Simplified93.0%
fma-undefine93.0%
associate-*r/96.2%
*-commutative96.2%
associate-/l*98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 88.0%
associate-*l/90.9%
*-commutative90.9%
Simplified90.9%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9000000000.0) (not (<= y 1.7e+171))) (* y (/ (- z t) a)) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9000000000.0) || !(y <= 1.7e+171)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-9000000000.0d0)) .or. (.not. (y <= 1.7d+171))) then
tmp = y * ((z - t) / a)
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9000000000.0) || !(y <= 1.7e+171)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9000000000.0) or not (y <= 1.7e+171): tmp = y * ((z - t) / a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9000000000.0) || !(y <= 1.7e+171)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9000000000.0) || ~((y <= 1.7e+171))) tmp = y * ((z - t) / a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9000000000.0], N[Not[LessEqual[y, 1.7e+171]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9000000000 \lor \neg \left(y \leq 1.7 \cdot 10^{+171}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -9e9 or 1.7000000000000001e171 < y Initial program 92.0%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in y around inf 95.8%
associate--l+95.8%
div-sub96.9%
Simplified96.9%
Taylor expanded in x around 0 82.1%
div-sub83.1%
Simplified83.1%
if -9e9 < y < 1.7000000000000001e171Initial program 98.7%
+-commutative98.7%
associate-/l*86.9%
fma-define86.9%
Simplified86.9%
fma-undefine86.9%
associate-*r/98.7%
*-commutative98.7%
associate-/l*99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 80.7%
associate-*l/81.3%
*-commutative81.3%
Simplified81.3%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -62000.0) (not (<= y 4.8e+52))) (* y (/ (- z t) a)) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -62000.0) || !(y <= 4.8e+52)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-62000.0d0)) .or. (.not. (y <= 4.8d+52))) then
tmp = y * ((z - t) / a)
else
tmp = x + ((z * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -62000.0) || !(y <= 4.8e+52)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -62000.0) or not (y <= 4.8e+52): tmp = y * ((z - t) / a) else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -62000.0) || !(y <= 4.8e+52)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -62000.0) || ~((y <= 4.8e+52))) tmp = y * ((z - t) / a); else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -62000.0], N[Not[LessEqual[y, 4.8e+52]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -62000 \lor \neg \left(y \leq 4.8 \cdot 10^{+52}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if y < -62000 or 4.8e52 < y Initial program 92.8%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around inf 96.6%
associate--l+96.6%
div-sub97.4%
Simplified97.4%
Taylor expanded in x around 0 80.7%
div-sub81.5%
Simplified81.5%
if -62000 < y < 4.8e52Initial program 99.2%
associate-/l*84.7%
Simplified84.7%
Taylor expanded in z around inf 82.3%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -5e-119) (not (<= y 6.2e-80))) (* y (/ (- z t) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5e-119) || !(y <= 6.2e-80)) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-5d-119)) .or. (.not. (y <= 6.2d-80))) then
tmp = y * ((z - t) / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5e-119) || !(y <= 6.2e-80)) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -5e-119) or not (y <= 6.2e-80): tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -5e-119) || !(y <= 6.2e-80)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -5e-119) || ~((y <= 6.2e-80))) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -5e-119], N[Not[LessEqual[y, 6.2e-80]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-119} \lor \neg \left(y \leq 6.2 \cdot 10^{-80}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.99999999999999993e-119 or 6.20000000000000032e-80 < y Initial program 94.9%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in y around inf 95.3%
associate--l+95.3%
div-sub96.5%
Simplified96.5%
Taylor expanded in x around 0 73.5%
div-sub74.7%
Simplified74.7%
if -4.99999999999999993e-119 < y < 6.20000000000000032e-80Initial program 98.8%
associate-/l*78.9%
Simplified78.9%
Taylor expanded in x around inf 67.4%
Final simplification72.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.2e+41) (- x (* t (/ y a))) (if (<= t 4.3e+48) (+ x (* z (/ y a))) (- x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.2e+41) {
tmp = x - (t * (y / a));
} else if (t <= 4.3e+48) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t / (a / 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 (t <= (-8.2d+41)) then
tmp = x - (t * (y / a))
else if (t <= 4.3d+48) then
tmp = x + (z * (y / a))
else
tmp = x - (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.2e+41) {
tmp = x - (t * (y / a));
} else if (t <= 4.3e+48) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.2e+41: tmp = x - (t * (y / a)) elif t <= 4.3e+48: tmp = x + (z * (y / a)) else: tmp = x - (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.2e+41) tmp = Float64(x - Float64(t * Float64(y / a))); elseif (t <= 4.3e+48) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.2e+41) tmp = x - (t * (y / a)); elseif (t <= 4.3e+48) tmp = x + (z * (y / a)); else tmp = x - (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.2e+41], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.3e+48], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+41}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+48}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -8.2000000000000007e41Initial program 95.3%
+-commutative95.3%
associate-/l*86.2%
fma-define86.3%
Simplified86.3%
fma-undefine86.2%
associate-*r/95.3%
*-commutative95.3%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 86.0%
associate-*l/82.9%
*-commutative82.9%
neg-mul-182.9%
sub-neg82.9%
associate-*r/86.0%
associate-*l/90.5%
*-commutative90.5%
Simplified90.5%
if -8.2000000000000007e41 < t < 4.29999999999999978e48Initial program 96.2%
+-commutative96.2%
associate-/l*93.0%
fma-define93.0%
Simplified93.0%
fma-undefine93.0%
associate-*r/96.2%
*-commutative96.2%
associate-/l*98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 88.0%
associate-*l/90.9%
*-commutative90.9%
Simplified90.9%
if 4.29999999999999978e48 < t Initial program 97.6%
+-commutative97.6%
associate-/l*93.0%
fma-define93.0%
Simplified93.0%
fma-undefine93.0%
associate-*r/97.6%
*-commutative97.6%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 94.1%
associate-*l/91.6%
*-commutative91.6%
neg-mul-191.6%
sub-neg91.6%
associate-*r/94.1%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
clear-num96.4%
un-div-inv96.4%
Applied egg-rr96.4%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.1e-97) x (if (<= a 7e+49) (* z (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.1e-97) {
tmp = x;
} else if (a <= 7e+49) {
tmp = z * (y / a);
} 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 <= (-3.1d-97)) then
tmp = x
else if (a <= 7d+49) then
tmp = z * (y / a)
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 <= -3.1e-97) {
tmp = x;
} else if (a <= 7e+49) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.1e-97: tmp = x elif a <= 7e+49: tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.1e-97) tmp = x; elseif (a <= 7e+49) tmp = Float64(z * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.1e-97) tmp = x; elseif (a <= 7e+49) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.1e-97], x, If[LessEqual[a, 7e+49], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{-97}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+49}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.10000000000000002e-97 or 6.9999999999999995e49 < a Initial program 94.5%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in x around inf 57.5%
if -3.10000000000000002e-97 < a < 6.9999999999999995e49Initial program 98.3%
associate-/l*83.5%
Simplified83.5%
Taylor expanded in y around inf 77.6%
associate--l+77.6%
div-sub79.4%
Simplified79.4%
Taylor expanded in x around 0 71.5%
div-sub73.3%
Simplified73.3%
Taylor expanded in z around inf 56.2%
associate-*l/60.2%
Applied egg-rr60.2%
Final simplification58.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -6e-120) x (if (<= a 2.65e+48) (* y (/ z a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e-120) {
tmp = x;
} else if (a <= 2.65e+48) {
tmp = y * (z / a);
} 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 <= (-6d-120)) then
tmp = x
else if (a <= 2.65d+48) then
tmp = y * (z / a)
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 <= -6e-120) {
tmp = x;
} else if (a <= 2.65e+48) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e-120: tmp = x elif a <= 2.65e+48: tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e-120) tmp = x; elseif (a <= 2.65e+48) tmp = Float64(y * Float64(z / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6e-120) tmp = x; elseif (a <= 2.65e+48) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e-120], x, If[LessEqual[a, 2.65e+48], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-120}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.00000000000000022e-120 or 2.65e48 < a Initial program 94.6%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in x around inf 57.0%
if -6.00000000000000022e-120 < a < 2.65e48Initial program 98.3%
associate-/l*84.7%
Simplified84.7%
Taylor expanded in y around inf 78.7%
associate--l+78.7%
div-sub80.6%
Simplified80.6%
Taylor expanded in z around inf 50.0%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.2%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in x around inf 38.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(+ x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(+ x (/ (* y (- z t)) a))
(+ x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / 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 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x + (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / 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 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x + (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x + Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x + (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x + N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))