
(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 (<= y -1.5e+80) (+ x (* y (/ (- z t) a))) (if (<= y 7.5e-125) (+ x (/ (* (- z t) y) a)) (+ x (/ y (/ a (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.5e+80) {
tmp = x + (y * ((z - t) / a));
} else if (y <= 7.5e-125) {
tmp = x + (((z - t) * 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 (y <= (-1.5d+80)) then
tmp = x + (y * ((z - t) / a))
else if (y <= 7.5d-125) then
tmp = x + (((z - t) * 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 (y <= -1.5e+80) {
tmp = x + (y * ((z - t) / a));
} else if (y <= 7.5e-125) {
tmp = x + (((z - t) * y) / a);
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.5e+80: tmp = x + (y * ((z - t) / a)) elif y <= 7.5e-125: tmp = x + (((z - t) * y) / a) else: tmp = x + (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.5e+80) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (y <= 7.5e-125) tmp = Float64(x + Float64(Float64(Float64(z - t) * 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 (y <= -1.5e+80) tmp = x + (y * ((z - t) / a)); elseif (y <= 7.5e-125) tmp = x + (((z - t) * y) / a); else tmp = x + (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.5e+80], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-125], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+80}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-125}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if y < -1.49999999999999993e80Initial program 77.3%
associate-/l*99.9%
Simplified99.9%
if -1.49999999999999993e80 < y < 7.5e-125Initial program 99.7%
if 7.5e-125 < y Initial program 90.9%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y (- a)))))
(if (<= t -5.5e+82)
t_1
(if (<= t 1.25e-242)
x
(if (<= t 2.1e-150) (* y (/ z a)) (if (<= t 7.5e+25) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -5.5e+82) {
tmp = t_1;
} else if (t <= 1.25e-242) {
tmp = x;
} else if (t <= 2.1e-150) {
tmp = y * (z / a);
} else if (t <= 7.5e+25) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y / -a)
if (t <= (-5.5d+82)) then
tmp = t_1
else if (t <= 1.25d-242) then
tmp = x
else if (t <= 2.1d-150) then
tmp = y * (z / a)
else if (t <= 7.5d+25) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -5.5e+82) {
tmp = t_1;
} else if (t <= 1.25e-242) {
tmp = x;
} else if (t <= 2.1e-150) {
tmp = y * (z / a);
} else if (t <= 7.5e+25) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / -a) tmp = 0 if t <= -5.5e+82: tmp = t_1 elif t <= 1.25e-242: tmp = x elif t <= 2.1e-150: tmp = y * (z / a) elif t <= 7.5e+25: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / Float64(-a))) tmp = 0.0 if (t <= -5.5e+82) tmp = t_1; elseif (t <= 1.25e-242) tmp = x; elseif (t <= 2.1e-150) tmp = Float64(y * Float64(z / a)); elseif (t <= 7.5e+25) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / -a); tmp = 0.0; if (t <= -5.5e+82) tmp = t_1; elseif (t <= 1.25e-242) tmp = x; elseif (t <= 2.1e-150) tmp = y * (z / a); elseif (t <= 7.5e+25) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+82], t$95$1, If[LessEqual[t, 1.25e-242], x, If[LessEqual[t, 2.1e-150], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+25], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{-a}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-242}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-150}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.49999999999999997e82 or 7.49999999999999993e25 < t Initial program 86.8%
+-commutative86.8%
associate-/l*90.3%
fma-define90.3%
Simplified90.3%
fma-undefine90.3%
associate-*r/86.8%
*-commutative86.8%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in z around 0 76.6%
associate-+r+76.6%
mul-1-neg76.6%
associate-*l/77.5%
*-commutative77.5%
sub-neg77.5%
associate-*l/79.1%
*-commutative79.1%
*-commutative79.1%
associate-*l/74.7%
associate-*r/86.1%
Simplified86.1%
Taylor expanded in t around inf 60.2%
associate-*r/67.7%
associate-*r*67.7%
neg-mul-167.7%
*-commutative67.7%
Simplified67.7%
if -5.49999999999999997e82 < t < 1.25e-242 or 2.1000000000000001e-150 < t < 7.49999999999999993e25Initial program 96.9%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 58.2%
if 1.25e-242 < t < 2.1000000000000001e-150Initial program 84.5%
+-commutative84.5%
associate-/l*99.6%
fma-define99.6%
Simplified99.6%
fma-undefine99.6%
associate-*r/84.5%
*-commutative84.5%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 84.5%
associate-+r+84.5%
mul-1-neg84.5%
associate-*l/84.5%
*-commutative84.5%
sub-neg84.5%
associate-*l/99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l/99.9%
associate-*r/83.2%
Simplified83.2%
Taylor expanded in z around inf 51.7%
associate-*r/66.8%
Simplified66.8%
Final simplification62.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- z t) -1e+27) (not (<= (- z t) 5e+82))) (* (- z t) (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - t) <= -1e+27) || !((z - t) <= 5e+82)) {
tmp = (z - 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 (((z - t) <= (-1d+27)) .or. (.not. ((z - t) <= 5d+82))) then
tmp = (z - 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 (((z - t) <= -1e+27) || !((z - t) <= 5e+82)) {
tmp = (z - t) * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((z - t) <= -1e+27) or not ((z - t) <= 5e+82): tmp = (z - t) * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(z - t) <= -1e+27) || !(Float64(z - t) <= 5e+82)) tmp = Float64(Float64(z - t) * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((z - t) <= -1e+27) || ~(((z - t) <= 5e+82))) tmp = (z - t) * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(z - t), $MachinePrecision], -1e+27], N[Not[LessEqual[N[(z - t), $MachinePrecision], 5e+82]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -1 \cdot 10^{+27} \lor \neg \left(z - t \leq 5 \cdot 10^{+82}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (-.f64 z t) < -1e27 or 5.00000000000000015e82 < (-.f64 z t) Initial program 86.7%
+-commutative86.7%
associate-/l*92.6%
fma-define92.6%
Simplified92.6%
fma-undefine92.6%
associate-*r/86.7%
*-commutative86.7%
associate-/l*98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 78.4%
associate-+r+78.4%
mul-1-neg78.4%
associate-*l/79.1%
*-commutative79.1%
sub-neg79.1%
associate-*l/83.7%
*-commutative83.7%
*-commutative83.7%
associate-*l/80.7%
associate-*r/86.6%
Simplified86.6%
Taylor expanded in x around 0 57.6%
associate-*l/59.3%
associate-*r/63.9%
*-commutative63.9%
distribute-lft-out--75.4%
Simplified75.4%
if -1e27 < (-.f64 z t) < 5.00000000000000015e82Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 67.1%
Final simplification72.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8e-23) (not (<= t 6.5e+62))) (- x (* t (/ y a))) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e-23) || !(t <= 6.5e+62)) {
tmp = x - (t * (y / 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 <= (-8d-23)) .or. (.not. (t <= 6.5d+62))) then
tmp = x - (t * (y / 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 <= -8e-23) || !(t <= 6.5e+62)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8e-23) or not (t <= 6.5e+62): tmp = x - (t * (y / a)) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8e-23) || !(t <= 6.5e+62)) tmp = Float64(x - Float64(t * Float64(y / 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 <= -8e-23) || ~((t <= 6.5e+62))) tmp = x - (t * (y / a)); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8e-23], N[Not[LessEqual[t, 6.5e+62]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-23} \lor \neg \left(t \leq 6.5 \cdot 10^{+62}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -7.99999999999999968e-23 or 6.5000000000000003e62 < t Initial program 88.9%
+-commutative88.9%
associate-/l*92.0%
fma-define92.0%
Simplified92.0%
fma-undefine92.0%
associate-*r/88.9%
*-commutative88.9%
associate-/l*97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 82.4%
associate-*l/85.5%
*-commutative85.5%
neg-mul-185.5%
sub-neg85.5%
*-commutative85.5%
associate-*l/82.4%
associate-*r/90.3%
Simplified90.3%
if -7.99999999999999968e-23 < t < 6.5000000000000003e62Initial program 94.3%
+-commutative94.3%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
fma-undefine98.5%
associate-*r/94.3%
*-commutative94.3%
associate-/l*98.6%
Applied egg-rr98.6%
Taylor expanded in z around inf 87.0%
associate-*l/92.5%
*-commutative92.5%
Simplified92.5%
clear-num92.5%
un-div-inv92.5%
Applied egg-rr92.5%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.1e+109) (not (<= t 1.85e+90))) (* (- z t) (/ y a)) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.1e+109) || !(t <= 1.85e+90)) {
tmp = (z - t) * (y / 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 <= (-6.1d+109)) .or. (.not. (t <= 1.85d+90))) then
tmp = (z - t) * (y / 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 <= -6.1e+109) || !(t <= 1.85e+90)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.1e+109) or not (t <= 1.85e+90): tmp = (z - t) * (y / a) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.1e+109) || !(t <= 1.85e+90)) tmp = Float64(Float64(z - t) * Float64(y / 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 <= -6.1e+109) || ~((t <= 1.85e+90))) tmp = (z - t) * (y / a); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.1e+109], N[Not[LessEqual[t, 1.85e+90]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.1 \cdot 10^{+109} \lor \neg \left(t \leq 1.85 \cdot 10^{+90}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -6.10000000000000008e109 or 1.85e90 < t Initial program 85.6%
+-commutative85.6%
associate-/l*88.9%
fma-define88.9%
Simplified88.9%
fma-undefine88.9%
associate-*r/85.6%
*-commutative85.6%
associate-/l*97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 75.1%
associate-+r+75.1%
mul-1-neg75.1%
associate-*l/75.2%
*-commutative75.2%
sub-neg75.2%
associate-*l/76.1%
*-commutative76.1%
*-commutative76.1%
associate-*l/72.7%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in x around 0 59.6%
associate-*l/57.3%
associate-*r/67.9%
*-commutative67.9%
distribute-lft-out--80.6%
Simplified80.6%
if -6.10000000000000008e109 < t < 1.85e90Initial program 94.9%
+-commutative94.9%
associate-/l*98.7%
fma-define98.7%
Simplified98.7%
fma-undefine98.7%
associate-*r/94.9%
*-commutative94.9%
associate-/l*98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 82.3%
associate-*l/86.7%
*-commutative86.7%
Simplified86.7%
clear-num86.7%
un-div-inv86.7%
Applied egg-rr86.7%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.3e+109) (not (<= t 7.1e+87))) (* (- z t) (/ y a)) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.3e+109) || !(t <= 7.1e+87)) {
tmp = (z - 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 <= (-3.3d+109)) .or. (.not. (t <= 7.1d+87))) then
tmp = (z - 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 <= -3.3e+109) || !(t <= 7.1e+87)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.3e+109) or not (t <= 7.1e+87): tmp = (z - t) * (y / a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.3e+109) || !(t <= 7.1e+87)) tmp = Float64(Float64(z - 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 <= -3.3e+109) || ~((t <= 7.1e+87))) tmp = (z - t) * (y / a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.3e+109], N[Not[LessEqual[t, 7.1e+87]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+109} \lor \neg \left(t \leq 7.1 \cdot 10^{+87}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.2999999999999999e109 or 7.0999999999999998e87 < t Initial program 85.6%
+-commutative85.6%
associate-/l*88.9%
fma-define88.9%
Simplified88.9%
fma-undefine88.9%
associate-*r/85.6%
*-commutative85.6%
associate-/l*97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 75.1%
associate-+r+75.1%
mul-1-neg75.1%
associate-*l/75.2%
*-commutative75.2%
sub-neg75.2%
associate-*l/76.1%
*-commutative76.1%
*-commutative76.1%
associate-*l/72.7%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in x around 0 59.6%
associate-*l/57.3%
associate-*r/67.9%
*-commutative67.9%
distribute-lft-out--80.6%
Simplified80.6%
if -3.2999999999999999e109 < t < 7.0999999999999998e87Initial program 94.9%
+-commutative94.9%
associate-/l*98.7%
fma-define98.7%
Simplified98.7%
fma-undefine98.7%
associate-*r/94.9%
*-commutative94.9%
associate-/l*98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 82.3%
associate-*l/86.7%
*-commutative86.7%
Simplified86.7%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+109) (not (<= t 3.8e+26))) (* (- z t) (/ y a)) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+109) || !(t <= 3.8e+26)) {
tmp = (z - t) * (y / a);
} 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 <= (-3.4d+109)) .or. (.not. (t <= 3.8d+26))) then
tmp = (z - t) * (y / a)
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 <= -3.4e+109) || !(t <= 3.8e+26)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e+109) or not (t <= 3.8e+26): tmp = (z - t) * (y / a) else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+109) || !(t <= 3.8e+26)) tmp = Float64(Float64(z - t) * Float64(y / a)); 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 <= -3.4e+109) || ~((t <= 3.8e+26))) tmp = (z - t) * (y / a); else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+109], N[Not[LessEqual[t, 3.8e+26]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+109} \lor \neg \left(t \leq 3.8 \cdot 10^{+26}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.40000000000000006e109 or 3.8000000000000002e26 < t Initial program 86.4%
+-commutative86.4%
associate-/l*89.3%
fma-define89.3%
Simplified89.3%
fma-undefine89.3%
associate-*r/86.4%
*-commutative86.4%
associate-/l*97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 77.1%
associate-+r+77.1%
mul-1-neg77.1%
associate-*l/77.3%
*-commutative77.3%
sub-neg77.3%
associate-*l/79.0%
*-commutative79.0%
*-commutative79.0%
associate-*l/75.1%
associate-*r/86.7%
Simplified86.7%
Taylor expanded in x around 0 60.7%
associate-*l/58.6%
associate-*r/68.2%
*-commutative68.2%
distribute-lft-out--79.4%
Simplified79.4%
if -3.40000000000000006e109 < t < 3.8000000000000002e26Initial program 95.1%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in t around 0 83.3%
+-commutative83.3%
associate-/l*86.8%
Simplified86.8%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.5e+109) (not (<= t 6e+25))) (* (- z t) (/ y a)) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e+109) || !(t <= 6e+25)) {
tmp = (z - 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 <= (-5.5d+109)) .or. (.not. (t <= 6d+25))) then
tmp = (z - 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 <= -5.5e+109) || !(t <= 6e+25)) {
tmp = (z - t) * (y / a);
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.5e+109) or not (t <= 6e+25): tmp = (z - t) * (y / a) else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.5e+109) || !(t <= 6e+25)) tmp = Float64(Float64(z - t) * Float64(y / 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 ((t <= -5.5e+109) || ~((t <= 6e+25))) tmp = (z - t) * (y / a); else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.5e+109], N[Not[LessEqual[t, 6e+25]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+109} \lor \neg \left(t \leq 6 \cdot 10^{+25}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -5.4999999999999998e109 or 6.00000000000000011e25 < t Initial program 86.4%
+-commutative86.4%
associate-/l*89.3%
fma-define89.3%
Simplified89.3%
fma-undefine89.3%
associate-*r/86.4%
*-commutative86.4%
associate-/l*97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 77.1%
associate-+r+77.1%
mul-1-neg77.1%
associate-*l/77.3%
*-commutative77.3%
sub-neg77.3%
associate-*l/79.0%
*-commutative79.0%
*-commutative79.0%
associate-*l/75.1%
associate-*r/86.7%
Simplified86.7%
Taylor expanded in x around 0 60.7%
associate-*l/58.6%
associate-*r/68.2%
*-commutative68.2%
distribute-lft-out--79.4%
Simplified79.4%
if -5.4999999999999998e109 < t < 6.00000000000000011e25Initial program 95.1%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in z around inf 83.3%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.2e+113) (not (<= y 1.45e+45))) (* y (/ z a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.2e+113) || !(y <= 1.45e+45)) {
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 <= (-3.2d+113)) .or. (.not. (y <= 1.45d+45))) 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 <= -3.2e+113) || !(y <= 1.45e+45)) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.2e+113) or not (y <= 1.45e+45): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.2e+113) || !(y <= 1.45e+45)) 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 <= -3.2e+113) || ~((y <= 1.45e+45))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.2e+113], N[Not[LessEqual[y, 1.45e+45]], $MachinePrecision]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+113} \lor \neg \left(y \leq 1.45 \cdot 10^{+45}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.1999999999999998e113 or 1.4499999999999999e45 < y Initial program 81.6%
+-commutative81.6%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
fma-undefine99.8%
associate-*r/81.6%
*-commutative81.6%
associate-/l*98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 71.7%
associate-+r+71.7%
mul-1-neg71.7%
associate-*l/80.0%
*-commutative80.0%
sub-neg80.0%
associate-*l/87.2%
*-commutative87.2%
*-commutative87.2%
associate-*l/75.3%
associate-*r/80.3%
Simplified80.3%
Taylor expanded in z around inf 42.2%
associate-*r/49.6%
Simplified49.6%
if -3.1999999999999998e113 < y < 1.4499999999999999e45Initial program 98.5%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in x around inf 56.4%
Final simplification53.7%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (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 + ((z - t) * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a}
\end{array}
Initial program 91.8%
+-commutative91.8%
associate-/l*95.4%
fma-define95.4%
Simplified95.4%
fma-undefine95.4%
associate-*r/91.8%
*-commutative91.8%
associate-/l*98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ a (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / (a / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / (a / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / (a / (z - t)));
}
def code(x, y, z, t, a): return x + (y / (a / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(a / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / (a / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a}{z - t}}
\end{array}
Initial program 91.8%
associate-/l*95.4%
Simplified95.4%
clear-num95.4%
un-div-inv95.5%
Applied egg-rr95.5%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a}
\end{array}
Initial program 91.8%
associate-/l*95.4%
Simplified95.4%
(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 91.8%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in x around inf 40.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 2024100
(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)))