
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e-170) (not (<= a 2.7e-194))) (+ x (* y (/ (- t z) a))) (/ (* y (- t z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-170) || !(a <= 2.7e-194)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = (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) :: tmp
if ((a <= (-2.5d-170)) .or. (.not. (a <= 2.7d-194))) then
tmp = x + (y * ((t - z) / a))
else
tmp = (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 tmp;
if ((a <= -2.5e-170) || !(a <= 2.7e-194)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = (y * (t - z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e-170) or not (a <= 2.7e-194): tmp = x + (y * ((t - z) / a)) else: tmp = (y * (t - z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e-170) || !(a <= 2.7e-194)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(Float64(y * Float64(t - z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.5e-170) || ~((a <= 2.7e-194))) tmp = x + (y * ((t - z) / a)); else tmp = (y * (t - z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e-170], N[Not[LessEqual[a, 2.7e-194]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-170} \lor \neg \left(a \leq 2.7 \cdot 10^{-194}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if a < -2.50000000000000005e-170 or 2.7e-194 < a Initial program 90.0%
associate-/l*96.9%
Simplified96.9%
if -2.50000000000000005e-170 < a < 2.7e-194Initial program 98.2%
sub-neg98.2%
distribute-frac-neg298.2%
+-commutative98.2%
associate-/l*74.7%
fma-define74.7%
distribute-frac-neg274.7%
distribute-neg-frac74.7%
sub-neg74.7%
distribute-neg-in74.7%
remove-double-neg74.7%
+-commutative74.7%
sub-neg74.7%
Simplified74.7%
Taylor expanded in y around -inf 96.7%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.8e-40) (not (<= t 1.95e+27))) (+ x (/ y (/ a t))) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.8e-40) || !(t <= 1.95e+27)) {
tmp = x + (y / (a / t));
} 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 <= (-2.8d-40)) .or. (.not. (t <= 1.95d+27))) then
tmp = x + (y / (a / t))
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 <= -2.8e-40) || !(t <= 1.95e+27)) {
tmp = x + (y / (a / t));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.8e-40) or not (t <= 1.95e+27): tmp = x + (y / (a / t)) else: tmp = x - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.8e-40) || !(t <= 1.95e+27)) tmp = Float64(x + Float64(y / Float64(a / t))); 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 <= -2.8e-40) || ~((t <= 1.95e+27))) tmp = x + (y / (a / t)); else tmp = x - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.8e-40], N[Not[LessEqual[t, 1.95e+27]], $MachinePrecision]], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-40} \lor \neg \left(t \leq 1.95 \cdot 10^{+27}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.8e-40 or 1.9499999999999999e27 < t Initial program 88.9%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in y around 0 88.9%
associate-*l/97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in z around 0 81.1%
mul-1-neg81.1%
associate-*r/86.3%
distribute-rgt-neg-in86.3%
*-commutative86.3%
distribute-frac-neg86.3%
associate-/r/82.1%
Simplified82.1%
if -2.8e-40 < t < 1.9499999999999999e27Initial program 95.2%
associate-/l*95.3%
Simplified95.3%
clear-num95.3%
un-div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in z around inf 90.1%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e-40) (not (<= t 2.4e+28))) (+ x (/ (* t y) a)) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-40) || !(t <= 2.4e+28)) {
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 <= (-2.7d-40)) .or. (.not. (t <= 2.4d+28))) 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 <= -2.7e-40) || !(t <= 2.4e+28)) {
tmp = x + ((t * y) / a);
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e-40) or not (t <= 2.4e+28): 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 <= -2.7e-40) || !(t <= 2.4e+28)) tmp = Float64(x + Float64(Float64(t * 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 <= -2.7e-40) || ~((t <= 2.4e+28))) 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, -2.7e-40], N[Not[LessEqual[t, 2.4e+28]], $MachinePrecision]], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-40} \lor \neg \left(t \leq 2.4 \cdot 10^{+28}\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.7e-40 or 2.39999999999999981e28 < t Initial program 88.9%
sub-neg88.9%
distribute-frac-neg288.9%
+-commutative88.9%
associate-/l*88.7%
fma-define88.7%
distribute-frac-neg288.7%
distribute-neg-frac88.7%
sub-neg88.7%
distribute-neg-in88.7%
remove-double-neg88.7%
+-commutative88.7%
sub-neg88.7%
Simplified88.7%
Taylor expanded in z around 0 81.1%
if -2.7e-40 < t < 2.39999999999999981e28Initial program 95.2%
associate-/l*95.3%
Simplified95.3%
clear-num95.3%
un-div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in z around inf 90.1%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e-170) (not (<= a 3.7e-131))) (+ x (* y (/ t a))) (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-170) || !(a <= 3.7e-131)) {
tmp = x + (y * (t / a));
} else {
tmp = (y / a) * (t - 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 ((a <= (-2.5d-170)) .or. (.not. (a <= 3.7d-131))) then
tmp = x + (y * (t / a))
else
tmp = (y / a) * (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-170) || !(a <= 3.7e-131)) {
tmp = x + (y * (t / a));
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e-170) or not (a <= 3.7e-131): tmp = x + (y * (t / a)) else: tmp = (y / a) * (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e-170) || !(a <= 3.7e-131)) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(Float64(y / a) * Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.5e-170) || ~((a <= 3.7e-131))) tmp = x + (y * (t / a)); else tmp = (y / a) * (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e-170], N[Not[LessEqual[a, 3.7e-131]], $MachinePrecision]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-170} \lor \neg \left(a \leq 3.7 \cdot 10^{-131}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -2.50000000000000005e-170 or 3.7000000000000002e-131 < a Initial program 89.4%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in z around 0 78.7%
neg-mul-178.7%
Simplified78.7%
cancel-sign-sub-inv78.7%
distribute-lft-neg-in78.7%
*-commutative78.7%
associate-*l/75.5%
distribute-lft-neg-in75.5%
distribute-frac-neg275.5%
frac-2neg75.5%
+-commutative75.5%
div-inv75.5%
*-commutative75.5%
associate-*l*78.7%
div-inv78.7%
Applied egg-rr78.7%
if -2.50000000000000005e-170 < a < 3.7000000000000002e-131Initial program 98.5%
associate-/l*77.3%
Simplified77.3%
Taylor expanded in y around 0 98.5%
associate-*l/94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in y around inf 64.6%
distribute-lft-out--58.9%
associate-/l*66.8%
associate-*r/83.0%
associate-*l/72.0%
associate-*l/69.0%
distribute-lft-out--89.1%
Simplified89.1%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e-170) (not (<= a 8.5e-140))) (+ x (/ (* t y) a)) (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-170) || !(a <= 8.5e-140)) {
tmp = x + ((t * y) / a);
} else {
tmp = (y / a) * (t - 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 ((a <= (-2.5d-170)) .or. (.not. (a <= 8.5d-140))) then
tmp = x + ((t * y) / a)
else
tmp = (y / a) * (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-170) || !(a <= 8.5e-140)) {
tmp = x + ((t * y) / a);
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e-170) or not (a <= 8.5e-140): tmp = x + ((t * y) / a) else: tmp = (y / a) * (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e-170) || !(a <= 8.5e-140)) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(Float64(y / a) * Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.5e-170) || ~((a <= 8.5e-140))) tmp = x + ((t * y) / a); else tmp = (y / a) * (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e-170], N[Not[LessEqual[a, 8.5e-140]], $MachinePrecision]], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-170} \lor \neg \left(a \leq 8.5 \cdot 10^{-140}\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -2.50000000000000005e-170 or 8.49999999999999997e-140 < a Initial program 89.5%
sub-neg89.5%
distribute-frac-neg289.5%
+-commutative89.5%
associate-/l*96.8%
fma-define96.8%
distribute-frac-neg296.8%
distribute-neg-frac96.8%
sub-neg96.8%
distribute-neg-in96.8%
remove-double-neg96.8%
+-commutative96.8%
sub-neg96.8%
Simplified96.8%
Taylor expanded in z around 0 75.8%
if -2.50000000000000005e-170 < a < 8.49999999999999997e-140Initial program 98.5%
associate-/l*78.1%
Simplified78.1%
Taylor expanded in y around 0 98.5%
associate-*l/94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in y around inf 65.0%
distribute-lft-out--59.2%
associate-/l*67.3%
associate-*r/84.0%
associate-*l/72.6%
associate-*l/69.6%
distribute-lft-out--90.3%
Simplified90.3%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.5e+80) x (if (<= a 7.6e+103) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.5e+80) {
tmp = x;
} else if (a <= 7.6e+103) {
tmp = (y / a) * (t - z);
} 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.5d+80)) then
tmp = x
else if (a <= 7.6d+103) then
tmp = (y / a) * (t - z)
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.5e+80) {
tmp = x;
} else if (a <= 7.6e+103) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.5e+80: tmp = x elif a <= 7.6e+103: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.5e+80) tmp = x; elseif (a <= 7.6e+103) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.5e+80) tmp = x; elseif (a <= 7.6e+103) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.5e+80], x, If[LessEqual[a, 7.6e+103], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{+103}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.4999999999999998e80 or 7.5999999999999994e103 < a Initial program 85.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 75.1%
if -6.4999999999999998e80 < a < 7.5999999999999994e103Initial program 95.1%
associate-/l*87.9%
Simplified87.9%
Taylor expanded in y around 0 95.1%
associate-*l/96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in y around inf 63.0%
distribute-lft-out--60.7%
associate-/l*61.2%
associate-*r/67.8%
associate-*l/64.3%
associate-*l/65.1%
distribute-lft-out--73.8%
Simplified73.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.5e+80) x (if (<= a 6.2e+102) (* y (/ (- t z) a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e+80) {
tmp = x;
} else if (a <= 6.2e+102) {
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 (a <= (-5.5d+80)) then
tmp = x
else if (a <= 6.2d+102) 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 (a <= -5.5e+80) {
tmp = x;
} else if (a <= 6.2e+102) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e+80: tmp = x elif a <= 6.2e+102: tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e+80) tmp = x; elseif (a <= 6.2e+102) 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 (a <= -5.5e+80) tmp = x; elseif (a <= 6.2e+102) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e+80], x, If[LessEqual[a, 6.2e+102], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+102}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.49999999999999967e80 or 6.19999999999999973e102 < a Initial program 85.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 75.1%
if -5.49999999999999967e80 < a < 6.19999999999999973e102Initial program 95.1%
associate-/l*87.9%
Simplified87.9%
Taylor expanded in x around 0 71.9%
mul-1-neg71.9%
distribute-frac-neg71.9%
distribute-rgt-neg-in71.9%
sub-neg71.9%
distribute-neg-in71.9%
remove-double-neg71.9%
+-commutative71.9%
sub-neg71.9%
associate-*r/66.5%
Simplified66.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e-23) x (if (<= a 1.4e-9) (/ t (/ a y)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e-23) {
tmp = x;
} else if (a <= 1.4e-9) {
tmp = t / (a / y);
} 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 <= (-4.2d-23)) then
tmp = x
else if (a <= 1.4d-9) then
tmp = t / (a / y)
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 <= -4.2e-23) {
tmp = x;
} else if (a <= 1.4e-9) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.2e-23: tmp = x elif a <= 1.4e-9: tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e-23) tmp = x; elseif (a <= 1.4e-9) tmp = Float64(t / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.2e-23) tmp = x; elseif (a <= 1.4e-9) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e-23], x, If[LessEqual[a, 1.4e-9], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.2000000000000002e-23 or 1.39999999999999992e-9 < a Initial program 84.7%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 62.9%
if -4.2000000000000002e-23 < a < 1.39999999999999992e-9Initial program 99.2%
associate-/l*84.4%
Simplified84.4%
Taylor expanded in t around inf 48.6%
associate-/l*51.6%
*-commutative51.6%
Applied egg-rr51.6%
*-commutative51.6%
clear-num51.6%
un-div-inv51.8%
Applied egg-rr51.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.25e-26) x (if (<= a 1.35e-8) (* t (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.25e-26) {
tmp = x;
} else if (a <= 1.35e-8) {
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 <= (-2.25d-26)) then
tmp = x
else if (a <= 1.35d-8) 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 <= -2.25e-26) {
tmp = x;
} else if (a <= 1.35e-8) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.25e-26: tmp = x elif a <= 1.35e-8: tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.25e-26) tmp = x; elseif (a <= 1.35e-8) 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 <= -2.25e-26) tmp = x; elseif (a <= 1.35e-8) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.25e-26], x, If[LessEqual[a, 1.35e-8], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-8}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.2499999999999999e-26 or 1.35000000000000001e-8 < a Initial program 84.7%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 62.9%
if -2.2499999999999999e-26 < a < 1.35000000000000001e-8Initial program 99.2%
associate-/l*84.4%
Simplified84.4%
Taylor expanded in t around inf 48.6%
associate-/l*51.6%
Simplified51.6%
(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 91.9%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in y around 0 91.9%
associate-*l/96.8%
*-commutative96.8%
Simplified96.8%
Final simplification96.8%
(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.9%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in x around inf 40.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 2024144
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (- x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t)))))))
(- x (/ (* y (- z t)) a)))