
(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 10 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 (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
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) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / a) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(t - z\right)
\end{array}
Initial program 92.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 92.1%
associate-*l/97.0%
*-commutative97.0%
Simplified97.0%
Final simplification97.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y) (/ z a))))
(if (<= y -3e+83)
t_1
(if (<= y 2e-25)
x
(if (or (<= y 8e+175) (not (<= y 2.7e+255))) t_1 (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y * (z / a);
double tmp;
if (y <= -3e+83) {
tmp = t_1;
} else if (y <= 2e-25) {
tmp = x;
} else if ((y <= 8e+175) || !(y <= 2.7e+255)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = -y * (z / a)
if (y <= (-3d+83)) then
tmp = t_1
else if (y <= 2d-25) then
tmp = x
else if ((y <= 8d+175) .or. (.not. (y <= 2.7d+255))) then
tmp = t_1
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 t_1 = -y * (z / a);
double tmp;
if (y <= -3e+83) {
tmp = t_1;
} else if (y <= 2e-25) {
tmp = x;
} else if ((y <= 8e+175) || !(y <= 2.7e+255)) {
tmp = t_1;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y * (z / a) tmp = 0 if y <= -3e+83: tmp = t_1 elif y <= 2e-25: tmp = x elif (y <= 8e+175) or not (y <= 2.7e+255): tmp = t_1 else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) * Float64(z / a)) tmp = 0.0 if (y <= -3e+83) tmp = t_1; elseif (y <= 2e-25) tmp = x; elseif ((y <= 8e+175) || !(y <= 2.7e+255)) tmp = t_1; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -y * (z / a); tmp = 0.0; if (y <= -3e+83) tmp = t_1; elseif (y <= 2e-25) tmp = x; elseif ((y <= 8e+175) || ~((y <= 2.7e+255))) tmp = t_1; else tmp = t / (a / y); 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, -3e+83], t$95$1, If[LessEqual[y, 2e-25], x, If[Or[LessEqual[y, 8e+175], N[Not[LessEqual[y, 2.7e+255]], $MachinePrecision]], t$95$1, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-y\right) \cdot \frac{z}{a}\\
\mathbf{if}\;y \leq -3 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-25}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+175} \lor \neg \left(y \leq 2.7 \cdot 10^{+255}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -3e83 or 2.00000000000000008e-25 < y < 7.9999999999999995e175 or 2.7000000000000001e255 < y Initial program 84.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 46.1%
mul-1-neg46.1%
associate-/l*55.8%
distribute-rgt-neg-in55.8%
distribute-neg-frac255.8%
Simplified55.8%
if -3e83 < y < 2.00000000000000008e-25Initial program 97.9%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in x around inf 62.3%
if 7.9999999999999995e175 < y < 2.7000000000000001e255Initial program 78.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 78.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 41.8%
associate-*r/63.1%
Simplified63.1%
clear-num63.1%
div-inv63.1%
Applied egg-rr63.1%
Final simplification60.3%
(FPCore (x y z t a)
:precision binary64
(if (<= y -8e+83)
(* z (/ (- y) a))
(if (<= y 9e-23)
x
(if (<= y 4.75e+204)
(/ z (/ a (- y)))
(if (<= y 1.15e+255) (* t (/ y a)) (* (- y) (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -8e+83) {
tmp = z * (-y / a);
} else if (y <= 9e-23) {
tmp = x;
} else if (y <= 4.75e+204) {
tmp = z / (a / -y);
} else if (y <= 1.15e+255) {
tmp = t * (y / a);
} 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 <= (-8d+83)) then
tmp = z * (-y / a)
else if (y <= 9d-23) then
tmp = x
else if (y <= 4.75d+204) then
tmp = z / (a / -y)
else if (y <= 1.15d+255) then
tmp = t * (y / a)
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 <= -8e+83) {
tmp = z * (-y / a);
} else if (y <= 9e-23) {
tmp = x;
} else if (y <= 4.75e+204) {
tmp = z / (a / -y);
} else if (y <= 1.15e+255) {
tmp = t * (y / a);
} else {
tmp = -y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -8e+83: tmp = z * (-y / a) elif y <= 9e-23: tmp = x elif y <= 4.75e+204: tmp = z / (a / -y) elif y <= 1.15e+255: tmp = t * (y / a) else: tmp = -y * (z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -8e+83) tmp = Float64(z * Float64(Float64(-y) / a)); elseif (y <= 9e-23) tmp = x; elseif (y <= 4.75e+204) tmp = Float64(z / Float64(a / Float64(-y))); elseif (y <= 1.15e+255) tmp = Float64(t * Float64(y / a)); else tmp = Float64(Float64(-y) * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -8e+83) tmp = z * (-y / a); elseif (y <= 9e-23) tmp = x; elseif (y <= 4.75e+204) tmp = z / (a / -y); elseif (y <= 1.15e+255) tmp = t * (y / a); else tmp = -y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -8e+83], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-23], x, If[LessEqual[y, 4.75e+204], N[(z / N[(a / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+255], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+83}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.75 \cdot 10^{+204}:\\
\;\;\;\;\frac{z}{\frac{a}{-y}}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+255}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{a}\\
\end{array}
\end{array}
if y < -8.00000000000000025e83Initial program 80.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 80.9%
associate-*l/97.3%
*-commutative97.3%
Simplified97.3%
clear-num97.1%
un-div-inv97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 40.5%
mul-1-neg40.5%
distribute-frac-neg240.5%
*-commutative40.5%
associate-/l*52.9%
Simplified52.9%
if -8.00000000000000025e83 < y < 8.9999999999999995e-23Initial program 97.9%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in x around inf 62.3%
if 8.9999999999999995e-23 < y < 4.7500000000000001e204Initial program 85.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.8%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 40.4%
mul-1-neg40.4%
associate-*r/48.2%
distribute-rgt-neg-in48.2%
distribute-neg-frac48.2%
Simplified48.2%
*-commutative48.2%
associate-*l/40.4%
associate-*r/52.2%
add-sqr-sqrt34.3%
sqrt-unprod27.5%
sqr-neg27.5%
sqrt-unprod3.2%
add-sqr-sqrt3.8%
clear-num3.8%
div-inv3.8%
frac-2neg3.8%
add-sqr-sqrt0.7%
sqrt-unprod14.3%
sqr-neg14.3%
sqrt-unprod17.9%
add-sqr-sqrt52.2%
distribute-neg-frac252.2%
Applied egg-rr52.2%
if 4.7500000000000001e204 < y < 1.15e255Initial program 80.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 80.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 47.4%
associate-*r/78.7%
Simplified78.7%
if 1.15e255 < y Initial program 84.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 72.6%
mul-1-neg72.6%
associate-/l*88.2%
distribute-rgt-neg-in88.2%
distribute-neg-frac288.2%
Simplified88.2%
Final simplification60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ (- y) a))))
(if (<= y -3.1e+83)
t_1
(if (<= y 2.5e-24)
x
(if (<= y 1.15e+205)
t_1
(if (<= y 1.55e+257) (* t (/ y a)) (* (- y) (/ z a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-y / a);
double tmp;
if (y <= -3.1e+83) {
tmp = t_1;
} else if (y <= 2.5e-24) {
tmp = x;
} else if (y <= 1.15e+205) {
tmp = t_1;
} else if (y <= 1.55e+257) {
tmp = t * (y / a);
} 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) :: t_1
real(8) :: tmp
t_1 = z * (-y / a)
if (y <= (-3.1d+83)) then
tmp = t_1
else if (y <= 2.5d-24) then
tmp = x
else if (y <= 1.15d+205) then
tmp = t_1
else if (y <= 1.55d+257) then
tmp = t * (y / a)
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 t_1 = z * (-y / a);
double tmp;
if (y <= -3.1e+83) {
tmp = t_1;
} else if (y <= 2.5e-24) {
tmp = x;
} else if (y <= 1.15e+205) {
tmp = t_1;
} else if (y <= 1.55e+257) {
tmp = t * (y / a);
} else {
tmp = -y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (-y / a) tmp = 0 if y <= -3.1e+83: tmp = t_1 elif y <= 2.5e-24: tmp = x elif y <= 1.15e+205: tmp = t_1 elif y <= 1.55e+257: tmp = t * (y / a) else: tmp = -y * (z / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(-y) / a)) tmp = 0.0 if (y <= -3.1e+83) tmp = t_1; elseif (y <= 2.5e-24) tmp = x; elseif (y <= 1.15e+205) tmp = t_1; elseif (y <= 1.55e+257) tmp = Float64(t * Float64(y / a)); else tmp = Float64(Float64(-y) * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (-y / a); tmp = 0.0; if (y <= -3.1e+83) tmp = t_1; elseif (y <= 2.5e-24) tmp = x; elseif (y <= 1.15e+205) tmp = t_1; elseif (y <= 1.55e+257) tmp = t * (y / a); else tmp = -y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e+83], t$95$1, If[LessEqual[y, 2.5e-24], x, If[LessEqual[y, 1.15e+205], t$95$1, If[LessEqual[y, 1.55e+257], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{-y}{a}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-24}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+257}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{a}\\
\end{array}
\end{array}
if y < -3.09999999999999992e83 or 2.4999999999999999e-24 < y < 1.15000000000000004e205Initial program 83.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 83.7%
associate-*l/98.7%
*-commutative98.7%
Simplified98.7%
clear-num98.6%
un-div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in z around inf 40.4%
mul-1-neg40.4%
distribute-frac-neg240.4%
*-commutative40.4%
associate-/l*52.5%
Simplified52.5%
if -3.09999999999999992e83 < y < 2.4999999999999999e-24Initial program 97.9%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in x around inf 62.3%
if 1.15000000000000004e205 < y < 1.55e257Initial program 80.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 80.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 47.4%
associate-*r/78.7%
Simplified78.7%
if 1.55e257 < y Initial program 84.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 72.6%
mul-1-neg72.6%
associate-/l*88.2%
distribute-rgt-neg-in88.2%
distribute-neg-frac288.2%
Simplified88.2%
Final simplification60.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e-26) (not (<= z 1.35e+38))) (- x (* z (/ y a))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e-26) || !(z <= 1.35e+38)) {
tmp = x - (z * (y / a));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.7d-26)) .or. (.not. (z <= 1.35d+38))) then
tmp = x - (z * (y / a))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e-26) || !(z <= 1.35e+38)) {
tmp = x - (z * (y / a));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e-26) or not (z <= 1.35e+38): tmp = x - (z * (y / a)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e-26) || !(z <= 1.35e+38)) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.7e-26) || ~((z <= 1.35e+38))) tmp = x - (z * (y / a)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e-26], N[Not[LessEqual[z, 1.35e+38]], $MachinePrecision]], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-26} \lor \neg \left(z \leq 1.35 \cdot 10^{+38}\right):\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.6999999999999999e-26 or 1.34999999999999998e38 < z Initial program 87.8%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around inf 82.7%
*-commutative82.7%
associate-/l*89.5%
Applied egg-rr89.5%
if -3.6999999999999999e-26 < z < 1.34999999999999998e38Initial program 95.8%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in y around 0 95.8%
associate-*l/97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in z around 0 87.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
*-lft-identity87.1%
+-commutative87.1%
associate-*r/89.7%
Simplified89.7%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.3e+84) (not (<= y 9.5e-23))) (* y (/ (- t z) a)) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.3e+84) || !(y <= 9.5e-23)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.3d+84)) .or. (.not. (y <= 9.5d-23))) then
tmp = y * ((t - z) / a)
else
tmp = x + ((t * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.3e+84) || !(y <= 9.5e-23)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.3e+84) or not (y <= 9.5e-23): tmp = y * ((t - z) / a) else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.3e+84) || !(y <= 9.5e-23)) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.3e+84) || ~((y <= 9.5e-23))) tmp = y * ((t - z) / a); else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.3e+84], N[Not[LessEqual[y, 9.5e-23]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+84} \lor \neg \left(y \leq 9.5 \cdot 10^{-23}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if y < -1.3000000000000001e84 or 9.50000000000000058e-23 < y Initial program 83.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 70.0%
mul-1-neg70.0%
distribute-frac-neg270.0%
sub-neg70.0%
+-commutative70.0%
neg-sub070.0%
associate--r-70.0%
neg-sub070.0%
associate-*r/83.6%
distribute-neg-frac83.6%
distribute-neg-frac283.6%
remove-double-neg83.6%
Simplified83.6%
if -1.3000000000000001e84 < y < 9.50000000000000058e-23Initial program 97.9%
sub-neg97.9%
distribute-frac-neg297.9%
+-commutative97.9%
associate-/l*93.8%
fma-define93.8%
distribute-frac-neg293.8%
distribute-neg-frac93.8%
sub-neg93.8%
distribute-neg-in93.8%
remove-double-neg93.8%
+-commutative93.8%
sub-neg93.8%
Simplified93.8%
Taylor expanded in z around 0 81.1%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.3e+52) (not (<= y 4.1e-171))) (* y (/ (- t z) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.3e+52) || !(y <= 4.1e-171)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-4.3d+52)) .or. (.not. (y <= 4.1d-171))) then
tmp = y * ((t - z) / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.3e+52) || !(y <= 4.1e-171)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.3e+52) or not (y <= 4.1e-171): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.3e+52) || !(y <= 4.1e-171)) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.3e+52) || ~((y <= 4.1e-171))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.3e+52], N[Not[LessEqual[y, 4.1e-171]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+52} \lor \neg \left(y \leq 4.1 \cdot 10^{-171}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.3e52 or 4.1e-171 < y Initial program 87.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 64.9%
mul-1-neg64.9%
distribute-frac-neg264.9%
sub-neg64.9%
+-commutative64.9%
neg-sub064.9%
associate--r-64.9%
neg-sub064.9%
associate-*r/75.3%
distribute-neg-frac75.3%
distribute-neg-frac275.3%
remove-double-neg75.3%
Simplified75.3%
if -4.3e52 < y < 4.1e-171Initial program 98.1%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in x around inf 67.8%
Final simplification72.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.8e-15) x (if (<= a 0.0021) (* t (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e-15) {
tmp = x;
} else if (a <= 0.0021) {
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 (a <= (-6.8d-15)) then
tmp = x
else if (a <= 0.0021d0) 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 (a <= -6.8e-15) {
tmp = x;
} else if (a <= 0.0021) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.8e-15: tmp = x elif a <= 0.0021: tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.8e-15) tmp = x; elseif (a <= 0.0021) 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 (a <= -6.8e-15) tmp = x; elseif (a <= 0.0021) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.8e-15], x, If[LessEqual[a, 0.0021], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 0.0021:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.8000000000000001e-15 or 0.00209999999999999987 < a Initial program 88.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 64.1%
if -6.8000000000000001e-15 < a < 0.00209999999999999987Initial program 97.9%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in y around 0 97.9%
associate-*l/97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 46.1%
associate-*r/49.7%
Simplified49.7%
(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 92.1%
associate-/l*96.2%
Simplified96.2%
Final simplification96.2%
(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*96.2%
Simplified96.2%
Taylor expanded in x around inf 44.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(- x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(- x (/ (* y (- z t)) a))
(- x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x - (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x - ((y * (z - t)) / a)
else
tmp = x - (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x - (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x - ((y * (z - t)) / a) else: tmp = x - (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x - Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x - Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x - (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x - ((y * (z - t)) / a); else tmp = x - (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x - N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024091
(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)))