
(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 11 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 (+ x (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
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 + ((t - z) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
def code(x, y, z, t, a): return x + ((t - z) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t - z) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t - z) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t - z}{\frac{a}{y}}
\end{array}
Initial program 92.1%
associate-/l*94.0%
cancel-sign-sub-inv94.0%
associate-/l*92.1%
distribute-lft-neg-out92.1%
distribute-rgt-neg-in92.1%
associate-*l/98.1%
sub-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
+-commutative98.1%
sub-neg98.1%
Simplified98.1%
*-commutative98.1%
clear-num98.1%
un-div-inv98.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.2e-8) (not (<= t 3.3e+36))) (+ x (/ t (/ a y))) (- x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e-8) || !(t <= 3.3e+36)) {
tmp = x + (t / (a / y));
} else {
tmp = x - (y * (z / 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-8)) .or. (.not. (t <= 3.3d+36))) then
tmp = x + (t / (a / y))
else
tmp = x - (y * (z / 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-8) || !(t <= 3.3e+36)) {
tmp = x + (t / (a / y));
} else {
tmp = x - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.2e-8) or not (t <= 3.3e+36): tmp = x + (t / (a / y)) else: tmp = x - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.2e-8) || !(t <= 3.3e+36)) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.2e-8) || ~((t <= 3.3e+36))) tmp = x + (t / (a / y)); else tmp = x - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.2e-8], N[Not[LessEqual[t, 3.3e+36]], $MachinePrecision]], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-8} \lor \neg \left(t \leq 3.3 \cdot 10^{+36}\right):\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.19999999999999999e-8 or 3.2999999999999999e36 < t Initial program 87.9%
associate-/l*93.4%
cancel-sign-sub-inv93.4%
associate-/l*87.9%
distribute-lft-neg-out87.9%
distribute-rgt-neg-in87.9%
associate-*l/99.1%
sub-neg99.1%
distribute-neg-in99.1%
remove-double-neg99.1%
+-commutative99.1%
sub-neg99.1%
Simplified99.1%
Taylor expanded in z around 0 79.6%
+-commutative79.6%
*-commutative79.6%
Simplified79.6%
div-inv79.6%
*-commutative79.6%
associate-*l*86.9%
div-inv86.9%
Applied egg-rr86.9%
clear-num54.9%
un-div-inv55.0%
Applied egg-rr87.0%
if -1.19999999999999999e-8 < t < 3.2999999999999999e36Initial program 95.6%
associate-/l*94.5%
cancel-sign-sub-inv94.5%
associate-/l*95.6%
distribute-lft-neg-out95.6%
distribute-rgt-neg-in95.6%
associate-*l/97.3%
sub-neg97.3%
distribute-neg-in97.3%
remove-double-neg97.3%
+-commutative97.3%
sub-neg97.3%
Simplified97.3%
Taylor expanded in t around 0 87.7%
mul-1-neg87.7%
sub-neg87.7%
associate-/l*86.6%
Simplified86.6%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.00039) (not (<= t 4.5e+39))) (+ x (/ t (/ a y))) (- x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.00039) || !(t <= 4.5e+39)) {
tmp = x + (t / (a / y));
} 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 <= (-0.00039d0)) .or. (.not. (t <= 4.5d+39))) then
tmp = x + (t / (a / y))
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 <= -0.00039) || !(t <= 4.5e+39)) {
tmp = x + (t / (a / y));
} else {
tmp = x - (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.00039) or not (t <= 4.5e+39): tmp = x + (t / (a / y)) else: tmp = x - (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.00039) || !(t <= 4.5e+39)) tmp = Float64(x + Float64(t / Float64(a / y))); 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 <= -0.00039) || ~((t <= 4.5e+39))) tmp = x + (t / (a / y)); else tmp = x - (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.00039], N[Not[LessEqual[t, 4.5e+39]], $MachinePrecision]], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00039 \lor \neg \left(t \leq 4.5 \cdot 10^{+39}\right):\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.89999999999999993e-4 or 4.49999999999999996e39 < t Initial program 87.9%
associate-/l*93.4%
cancel-sign-sub-inv93.4%
associate-/l*87.9%
distribute-lft-neg-out87.9%
distribute-rgt-neg-in87.9%
associate-*l/99.1%
sub-neg99.1%
distribute-neg-in99.1%
remove-double-neg99.1%
+-commutative99.1%
sub-neg99.1%
Simplified99.1%
Taylor expanded in z around 0 79.6%
+-commutative79.6%
*-commutative79.6%
Simplified79.6%
div-inv79.6%
*-commutative79.6%
associate-*l*86.9%
div-inv86.9%
Applied egg-rr86.9%
clear-num54.9%
un-div-inv55.0%
Applied egg-rr87.0%
if -3.89999999999999993e-4 < t < 4.49999999999999996e39Initial program 95.6%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 87.7%
div-inv87.7%
*-commutative87.7%
associate-*l*90.7%
div-inv90.8%
Applied egg-rr90.8%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.3e+110) (/ (- z) (/ a y)) (if (<= z 2.45e+202) (+ x (* t (/ y a))) (* z (/ y (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e+110) {
tmp = -z / (a / y);
} else if (z <= 2.45e+202) {
tmp = x + (t * (y / a));
} else {
tmp = 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 (z <= (-4.3d+110)) then
tmp = -z / (a / y)
else if (z <= 2.45d+202) then
tmp = x + (t * (y / a))
else
tmp = 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 (z <= -4.3e+110) {
tmp = -z / (a / y);
} else if (z <= 2.45e+202) {
tmp = x + (t * (y / a));
} else {
tmp = z * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.3e+110: tmp = -z / (a / y) elif z <= 2.45e+202: tmp = x + (t * (y / a)) else: tmp = z * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.3e+110) tmp = Float64(Float64(-z) / Float64(a / y)); elseif (z <= 2.45e+202) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(z * Float64(y / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.3e+110) tmp = -z / (a / y); elseif (z <= 2.45e+202) tmp = x + (t * (y / a)); else tmp = z * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e+110], N[((-z) / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e+202], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+110}:\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+202}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if z < -4.30000000000000007e110Initial program 83.1%
associate-/l*90.2%
cancel-sign-sub-inv90.2%
associate-/l*83.1%
distribute-lft-neg-out83.1%
distribute-rgt-neg-in83.1%
associate-*l/99.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
*-un-lft-identity99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
Applied egg-rr99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in z around inf 68.1%
mul-1-neg68.1%
distribute-frac-neg268.1%
associate-*r/73.0%
Simplified73.0%
associate-*r/68.1%
*-commutative68.1%
distribute-frac-neg268.1%
associate-*r/80.1%
distribute-lft-neg-in80.1%
clear-num80.0%
un-div-inv80.1%
Applied egg-rr80.1%
if -4.30000000000000007e110 < z < 2.45e202Initial program 94.3%
associate-/l*96.9%
cancel-sign-sub-inv96.9%
associate-/l*94.3%
distribute-lft-neg-out94.3%
distribute-rgt-neg-in94.3%
associate-*l/98.1%
sub-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
+-commutative98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in z around 0 79.7%
+-commutative79.7%
*-commutative79.7%
Simplified79.7%
div-inv79.7%
*-commutative79.7%
associate-*l*84.1%
div-inv84.1%
Applied egg-rr84.1%
if 2.45e202 < z Initial program 88.4%
associate-/l*76.6%
cancel-sign-sub-inv76.6%
associate-/l*88.4%
distribute-lft-neg-out88.4%
distribute-rgt-neg-in88.4%
associate-*l/95.9%
sub-neg95.9%
distribute-neg-in95.9%
remove-double-neg95.9%
+-commutative95.9%
sub-neg95.9%
Simplified95.9%
*-un-lft-identity95.9%
*-commutative95.9%
+-commutative95.9%
fma-define95.9%
Applied egg-rr95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in z around inf 76.5%
mul-1-neg76.5%
distribute-frac-neg276.5%
associate-*r/72.2%
Simplified72.2%
associate-*r/76.5%
*-commutative76.5%
distribute-frac-neg276.5%
associate-*r/83.8%
Applied egg-rr83.8%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.3e+106) (/ (- z) (/ a y)) (if (<= z 2.1e+202) (+ x (/ t (/ a y))) (* z (/ y (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.3e+106) {
tmp = -z / (a / y);
} else if (z <= 2.1e+202) {
tmp = x + (t / (a / y));
} else {
tmp = 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 (z <= (-6.3d+106)) then
tmp = -z / (a / y)
else if (z <= 2.1d+202) then
tmp = x + (t / (a / y))
else
tmp = 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 (z <= -6.3e+106) {
tmp = -z / (a / y);
} else if (z <= 2.1e+202) {
tmp = x + (t / (a / y));
} else {
tmp = z * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.3e+106: tmp = -z / (a / y) elif z <= 2.1e+202: tmp = x + (t / (a / y)) else: tmp = z * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.3e+106) tmp = Float64(Float64(-z) / Float64(a / y)); elseif (z <= 2.1e+202) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(z * Float64(y / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.3e+106) tmp = -z / (a / y); elseif (z <= 2.1e+202) tmp = x + (t / (a / y)); else tmp = z * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.3e+106], N[((-z) / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+202], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+202}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if z < -6.29999999999999974e106Initial program 83.1%
associate-/l*90.2%
cancel-sign-sub-inv90.2%
associate-/l*83.1%
distribute-lft-neg-out83.1%
distribute-rgt-neg-in83.1%
associate-*l/99.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
*-un-lft-identity99.7%
*-commutative99.7%
+-commutative99.7%
fma-define99.7%
Applied egg-rr99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in z around inf 68.1%
mul-1-neg68.1%
distribute-frac-neg268.1%
associate-*r/73.0%
Simplified73.0%
associate-*r/68.1%
*-commutative68.1%
distribute-frac-neg268.1%
associate-*r/80.1%
distribute-lft-neg-in80.1%
clear-num80.0%
un-div-inv80.1%
Applied egg-rr80.1%
if -6.29999999999999974e106 < z < 2.1e202Initial program 94.3%
associate-/l*96.9%
cancel-sign-sub-inv96.9%
associate-/l*94.3%
distribute-lft-neg-out94.3%
distribute-rgt-neg-in94.3%
associate-*l/98.1%
sub-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
+-commutative98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in z around 0 79.7%
+-commutative79.7%
*-commutative79.7%
Simplified79.7%
div-inv79.7%
*-commutative79.7%
associate-*l*84.1%
div-inv84.1%
Applied egg-rr84.1%
clear-num37.9%
un-div-inv38.0%
Applied egg-rr84.2%
if 2.1e202 < z Initial program 88.4%
associate-/l*76.6%
cancel-sign-sub-inv76.6%
associate-/l*88.4%
distribute-lft-neg-out88.4%
distribute-rgt-neg-in88.4%
associate-*l/95.9%
sub-neg95.9%
distribute-neg-in95.9%
remove-double-neg95.9%
+-commutative95.9%
sub-neg95.9%
Simplified95.9%
*-un-lft-identity95.9%
*-commutative95.9%
+-commutative95.9%
fma-define95.9%
Applied egg-rr95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in z around inf 76.5%
mul-1-neg76.5%
distribute-frac-neg276.5%
associate-*r/72.2%
Simplified72.2%
associate-*r/76.5%
*-commutative76.5%
distribute-frac-neg276.5%
associate-*r/83.8%
Applied egg-rr83.8%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.8e-58) (* t (/ y a)) (if (<= y 470000000000.0) x (* z (/ y (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.8e-58) {
tmp = t * (y / a);
} else if (y <= 470000000000.0) {
tmp = x;
} else {
tmp = 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 <= (-2.8d-58)) then
tmp = t * (y / a)
else if (y <= 470000000000.0d0) then
tmp = x
else
tmp = 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 <= -2.8e-58) {
tmp = t * (y / a);
} else if (y <= 470000000000.0) {
tmp = x;
} else {
tmp = z * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.8e-58: tmp = t * (y / a) elif y <= 470000000000.0: tmp = x else: tmp = z * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.8e-58) tmp = Float64(t * Float64(y / a)); elseif (y <= 470000000000.0) tmp = x; else tmp = Float64(z * Float64(y / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.8e-58) tmp = t * (y / a); elseif (y <= 470000000000.0) tmp = x; else tmp = z * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.8e-58], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 470000000000.0], x, N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-58}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 470000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if y < -2.8000000000000001e-58Initial program 89.3%
associate-/l*99.8%
cancel-sign-sub-inv99.8%
associate-/l*89.3%
distribute-lft-neg-out89.3%
distribute-rgt-neg-in89.3%
associate-*l/98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
*-un-lft-identity98.5%
*-commutative98.5%
+-commutative98.5%
fma-define98.5%
Applied egg-rr98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in t around inf 41.3%
associate-/l*48.9%
Simplified48.9%
if -2.8000000000000001e-58 < y < 4.7e11Initial program 99.5%
associate-/l*86.6%
cancel-sign-sub-inv86.6%
associate-/l*99.5%
distribute-lft-neg-out99.5%
distribute-rgt-neg-in99.5%
associate-*l/97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
+-commutative97.6%
sub-neg97.6%
Simplified97.6%
Taylor expanded in x around inf 62.8%
if 4.7e11 < y Initial program 83.7%
associate-/l*99.8%
cancel-sign-sub-inv99.8%
associate-/l*83.7%
distribute-lft-neg-out83.7%
distribute-rgt-neg-in83.7%
associate-*l/98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
*-un-lft-identity98.5%
*-commutative98.5%
+-commutative98.5%
fma-define98.5%
Applied egg-rr98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in z around inf 44.1%
mul-1-neg44.1%
distribute-frac-neg244.1%
associate-*r/51.0%
Simplified51.0%
associate-*r/44.1%
*-commutative44.1%
distribute-frac-neg244.1%
associate-*r/51.0%
Applied egg-rr51.0%
Final simplification55.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.3e-58) (* t (/ y a)) (if (<= y 23000000000.0) x (* y (/ (- z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.3e-58) {
tmp = t * (y / a);
} else if (y <= 23000000000.0) {
tmp = x;
} else {
tmp = y * (-z / 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 <= (-4.3d-58)) then
tmp = t * (y / a)
else if (y <= 23000000000.0d0) then
tmp = x
else
tmp = y * (-z / 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 <= -4.3e-58) {
tmp = t * (y / a);
} else if (y <= 23000000000.0) {
tmp = x;
} else {
tmp = y * (-z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.3e-58: tmp = t * (y / a) elif y <= 23000000000.0: tmp = x else: tmp = y * (-z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.3e-58) tmp = Float64(t * Float64(y / a)); elseif (y <= 23000000000.0) tmp = x; else tmp = Float64(y * Float64(Float64(-z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.3e-58) tmp = t * (y / a); elseif (y <= 23000000000.0) tmp = x; else tmp = y * (-z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.3e-58], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 23000000000.0], x, N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-58}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 23000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\end{array}
\end{array}
if y < -4.2999999999999999e-58Initial program 89.3%
associate-/l*99.8%
cancel-sign-sub-inv99.8%
associate-/l*89.3%
distribute-lft-neg-out89.3%
distribute-rgt-neg-in89.3%
associate-*l/98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
*-un-lft-identity98.5%
*-commutative98.5%
+-commutative98.5%
fma-define98.5%
Applied egg-rr98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in t around inf 41.3%
associate-/l*48.9%
Simplified48.9%
if -4.2999999999999999e-58 < y < 2.3e10Initial program 99.5%
associate-/l*86.6%
cancel-sign-sub-inv86.6%
associate-/l*99.5%
distribute-lft-neg-out99.5%
distribute-rgt-neg-in99.5%
associate-*l/97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
+-commutative97.6%
sub-neg97.6%
Simplified97.6%
Taylor expanded in x around inf 62.8%
if 2.3e10 < y Initial program 83.7%
associate-/l*99.8%
cancel-sign-sub-inv99.8%
associate-/l*83.7%
distribute-lft-neg-out83.7%
distribute-rgt-neg-in83.7%
associate-*l/98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
*-un-lft-identity98.5%
*-commutative98.5%
+-commutative98.5%
fma-define98.5%
Applied egg-rr98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in z around inf 44.1%
mul-1-neg44.1%
distribute-frac-neg244.1%
associate-*r/51.0%
Simplified51.0%
Final simplification55.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.9e-57) (not (<= y 16500000000000.0))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.9e-57) || !(y <= 16500000000000.0)) {
tmp = t * (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 ((y <= (-2.9d-57)) .or. (.not. (y <= 16500000000000.0d0))) then
tmp = t * (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 ((y <= -2.9e-57) || !(y <= 16500000000000.0)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.9e-57) or not (y <= 16500000000000.0): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.9e-57) || !(y <= 16500000000000.0)) tmp = Float64(t * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.9e-57) || ~((y <= 16500000000000.0))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.9e-57], N[Not[LessEqual[y, 16500000000000.0]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-57} \lor \neg \left(y \leq 16500000000000\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.90000000000000025e-57 or 1.65e13 < y Initial program 86.1%
associate-/l*99.8%
cancel-sign-sub-inv99.8%
associate-/l*86.1%
distribute-lft-neg-out86.1%
distribute-rgt-neg-in86.1%
associate-*l/98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
*-un-lft-identity98.5%
*-commutative98.5%
+-commutative98.5%
fma-define98.5%
Applied egg-rr98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in t around inf 36.5%
associate-/l*43.0%
Simplified43.0%
if -2.90000000000000025e-57 < y < 1.65e13Initial program 99.5%
associate-/l*86.6%
cancel-sign-sub-inv86.6%
associate-/l*99.5%
distribute-lft-neg-out99.5%
distribute-rgt-neg-in99.5%
associate-*l/97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
+-commutative97.6%
sub-neg97.6%
Simplified97.6%
Taylor expanded in x around inf 62.8%
Final simplification51.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.3e-57) (* t (/ y a)) (if (<= y 17000000000000.0) x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.3e-57) {
tmp = t * (y / a);
} else if (y <= 17000000000000.0) {
tmp = x;
} else {
tmp = 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 (y <= (-3.3d-57)) then
tmp = t * (y / a)
else if (y <= 17000000000000.0d0) then
tmp = x
else
tmp = 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 (y <= -3.3e-57) {
tmp = t * (y / a);
} else if (y <= 17000000000000.0) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.3e-57: tmp = t * (y / a) elif y <= 17000000000000.0: tmp = x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.3e-57) tmp = Float64(t * Float64(y / a)); elseif (y <= 17000000000000.0) tmp = x; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.3e-57) tmp = t * (y / a); elseif (y <= 17000000000000.0) tmp = x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.3e-57], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 17000000000000.0], x, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-57}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 17000000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -3.2999999999999998e-57Initial program 89.3%
associate-/l*99.8%
cancel-sign-sub-inv99.8%
associate-/l*89.3%
distribute-lft-neg-out89.3%
distribute-rgt-neg-in89.3%
associate-*l/98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
*-un-lft-identity98.5%
*-commutative98.5%
+-commutative98.5%
fma-define98.5%
Applied egg-rr98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in t around inf 41.3%
associate-/l*48.9%
Simplified48.9%
if -3.2999999999999998e-57 < y < 1.7e13Initial program 99.5%
associate-/l*86.6%
cancel-sign-sub-inv86.6%
associate-/l*99.5%
distribute-lft-neg-out99.5%
distribute-rgt-neg-in99.5%
associate-*l/97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
+-commutative97.6%
sub-neg97.6%
Simplified97.6%
Taylor expanded in x around inf 62.8%
if 1.7e13 < y Initial program 83.7%
associate-/l*99.8%
cancel-sign-sub-inv99.8%
associate-/l*83.7%
distribute-lft-neg-out83.7%
distribute-rgt-neg-in83.7%
associate-*l/98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
*-un-lft-identity98.5%
*-commutative98.5%
+-commutative98.5%
fma-define98.5%
Applied egg-rr98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in t around inf 32.8%
associate-/l*38.5%
Simplified38.5%
clear-num38.5%
un-div-inv38.6%
Applied egg-rr38.6%
Final simplification51.8%
(FPCore (x y z t a) :precision binary64 (+ x (* (- t z) (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x + ((t - z) * (y / 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 + ((t - z) * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t - z) * (y / a));
}
def code(x, y, z, t, a): return x + ((t - z) * (y / a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t - z) * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t - z) * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - z\right) \cdot \frac{y}{a}
\end{array}
Initial program 92.1%
associate-/l*94.0%
cancel-sign-sub-inv94.0%
associate-/l*92.1%
distribute-lft-neg-out92.1%
distribute-rgt-neg-in92.1%
associate-*l/98.1%
sub-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
+-commutative98.1%
sub-neg98.1%
Simplified98.1%
Final simplification98.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 92.1%
associate-/l*94.0%
cancel-sign-sub-inv94.0%
associate-/l*92.1%
distribute-lft-neg-out92.1%
distribute-rgt-neg-in92.1%
associate-*l/98.1%
sub-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
+-commutative98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in x around inf 38.5%
Final simplification38.5%
(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 2024048
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
: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)))