
(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 12 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
(let* ((t_1 (* y (- z t))))
(if (or (<= t_1 -2e+261) (not (<= t_1 5e+273)))
(- x (/ y (/ a (- z t))))
(+ x (/ (* y (- t z)) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 <= -2e+261) || !(t_1 <= 5e+273)) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((y * (t - 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) :: t_1
real(8) :: tmp
t_1 = y * (z - t)
if ((t_1 <= (-2d+261)) .or. (.not. (t_1 <= 5d+273))) then
tmp = x - (y / (a / (z - t)))
else
tmp = x + ((y * (t - z)) / 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 <= -2e+261) || !(t_1 <= 5e+273)) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) tmp = 0 if (t_1 <= -2e+261) or not (t_1 <= 5e+273): tmp = x - (y / (a / (z - t))) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) tmp = 0.0 if ((t_1 <= -2e+261) || !(t_1 <= 5e+273)) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / 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 <= -2e+261) || ~((t_1 <= 5e+273))) tmp = x - (y / (a / (z - t))); else tmp = x + ((y * (t - z)) / 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, -2e+261], N[Not[LessEqual[t$95$1, 5e+273]], $MachinePrecision]], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+261} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+273}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -1.9999999999999999e261 or 4.99999999999999961e273 < (*.f64 y (-.f64 z t)) Initial program 71.8%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
if -1.9999999999999999e261 < (*.f64 y (-.f64 z t)) < 4.99999999999999961e273Initial program 99.2%
Final simplification99.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ t a)))) (t_2 (* (/ y a) (- t z))))
(if (<= z -2.6e+45)
t_2
(if (<= z -4.2e-62)
t_1
(if (<= z -1.9e-88)
t_2
(if (<= z 2.7e-264)
(+ x (/ (* y t) a))
(if (<= z 5.1e+97) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (t / a));
double t_2 = (y / a) * (t - z);
double tmp;
if (z <= -2.6e+45) {
tmp = t_2;
} else if (z <= -4.2e-62) {
tmp = t_1;
} else if (z <= -1.9e-88) {
tmp = t_2;
} else if (z <= 2.7e-264) {
tmp = x + ((y * t) / a);
} else if (z <= 5.1e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (y * (t / a))
t_2 = (y / a) * (t - z)
if (z <= (-2.6d+45)) then
tmp = t_2
else if (z <= (-4.2d-62)) then
tmp = t_1
else if (z <= (-1.9d-88)) then
tmp = t_2
else if (z <= 2.7d-264) then
tmp = x + ((y * t) / a)
else if (z <= 5.1d+97) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (t / a));
double t_2 = (y / a) * (t - z);
double tmp;
if (z <= -2.6e+45) {
tmp = t_2;
} else if (z <= -4.2e-62) {
tmp = t_1;
} else if (z <= -1.9e-88) {
tmp = t_2;
} else if (z <= 2.7e-264) {
tmp = x + ((y * t) / a);
} else if (z <= 5.1e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (t / a)) t_2 = (y / a) * (t - z) tmp = 0 if z <= -2.6e+45: tmp = t_2 elif z <= -4.2e-62: tmp = t_1 elif z <= -1.9e-88: tmp = t_2 elif z <= 2.7e-264: tmp = x + ((y * t) / a) elif z <= 5.1e+97: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(t / a))) t_2 = Float64(Float64(y / a) * Float64(t - z)) tmp = 0.0 if (z <= -2.6e+45) tmp = t_2; elseif (z <= -4.2e-62) tmp = t_1; elseif (z <= -1.9e-88) tmp = t_2; elseif (z <= 2.7e-264) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= 5.1e+97) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (t / a)); t_2 = (y / a) * (t - z); tmp = 0.0; if (z <= -2.6e+45) tmp = t_2; elseif (z <= -4.2e-62) tmp = t_1; elseif (z <= -1.9e-88) tmp = t_2; elseif (z <= 2.7e-264) tmp = x + ((y * t) / a); elseif (z <= 5.1e+97) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+45], t$95$2, If[LessEqual[z, -4.2e-62], t$95$1, If[LessEqual[z, -1.9e-88], t$95$2, If[LessEqual[z, 2.7e-264], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e+97], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{t}{a}\\
t_2 := \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-88}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-264}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.60000000000000007e45 or -4.1999999999999998e-62 < z < -1.90000000000000006e-88 or 5.10000000000000034e97 < z Initial program 88.3%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in x around 0 71.0%
associate-*r/73.5%
neg-mul-173.5%
distribute-rgt-neg-in73.5%
neg-sub073.5%
div-sub68.7%
associate--r-68.7%
neg-sub068.7%
+-commutative68.7%
sub-neg68.7%
div-sub73.5%
associate-*r/71.0%
*-commutative71.0%
associate-/l*80.0%
Simplified80.0%
if -2.60000000000000007e45 < z < -4.1999999999999998e-62 or 2.69999999999999994e-264 < z < 5.10000000000000034e97Initial program 91.0%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in z around 0 73.9%
mul-1-neg73.9%
*-commutative73.9%
associate-*l/81.0%
distribute-rgt-neg-in81.0%
Simplified81.0%
*-commutative81.0%
cancel-sign-sub81.0%
associate-*r/73.9%
+-commutative73.9%
*-commutative73.9%
associate-/l*81.7%
Applied egg-rr81.7%
if -1.90000000000000006e-88 < z < 2.69999999999999994e-264Initial program 97.7%
sub-neg97.7%
distribute-frac-neg297.7%
+-commutative97.7%
associate-/l*93.1%
fma-define93.1%
distribute-frac-neg293.1%
distribute-neg-frac93.1%
sub-neg93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
+-commutative93.1%
sub-neg93.1%
Simplified93.1%
Taylor expanded in z around 0 93.2%
Final simplification83.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y a) (- t z))))
(if (<= x -1.65e+151)
x
(if (<= x 2.7e+65)
t_1
(if (<= x 4.2e+119) (* y (/ x y)) (if (<= x 1.5e+199) t_1 x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * (t - z);
double tmp;
if (x <= -1.65e+151) {
tmp = x;
} else if (x <= 2.7e+65) {
tmp = t_1;
} else if (x <= 4.2e+119) {
tmp = y * (x / y);
} else if (x <= 1.5e+199) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y / a) * (t - z)
if (x <= (-1.65d+151)) then
tmp = x
else if (x <= 2.7d+65) then
tmp = t_1
else if (x <= 4.2d+119) then
tmp = y * (x / y)
else if (x <= 1.5d+199) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * (t - z);
double tmp;
if (x <= -1.65e+151) {
tmp = x;
} else if (x <= 2.7e+65) {
tmp = t_1;
} else if (x <= 4.2e+119) {
tmp = y * (x / y);
} else if (x <= 1.5e+199) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * (t - z) tmp = 0 if x <= -1.65e+151: tmp = x elif x <= 2.7e+65: tmp = t_1 elif x <= 4.2e+119: tmp = y * (x / y) elif x <= 1.5e+199: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(t - z)) tmp = 0.0 if (x <= -1.65e+151) tmp = x; elseif (x <= 2.7e+65) tmp = t_1; elseif (x <= 4.2e+119) tmp = Float64(y * Float64(x / y)); elseif (x <= 1.5e+199) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * (t - z); tmp = 0.0; if (x <= -1.65e+151) tmp = x; elseif (x <= 2.7e+65) tmp = t_1; elseif (x <= 4.2e+119) tmp = y * (x / y); elseif (x <= 1.5e+199) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e+151], x, If[LessEqual[x, 2.7e+65], t$95$1, If[LessEqual[x, 4.2e+119], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+199], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+151}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+119}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.65000000000000012e151 or 1.5e199 < x Initial program 93.5%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in x around inf 71.9%
if -1.65000000000000012e151 < x < 2.70000000000000019e65 or 4.19999999999999966e119 < x < 1.5e199Initial program 90.8%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in x around 0 70.3%
associate-*r/73.0%
neg-mul-173.0%
distribute-rgt-neg-in73.0%
neg-sub073.0%
div-sub70.9%
associate--r-70.9%
neg-sub070.9%
+-commutative70.9%
sub-neg70.9%
div-sub73.0%
associate-*r/70.3%
*-commutative70.3%
associate-/l*73.9%
Simplified73.9%
if 2.70000000000000019e65 < x < 4.19999999999999966e119Initial program 89.4%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in y around inf 89.3%
associate--l+89.3%
+-commutative89.3%
associate--r-89.3%
div-sub89.3%
Simplified89.3%
Taylor expanded in x around inf 78.5%
Final simplification73.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- a)))))
(if (<= y -2.2e+184)
(/ y (/ a t))
(if (<= y -3.2e+75)
t_1
(if (<= y 6.6e-14) x (if (<= y 8.4e+73) (/ (* y t) a) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / -a);
double tmp;
if (y <= -2.2e+184) {
tmp = y / (a / t);
} else if (y <= -3.2e+75) {
tmp = t_1;
} else if (y <= 6.6e-14) {
tmp = x;
} else if (y <= 8.4e+73) {
tmp = (y * t) / a;
} 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 = y * (z / -a)
if (y <= (-2.2d+184)) then
tmp = y / (a / t)
else if (y <= (-3.2d+75)) then
tmp = t_1
else if (y <= 6.6d-14) then
tmp = x
else if (y <= 8.4d+73) then
tmp = (y * t) / a
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 = y * (z / -a);
double tmp;
if (y <= -2.2e+184) {
tmp = y / (a / t);
} else if (y <= -3.2e+75) {
tmp = t_1;
} else if (y <= 6.6e-14) {
tmp = x;
} else if (y <= 8.4e+73) {
tmp = (y * t) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / -a) tmp = 0 if y <= -2.2e+184: tmp = y / (a / t) elif y <= -3.2e+75: tmp = t_1 elif y <= 6.6e-14: tmp = x elif y <= 8.4e+73: tmp = (y * t) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(-a))) tmp = 0.0 if (y <= -2.2e+184) tmp = Float64(y / Float64(a / t)); elseif (y <= -3.2e+75) tmp = t_1; elseif (y <= 6.6e-14) tmp = x; elseif (y <= 8.4e+73) tmp = Float64(Float64(y * t) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / -a); tmp = 0.0; if (y <= -2.2e+184) tmp = y / (a / t); elseif (y <= -3.2e+75) tmp = t_1; elseif (y <= 6.6e-14) tmp = x; elseif (y <= 8.4e+73) tmp = (y * t) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+184], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.2e+75], t$95$1, If[LessEqual[y, 6.6e-14], x, If[LessEqual[y, 8.4e+73], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{-a}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+184}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{+73}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e184Initial program 77.5%
associate-/l*96.8%
Simplified96.8%
clear-num96.8%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in t around inf 48.2%
associate-/l*56.4%
Simplified56.4%
clear-num56.4%
un-div-inv56.3%
Applied egg-rr56.3%
Taylor expanded in t around 0 48.2%
associate-*r/56.4%
*-commutative56.4%
associate-/r/61.9%
Simplified61.9%
if -2.2e184 < y < -3.19999999999999985e75 or 8.4000000000000005e73 < y Initial program 84.8%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around inf 52.8%
mul-1-neg52.8%
associate-/l*58.9%
distribute-rgt-neg-in58.9%
distribute-neg-frac58.9%
Simplified58.9%
if -3.19999999999999985e75 < y < 6.5999999999999996e-14Initial program 98.2%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in x around inf 54.7%
if 6.5999999999999996e-14 < y < 8.4000000000000005e73Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 67.8%
*-commutative67.8%
Simplified67.8%
Final simplification57.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e+45) (not (<= z 4.2e+44))) (* (/ y a) (- t z)) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+45) || !(z <= 4.2e+44)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4d+45)) .or. (.not. (z <= 4.2d+44))) then
tmp = (y / a) * (t - z)
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+45) || !(z <= 4.2e+44)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e+45) or not (z <= 4.2e+44): tmp = (y / a) * (t - z) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e+45) || !(z <= 4.2e+44)) tmp = Float64(Float64(y / a) * Float64(t - z)); 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 ((z <= -4e+45) || ~((z <= 4.2e+44))) tmp = (y / a) * (t - z); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+45], N[Not[LessEqual[z, 4.2e+44]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+45} \lor \neg \left(z \leq 4.2 \cdot 10^{+44}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -3.9999999999999997e45 or 4.19999999999999974e44 < z Initial program 88.1%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in x around 0 68.3%
associate-*r/71.5%
neg-mul-171.5%
distribute-rgt-neg-in71.5%
neg-sub071.5%
div-sub66.1%
associate--r-66.1%
neg-sub066.1%
+-commutative66.1%
sub-neg66.1%
div-sub71.5%
associate-*r/68.3%
*-commutative68.3%
associate-/l*77.7%
Simplified77.7%
if -3.9999999999999997e45 < z < 4.19999999999999974e44Initial program 93.9%
sub-neg93.9%
distribute-frac-neg293.9%
+-commutative93.9%
associate-/l*96.2%
fma-define96.2%
distribute-frac-neg296.2%
distribute-neg-frac96.2%
sub-neg96.2%
distribute-neg-in96.2%
remove-double-neg96.2%
+-commutative96.2%
sub-neg96.2%
Simplified96.2%
Taylor expanded in z around 0 80.9%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e+42) (not (<= t 2.5e+50))) (+ x (* y (/ t a))) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e+42) || !(t <= 2.5e+50)) {
tmp = x + (y * (t / a));
} else {
tmp = x - (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 ((t <= (-1.6d+42)) .or. (.not. (t <= 2.5d+50))) then
tmp = x + (y * (t / a))
else
tmp = x - (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 ((t <= -1.6e+42) || !(t <= 2.5e+50)) {
tmp = x + (y * (t / a));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.6e+42) or not (t <= 2.5e+50): tmp = x + (y * (t / a)) else: tmp = x - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e+42) || !(t <= 2.5e+50)) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.6e+42) || ~((t <= 2.5e+50))) tmp = x + (y * (t / a)); else tmp = x - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.6e+42], N[Not[LessEqual[t, 2.5e+50]], $MachinePrecision]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+42} \lor \neg \left(t \leq 2.5 \cdot 10^{+50}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.60000000000000001e42 or 2.5e50 < t Initial program 85.0%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 77.4%
mul-1-neg77.4%
*-commutative77.4%
associate-*l/86.9%
distribute-rgt-neg-in86.9%
Simplified86.9%
*-commutative86.9%
cancel-sign-sub86.9%
associate-*r/77.4%
+-commutative77.4%
*-commutative77.4%
associate-/l*84.6%
Applied egg-rr84.6%
if -1.60000000000000001e42 < t < 2.5e50Initial program 95.4%
associate-/l*95.2%
Simplified95.2%
clear-num94.9%
un-div-inv95.4%
Applied egg-rr95.4%
Taylor expanded in z around inf 84.4%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e+41) (not (<= t 3.45e+50))) (+ x (* t (/ y a))) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e+41) || !(t <= 3.45e+50)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (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 ((t <= (-4d+41)) .or. (.not. (t <= 3.45d+50))) then
tmp = x + (t * (y / a))
else
tmp = x - (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 ((t <= -4e+41) || !(t <= 3.45e+50)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e+41) or not (t <= 3.45e+50): tmp = x + (t * (y / a)) else: tmp = x - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e+41) || !(t <= 3.45e+50)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4e+41) || ~((t <= 3.45e+50))) tmp = x + (t * (y / a)); else tmp = x - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e+41], N[Not[LessEqual[t, 3.45e+50]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+41} \lor \neg \left(t \leq 3.45 \cdot 10^{+50}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.00000000000000002e41 or 3.45000000000000016e50 < t Initial program 85.0%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 77.4%
mul-1-neg77.4%
*-commutative77.4%
associate-*l/86.9%
distribute-rgt-neg-in86.9%
Simplified86.9%
if -4.00000000000000002e41 < t < 3.45000000000000016e50Initial program 95.4%
associate-/l*95.2%
Simplified95.2%
clear-num94.9%
un-div-inv95.4%
Applied egg-rr95.4%
Taylor expanded in z around inf 84.4%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.2e+75) (not (<= y 1.55e-13))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.2e+75) || !(y <= 1.55e-13)) {
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 <= (-1.2d+75)) .or. (.not. (y <= 1.55d-13))) 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 <= -1.2e+75) || !(y <= 1.55e-13)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.2e+75) or not (y <= 1.55e-13): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.2e+75) || !(y <= 1.55e-13)) 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 <= -1.2e+75) || ~((y <= 1.55e-13))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.2e+75], N[Not[LessEqual[y, 1.55e-13]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+75} \lor \neg \left(y \leq 1.55 \cdot 10^{-13}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.2e75 or 1.55e-13 < y Initial program 84.7%
associate-/l*97.9%
Simplified97.9%
clear-num97.6%
un-div-inv97.7%
Applied egg-rr97.7%
Taylor expanded in t around inf 41.0%
associate-/l*47.4%
Simplified47.4%
if -1.2e75 < y < 1.55e-13Initial program 98.2%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in x around inf 54.7%
Final simplification51.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.26e+75) (* t (/ y a)) (if (<= y 2.1e-13) x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.26e+75) {
tmp = t * (y / a);
} else if (y <= 2.1e-13) {
tmp = x;
} else {
tmp = 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 <= (-1.26d+75)) then
tmp = t * (y / a)
else if (y <= 2.1d-13) then
tmp = x
else
tmp = 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 <= -1.26e+75) {
tmp = t * (y / a);
} else if (y <= 2.1e-13) {
tmp = x;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.26e+75: tmp = t * (y / a) elif y <= 2.1e-13: tmp = x else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.26e+75) tmp = Float64(t * Float64(y / a)); elseif (y <= 2.1e-13) tmp = x; else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.26e+75) tmp = t * (y / a); elseif (y <= 2.1e-13) tmp = x; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.26e+75], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-13], x, N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{+75}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if y < -1.26000000000000003e75Initial program 83.6%
associate-/l*96.4%
Simplified96.4%
clear-num96.4%
un-div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in t around inf 43.1%
associate-/l*51.0%
Simplified51.0%
if -1.26000000000000003e75 < y < 2.09999999999999989e-13Initial program 98.2%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in x around inf 54.7%
if 2.09999999999999989e-13 < y Initial program 85.6%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around inf 39.4%
*-commutative39.4%
associate-/l*45.9%
Simplified45.9%
Final simplification51.4%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- t z) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((t - z) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{a}
\end{array}
Initial program 91.4%
associate-/l*94.5%
Simplified94.5%
Final simplification94.5%
(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.4%
associate-/l*94.5%
Simplified94.5%
clear-num94.3%
un-div-inv95.3%
Applied egg-rr95.3%
Final simplification95.3%
(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.4%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in x around inf 34.9%
Final simplification34.9%
(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 2024067
(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)))