
(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 (if (or (<= y -3e-26) (not (<= y 2.3e-108))) (+ x (* y (/ (- z t) a))) (+ x (/ 1.0 (/ a (* y (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3e-26) || !(y <= 2.3e-108)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + (1.0 / (a / (y * (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 ((y <= (-3d-26)) .or. (.not. (y <= 2.3d-108))) then
tmp = x + (y * ((z - t) / a))
else
tmp = x + (1.0d0 / (a / (y * (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 ((y <= -3e-26) || !(y <= 2.3e-108)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + (1.0 / (a / (y * (z - t))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3e-26) or not (y <= 2.3e-108): tmp = x + (y * ((z - t) / a)) else: tmp = x + (1.0 / (a / (y * (z - t)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3e-26) || !(y <= 2.3e-108)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x + Float64(1.0 / Float64(a / Float64(y * Float64(z - t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3e-26) || ~((y <= 2.3e-108))) tmp = x + (y * ((z - t) / a)); else tmp = x + (1.0 / (a / (y * (z - t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3e-26], N[Not[LessEqual[y, 2.3e-108]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(a / N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-26} \lor \neg \left(y \leq 2.3 \cdot 10^{-108}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{a}{y \cdot \left(z - t\right)}}\\
\end{array}
\end{array}
if y < -3.00000000000000012e-26 or 2.29999999999999996e-108 < y Initial program 88.3%
associate-/l*99.8%
Simplified99.8%
if -3.00000000000000012e-26 < y < 2.29999999999999996e-108Initial program 99.6%
associate-/l*85.6%
Simplified85.6%
associate-*r/99.6%
clear-num99.6%
Applied egg-rr99.6%
Final simplification99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))))
(if (or (<= t_1 -1e+73) (not (<= t_1 2e+152)))
(* y (/ (- z t) a))
(- x (/ (* y t) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 <= -1e+73) || !(t_1 <= 2e+152)) {
tmp = y * ((z - t) / 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) :: t_1
real(8) :: tmp
t_1 = y * (z - t)
if ((t_1 <= (-1d+73)) .or. (.not. (t_1 <= 2d+152))) then
tmp = y * ((z - t) / 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 t_1 = y * (z - t);
double tmp;
if ((t_1 <= -1e+73) || !(t_1 <= 2e+152)) {
tmp = y * ((z - t) / a);
} else {
tmp = x - ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) tmp = 0 if (t_1 <= -1e+73) or not (t_1 <= 2e+152): tmp = y * ((z - t) / a) else: tmp = x - ((y * t) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) tmp = 0.0 if ((t_1 <= -1e+73) || !(t_1 <= 2e+152)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x - Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); tmp = 0.0; if ((t_1 <= -1e+73) || ~((t_1 <= 2e+152))) tmp = y * ((z - t) / a); else tmp = x - ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+73], N[Not[LessEqual[t$95$1, 2e+152]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+73} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+152}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -9.99999999999999983e72 or 2.0000000000000001e152 < (*.f64 y (-.f64 z t)) Initial program 86.1%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in y around inf 89.7%
Taylor expanded in a around 0 94.0%
if -9.99999999999999983e72 < (*.f64 y (-.f64 z t)) < 2.0000000000000001e152Initial program 98.9%
*-commutative98.9%
associate-/l*94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 87.0%
*-commutative87.0%
associate-*r/81.7%
neg-mul-181.7%
sub-neg81.7%
associate-*r/87.0%
associate-*l/83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 87.0%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.85e-7) (not (<= y 3e-108))) (+ x (* y (/ (- z t) a))) (+ x (/ (* y (- z t)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.85e-7) || !(y <= 3e-108)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((y * (z - 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 ((y <= (-1.85d-7)) .or. (.not. (y <= 3d-108))) then
tmp = x + (y * ((z - t) / a))
else
tmp = x + ((y * (z - 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 ((y <= -1.85e-7) || !(y <= 3e-108)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((y * (z - t)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.85e-7) or not (y <= 3e-108): tmp = x + (y * ((z - t) / a)) else: tmp = x + ((y * (z - t)) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.85e-7) || !(y <= 3e-108)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.85e-7) || ~((y <= 3e-108))) tmp = x + (y * ((z - t) / a)); else tmp = x + ((y * (z - t)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.85e-7], N[Not[LessEqual[y, 3e-108]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-7} \lor \neg \left(y \leq 3 \cdot 10^{-108}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\end{array}
\end{array}
if y < -1.85000000000000002e-7 or 2.99999999999999993e-108 < y Initial program 87.8%
associate-/l*99.8%
Simplified99.8%
if -1.85000000000000002e-7 < y < 2.99999999999999993e-108Initial program 99.6%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.3e-124) (not (<= y 2.5e-215))) (+ x (* y (/ (- z t) a))) (- x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.3e-124) || !(y <= 2.5e-215)) {
tmp = x + (y * ((z - t) / 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 ((y <= (-2.3d-124)) .or. (.not. (y <= 2.5d-215))) then
tmp = x + (y * ((z - t) / 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 ((y <= -2.3e-124) || !(y <= 2.5e-215)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x - ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.3e-124) or not (y <= 2.5e-215): tmp = x + (y * ((z - t) / a)) else: tmp = x - ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.3e-124) || !(y <= 2.5e-215)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x - Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.3e-124) || ~((y <= 2.5e-215))) tmp = x + (y * ((z - t) / a)); else tmp = x - ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.3e-124], N[Not[LessEqual[y, 2.5e-215]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-124} \lor \neg \left(y \leq 2.5 \cdot 10^{-215}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if y < -2.30000000000000012e-124 or 2.49999999999999978e-215 < y Initial program 91.3%
associate-/l*98.4%
Simplified98.4%
if -2.30000000000000012e-124 < y < 2.49999999999999978e-215Initial program 99.3%
*-commutative99.3%
associate-/l*96.6%
Applied egg-rr96.6%
Taylor expanded in z around 0 92.1%
*-commutative92.1%
associate-*r/77.9%
neg-mul-177.9%
sub-neg77.9%
associate-*r/92.1%
associate-*l/89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 92.1%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e+89) (not (<= z 4.2e+42))) (+ x (* z (/ y a))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e+89) || !(z <= 4.2e+42)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (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 ((z <= (-1.8d+89)) .or. (.not. (z <= 4.2d+42))) then
tmp = x + (z * (y / a))
else
tmp = x - (t * (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 ((z <= -1.8e+89) || !(z <= 4.2e+42)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e+89) or not (z <= 4.2e+42): tmp = x + (z * (y / a)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e+89) || !(z <= 4.2e+42)) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.8e+89) || ~((z <= 4.2e+42))) tmp = x + (z * (y / a)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e+89], N[Not[LessEqual[z, 4.2e+42]], $MachinePrecision]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+89} \lor \neg \left(z \leq 4.2 \cdot 10^{+42}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.8e89 or 4.19999999999999991e42 < z Initial program 90.9%
*-commutative90.9%
associate-/l*94.5%
Applied egg-rr94.5%
Taylor expanded in z around inf 83.5%
if -1.8e89 < z < 4.19999999999999991e42Initial program 94.8%
*-commutative94.8%
associate-/l*96.8%
Applied egg-rr96.8%
Taylor expanded in z around 0 85.8%
*-commutative85.8%
associate-*r/86.2%
neg-mul-186.2%
sub-neg86.2%
associate-*r/85.8%
associate-*l/88.8%
*-commutative88.8%
Simplified88.8%
Final simplification86.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.5e+41) (not (<= t 2.9e+82))) (* y (/ (- z t) a)) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.5e+41) || !(t <= 2.9e+82)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z / (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.5d+41)) .or. (.not. (t <= 2.9d+82))) then
tmp = y * ((z - t) / a)
else
tmp = x + (z / (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.5e+41) || !(t <= 2.9e+82)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.5e+41) or not (t <= 2.9e+82): tmp = y * ((z - t) / a) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.5e+41) || !(t <= 2.9e+82)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8.5e+41) || ~((t <= 2.9e+82))) tmp = y * ((z - t) / a); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.5e+41], N[Not[LessEqual[t, 2.9e+82]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+41} \lor \neg \left(t \leq 2.9 \cdot 10^{+82}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -8.49999999999999938e41 or 2.9000000000000001e82 < t Initial program 91.2%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in y around inf 71.8%
Taylor expanded in a around 0 77.0%
if -8.49999999999999938e41 < t < 2.9000000000000001e82Initial program 94.4%
*-commutative94.4%
associate-/l*97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 87.4%
clear-num87.4%
un-div-inv87.6%
Applied egg-rr87.6%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.2e+44) (not (<= t 2.7e+82))) (* y (/ (- z t) a)) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e+44) || !(t <= 2.7e+82)) {
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 ((t <= (-1.2d+44)) .or. (.not. (t <= 2.7d+82))) 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 ((t <= -1.2e+44) || !(t <= 2.7e+82)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.2e+44) or not (t <= 2.7e+82): tmp = y * ((z - t) / a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.2e+44) || !(t <= 2.7e+82)) 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 ((t <= -1.2e+44) || ~((t <= 2.7e+82))) 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[t, -1.2e+44], N[Not[LessEqual[t, 2.7e+82]], $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}\;t \leq -1.2 \cdot 10^{+44} \lor \neg \left(t \leq 2.7 \cdot 10^{+82}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.20000000000000007e44 or 2.6999999999999999e82 < t Initial program 91.2%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in y around inf 71.8%
Taylor expanded in a around 0 77.0%
if -1.20000000000000007e44 < t < 2.6999999999999999e82Initial program 94.4%
*-commutative94.4%
associate-/l*97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 87.4%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.25e-140) (not (<= y 4.2e-98))) (* y (/ (- z t) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.25e-140) || !(y <= 4.2e-98)) {
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 <= (-3.25d-140)) .or. (.not. (y <= 4.2d-98))) 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 <= -3.25e-140) || !(y <= 4.2e-98)) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.25e-140) or not (y <= 4.2e-98): tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.25e-140) || !(y <= 4.2e-98)) 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 <= -3.25e-140) || ~((y <= 4.2e-98))) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.25e-140], N[Not[LessEqual[y, 4.2e-98]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.25 \cdot 10^{-140} \lor \neg \left(y \leq 4.2 \cdot 10^{-98}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.2499999999999998e-140 or 4.19999999999999984e-98 < y Initial program 90.1%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around inf 73.8%
Taylor expanded in a around 0 76.7%
if -3.2499999999999998e-140 < y < 4.19999999999999984e-98Initial program 99.5%
associate-/l*82.1%
Simplified82.1%
Taylor expanded in x around inf 64.4%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -5e+59) (* y (/ z a)) (if (<= y 9.6e-14) x (* (/ y a) (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e+59) {
tmp = y * (z / a);
} else if (y <= 9.6e-14) {
tmp = x;
} else {
tmp = (y / a) * -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 (y <= (-5d+59)) then
tmp = y * (z / a)
else if (y <= 9.6d-14) then
tmp = x
else
tmp = (y / a) * -t
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+59) {
tmp = y * (z / a);
} else if (y <= 9.6e-14) {
tmp = x;
} else {
tmp = (y / a) * -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5e+59: tmp = y * (z / a) elif y <= 9.6e-14: tmp = x else: tmp = (y / a) * -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5e+59) tmp = Float64(y * Float64(z / a)); elseif (y <= 9.6e-14) tmp = x; else tmp = Float64(Float64(y / a) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5e+59) tmp = y * (z / a); elseif (y <= 9.6e-14) tmp = x; else tmp = (y / a) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5e+59], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e-14], x, N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+59}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\
\end{array}
\end{array}
if y < -4.9999999999999997e59Initial program 85.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 96.0%
Taylor expanded in z around inf 68.8%
if -4.9999999999999997e59 < y < 9.599999999999999e-14Initial program 97.7%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in x around inf 57.2%
if 9.599999999999999e-14 < y Initial program 88.9%
*-commutative88.9%
associate-/l*95.2%
Applied egg-rr95.2%
Taylor expanded in z around 0 60.4%
*-commutative60.4%
associate-*r/61.9%
neg-mul-161.9%
sub-neg61.9%
associate-*r/60.4%
associate-*l/61.9%
*-commutative61.9%
Simplified61.9%
*-un-lft-identity61.9%
associate-*l/62.0%
Applied egg-rr62.0%
Taylor expanded in x around 0 42.3%
mul-1-neg42.3%
distribute-neg-frac242.3%
associate-*r/45.4%
Simplified45.4%
Final simplification56.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.2e+66) (not (<= y 56000000000.0))) (* y (/ z a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.2e+66) || !(y <= 56000000000.0)) {
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 ((y <= (-4.2d+66)) .or. (.not. (y <= 56000000000.0d0))) 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 ((y <= -4.2e+66) || !(y <= 56000000000.0)) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.2e+66) or not (y <= 56000000000.0): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.2e+66) || !(y <= 56000000000.0)) 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 ((y <= -4.2e+66) || ~((y <= 56000000000.0))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.2e+66], N[Not[LessEqual[y, 56000000000.0]], $MachinePrecision]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+66} \lor \neg \left(y \leq 56000000000\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.20000000000000011e66 or 5.6e10 < y Initial program 86.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 87.0%
Taylor expanded in z around inf 56.6%
if -4.20000000000000011e66 < y < 5.6e10Initial program 97.7%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around inf 56.7%
Final simplification56.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.5e+68) (* y (/ z a)) (if (<= y 1.75e+21) x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.5e+68) {
tmp = y * (z / a);
} else if (y <= 1.75e+21) {
tmp = x;
} else {
tmp = y / (a / 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 (y <= (-5.5d+68)) then
tmp = y * (z / a)
else if (y <= 1.75d+21) then
tmp = x
else
tmp = y / (a / z)
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+68) {
tmp = y * (z / a);
} else if (y <= 1.75e+21) {
tmp = x;
} else {
tmp = y / (a / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.5e+68: tmp = y * (z / a) elif y <= 1.75e+21: tmp = x else: tmp = y / (a / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.5e+68) tmp = Float64(y * Float64(z / a)); elseif (y <= 1.75e+21) tmp = x; else tmp = Float64(y / Float64(a / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.5e+68) tmp = y * (z / a); elseif (y <= 1.75e+21) tmp = x; else tmp = y / (a / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.5e+68], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+21], x, N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+68}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if y < -5.5000000000000004e68Initial program 85.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 96.0%
Taylor expanded in z around inf 68.8%
if -5.5000000000000004e68 < y < 1.75e21Initial program 97.7%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around inf 56.7%
if 1.75e21 < y Initial program 88.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 79.0%
Taylor expanded in z around inf 45.8%
clear-num45.8%
un-div-inv45.9%
Applied egg-rr45.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -5e+164) (+ x (* y (/ (- z t) a))) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e+164) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((z - t) * (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 (a <= (-5d+164)) then
tmp = x + (y * ((z - t) / a))
else
tmp = x + ((z - t) * (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 (a <= -5e+164) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5e+164: tmp = x + (y * ((z - t) / a)) else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5e+164) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5e+164) tmp = x + (y * ((z - t) / a)); else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5e+164], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+164}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -4.9999999999999995e164Initial program 81.0%
associate-/l*99.8%
Simplified99.8%
if -4.9999999999999995e164 < a Initial program 94.5%
*-commutative94.5%
associate-/l*97.5%
Applied egg-rr97.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 93.2%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in x around inf 38.4%
(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 2024157
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
(+ x (/ (* y (- z t)) a)))