
(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 (or (<= a -7.5e+98) (not (<= a 3.5e-78))) (+ x (* y (/ (- t z) a))) (+ x (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.5e+98) || !(a <= 3.5e-78)) {
tmp = x + (y * ((t - z) / a));
} 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) :: tmp
if ((a <= (-7.5d+98)) .or. (.not. (a <= 3.5d-78))) then
tmp = x + (y * ((t - z) / a))
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 tmp;
if ((a <= -7.5e+98) || !(a <= 3.5e-78)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.5e+98) or not (a <= 3.5e-78): tmp = x + (y * ((t - z) / a)) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.5e+98) || !(a <= 3.5e-78)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + 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 <= -7.5e+98) || ~((a <= 3.5e-78))) tmp = x + (y * ((t - z) / a)); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.5e+98], N[Not[LessEqual[a, 3.5e-78]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{+98} \lor \neg \left(a \leq 3.5 \cdot 10^{-78}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if a < -7.50000000000000036e98 or 3.4999999999999999e-78 < a Initial program 88.7%
associate-/l*99.9%
Simplified99.9%
if -7.50000000000000036e98 < a < 3.4999999999999999e-78Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -7.2e-43) x (if (<= x 3.4e-234) (* y (/ (- z) a)) (if (<= x 4.5e+23) (/ t (/ a y)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7.2e-43) {
tmp = x;
} else if (x <= 3.4e-234) {
tmp = y * (-z / a);
} else if (x <= 4.5e+23) {
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 (x <= (-7.2d-43)) then
tmp = x
else if (x <= 3.4d-234) then
tmp = y * (-z / a)
else if (x <= 4.5d+23) 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 (x <= -7.2e-43) {
tmp = x;
} else if (x <= 3.4e-234) {
tmp = y * (-z / a);
} else if (x <= 4.5e+23) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7.2e-43: tmp = x elif x <= 3.4e-234: tmp = y * (-z / a) elif x <= 4.5e+23: tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7.2e-43) tmp = x; elseif (x <= 3.4e-234) tmp = Float64(y * Float64(Float64(-z) / a)); elseif (x <= 4.5e+23) 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 (x <= -7.2e-43) tmp = x; elseif (x <= 3.4e-234) tmp = y * (-z / a); elseif (x <= 4.5e+23) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7.2e-43], x, If[LessEqual[x, 3.4e-234], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e+23], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-234}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+23}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.1999999999999998e-43 or 4.49999999999999979e23 < x Initial program 91.5%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in x around inf 64.2%
if -7.1999999999999998e-43 < x < 3.39999999999999986e-234Initial program 96.0%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around inf 52.3%
mul-1-neg52.3%
associate-/l*53.6%
distribute-rgt-neg-in53.6%
distribute-neg-frac53.6%
Simplified53.6%
if 3.39999999999999986e-234 < x < 4.49999999999999979e23Initial program 96.6%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in x around 0 78.2%
mul-1-neg78.2%
distribute-frac-neg278.2%
*-commutative78.2%
associate-/l*76.4%
Simplified76.4%
Taylor expanded in z around 0 52.5%
associate-*r/54.0%
Simplified54.0%
clear-num54.0%
un-div-inv54.0%
Applied egg-rr54.0%
Final simplification58.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.36e-42) x (if (<= x 2.8e-235) (* (/ y a) (- z)) (if (<= x 3.1e+31) (/ t (/ a y)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.36e-42) {
tmp = x;
} else if (x <= 2.8e-235) {
tmp = (y / a) * -z;
} else if (x <= 3.1e+31) {
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 (x <= (-1.36d-42)) then
tmp = x
else if (x <= 2.8d-235) then
tmp = (y / a) * -z
else if (x <= 3.1d+31) 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 (x <= -1.36e-42) {
tmp = x;
} else if (x <= 2.8e-235) {
tmp = (y / a) * -z;
} else if (x <= 3.1e+31) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.36e-42: tmp = x elif x <= 2.8e-235: tmp = (y / a) * -z elif x <= 3.1e+31: tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.36e-42) tmp = x; elseif (x <= 2.8e-235) tmp = Float64(Float64(y / a) * Float64(-z)); elseif (x <= 3.1e+31) 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 (x <= -1.36e-42) tmp = x; elseif (x <= 2.8e-235) tmp = (y / a) * -z; elseif (x <= 3.1e+31) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.36e-42], x, If[LessEqual[x, 2.8e-235], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[x, 3.1e+31], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.36 \cdot 10^{-42}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-235}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+31}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.36e-42 or 3.1000000000000002e31 < x Initial program 91.5%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in x around inf 64.2%
if -1.36e-42 < x < 2.79999999999999995e-235Initial program 96.0%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around inf 52.3%
mul-1-neg52.3%
associate-/l*53.6%
distribute-rgt-neg-in53.6%
distribute-neg-frac53.6%
Simplified53.6%
Taylor expanded in y around 0 52.3%
mul-1-neg52.3%
associate-*l/56.0%
*-commutative56.0%
distribute-lft-neg-in56.0%
Simplified56.0%
if 2.79999999999999995e-235 < x < 3.1000000000000002e31Initial program 96.6%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in x around 0 78.2%
mul-1-neg78.2%
distribute-frac-neg278.2%
*-commutative78.2%
associate-/l*76.4%
Simplified76.4%
Taylor expanded in z around 0 52.5%
associate-*r/54.0%
Simplified54.0%
clear-num54.0%
un-div-inv54.0%
Applied egg-rr54.0%
Final simplification59.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.4e-26) (not (<= a 2e+22))) (+ x (* y (/ t a))) (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.4e-26) || !(a <= 2e+22)) {
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 <= (-1.4d-26)) .or. (.not. (a <= 2d+22))) 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 <= -1.4e-26) || !(a <= 2e+22)) {
tmp = x + (y * (t / a));
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.4e-26) or not (a <= 2e+22): 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 <= -1.4e-26) || !(a <= 2e+22)) 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 <= -1.4e-26) || ~((a <= 2e+22))) 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, -1.4e-26], N[Not[LessEqual[a, 2e+22]], $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 -1.4 \cdot 10^{-26} \lor \neg \left(a \leq 2 \cdot 10^{+22}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -1.4000000000000001e-26 or 2e22 < a Initial program 88.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 75.7%
associate-*r/75.7%
mul-1-neg75.7%
distribute-lft-neg-out75.7%
*-commutative75.7%
Simplified75.7%
sub-neg75.7%
+-commutative75.7%
associate-/l*81.7%
distribute-rgt-neg-in81.7%
add-sqr-sqrt45.6%
sqrt-unprod61.0%
sqr-neg61.0%
sqrt-unprod27.6%
add-sqr-sqrt62.8%
distribute-frac-neg62.8%
add-sqr-sqrt35.2%
sqrt-unprod60.9%
sqr-neg60.9%
sqrt-unprod36.1%
add-sqr-sqrt81.7%
Applied egg-rr81.7%
if -1.4000000000000001e-26 < a < 2e22Initial program 99.9%
associate-/l*88.1%
Simplified88.1%
clear-num88.0%
un-div-inv90.1%
Applied egg-rr90.1%
Taylor expanded in x around 0 83.7%
mul-1-neg83.7%
associate-*r/74.3%
distribute-rgt-neg-out74.3%
neg-sub074.3%
div-sub71.1%
associate--r-71.1%
neg-sub071.1%
+-commutative71.1%
sub-neg71.1%
distribute-lft-out--64.8%
associate-*r/70.0%
associate-*l/66.1%
associate-*r/71.2%
associate-*l/69.6%
distribute-lft-out--80.8%
Simplified80.8%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.95e+32) (not (<= t 7e-7))) (+ x (* t (/ y a))) (- x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.95e+32) || !(t <= 7e-7)) {
tmp = x + (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 <= (-1.95d+32)) .or. (.not. (t <= 7d-7))) then
tmp = x + (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 <= -1.95e+32) || !(t <= 7e-7)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.95e+32) or not (t <= 7e-7): tmp = x + (t * (y / a)) else: tmp = x - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.95e+32) || !(t <= 7e-7)) tmp = Float64(x + Float64(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 <= -1.95e+32) || ~((t <= 7e-7))) tmp = x + (t * (y / a)); else tmp = x - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.95e+32], N[Not[LessEqual[t, 7e-7]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+32} \lor \neg \left(t \leq 7 \cdot 10^{-7}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.95e32 or 6.99999999999999968e-7 < t Initial program 91.5%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in z around 0 82.2%
mul-1-neg82.2%
associate-/l*86.5%
distribute-rgt-neg-in86.5%
distribute-neg-frac286.5%
Simplified86.5%
if -1.95e32 < t < 6.99999999999999968e-7Initial program 96.0%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around inf 88.8%
associate-/l*89.3%
Simplified89.3%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.9e+115) x (if (<= a 1.15e+55) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.9e+115) {
tmp = x;
} else if (a <= 1.15e+55) {
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 <= (-1.9d+115)) then
tmp = x
else if (a <= 1.15d+55) 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 <= -1.9e+115) {
tmp = x;
} else if (a <= 1.15e+55) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.9e+115: tmp = x elif a <= 1.15e+55: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.9e+115) tmp = x; elseif (a <= 1.15e+55) 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 <= -1.9e+115) tmp = x; elseif (a <= 1.15e+55) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.9e+115], x, If[LessEqual[a, 1.15e+55], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+55}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.9e115 or 1.14999999999999994e55 < a Initial program 86.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 69.3%
if -1.9e115 < a < 1.14999999999999994e55Initial program 99.2%
associate-/l*89.8%
Simplified89.8%
clear-num89.8%
un-div-inv91.5%
Applied egg-rr91.5%
Taylor expanded in x around 0 80.6%
mul-1-neg80.6%
associate-*r/73.2%
distribute-rgt-neg-out73.2%
neg-sub073.2%
div-sub70.4%
associate--r-70.4%
neg-sub070.4%
+-commutative70.4%
sub-neg70.4%
distribute-lft-out--64.4%
associate-*r/68.2%
associate-*l/65.5%
associate-*r/69.9%
associate-*l/68.4%
distribute-lft-out--78.7%
Simplified78.7%
Final simplification74.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.2e+115) x (if (<= a 9.5e+23) (* (/ y a) (- t z)) (+ x (/ (* y t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.2e+115) {
tmp = x;
} else if (a <= 9.5e+23) {
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 (a <= (-1.2d+115)) then
tmp = x
else if (a <= 9.5d+23) 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 (a <= -1.2e+115) {
tmp = x;
} else if (a <= 9.5e+23) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.2e+115: tmp = x elif a <= 9.5e+23: tmp = (y / a) * (t - z) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.2e+115) tmp = x; elseif (a <= 9.5e+23) 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 (a <= -1.2e+115) tmp = x; elseif (a <= 9.5e+23) tmp = (y / a) * (t - z); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.2e+115], x, If[LessEqual[a, 9.5e+23], 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}\;a \leq -1.2 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{+23}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if a < -1.2e115Initial program 79.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 71.2%
if -1.2e115 < a < 9.50000000000000038e23Initial program 99.2%
associate-/l*89.5%
Simplified89.5%
clear-num89.5%
un-div-inv91.3%
Applied egg-rr91.3%
Taylor expanded in x around 0 80.7%
mul-1-neg80.7%
associate-*r/73.1%
distribute-rgt-neg-out73.1%
neg-sub073.1%
div-sub70.2%
associate--r-70.2%
neg-sub070.2%
+-commutative70.2%
sub-neg70.2%
distribute-lft-out--64.1%
associate-*r/68.0%
associate-*l/65.2%
associate-*r/69.7%
associate-*l/68.2%
distribute-lft-out--78.7%
Simplified78.7%
if 9.50000000000000038e23 < a Initial program 92.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 86.7%
associate-*r/86.7%
mul-1-neg86.7%
distribute-lft-neg-out86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y around 0 86.7%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e+32) (+ x (* y (/ t a))) (if (<= t 7.5e-7) (- x (* y (/ z a))) (+ x (/ (* y t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+32) {
tmp = x + (y * (t / a));
} else if (t <= 7.5e-7) {
tmp = x - (y * (z / a));
} 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 (t <= (-6.5d+32)) then
tmp = x + (y * (t / a))
else if (t <= 7.5d-7) then
tmp = x - (y * (z / a))
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 (t <= -6.5e+32) {
tmp = x + (y * (t / a));
} else if (t <= 7.5e-7) {
tmp = x - (y * (z / a));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e+32: tmp = x + (y * (t / a)) elif t <= 7.5e-7: tmp = x - (y * (z / a)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e+32) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t <= 7.5e-7) tmp = Float64(x - Float64(y * Float64(z / a))); 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 (t <= -6.5e+32) tmp = x + (y * (t / a)); elseif (t <= 7.5e-7) tmp = x - (y * (z / a)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e+32], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-7], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+32}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-7}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -6.4999999999999994e32Initial program 90.0%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around 0 79.6%
associate-*r/79.6%
mul-1-neg79.6%
distribute-lft-neg-out79.6%
*-commutative79.6%
Simplified79.6%
sub-neg79.6%
+-commutative79.6%
associate-/l*81.5%
distribute-rgt-neg-in81.5%
add-sqr-sqrt81.4%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod0.0%
add-sqr-sqrt26.8%
distribute-frac-neg26.8%
add-sqr-sqrt26.8%
sqrt-unprod15.1%
sqr-neg15.1%
sqrt-unprod0.0%
add-sqr-sqrt81.5%
Applied egg-rr81.5%
if -6.4999999999999994e32 < t < 7.5000000000000002e-7Initial program 96.0%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around inf 88.8%
associate-/l*89.3%
Simplified89.3%
if 7.5000000000000002e-7 < t Initial program 93.0%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in z around 0 84.9%
associate-*r/84.9%
mul-1-neg84.9%
distribute-lft-neg-out84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y around 0 84.9%
Final simplification86.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.7e-82) x (if (<= a 1.45e+47) (* t (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e-82) {
tmp = x;
} else if (a <= 1.45e+47) {
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.7d-82)) then
tmp = x
else if (a <= 1.45d+47) 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.7e-82) {
tmp = x;
} else if (a <= 1.45e+47) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.7e-82: tmp = x elif a <= 1.45e+47: tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.7e-82) tmp = x; elseif (a <= 1.45e+47) 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.7e-82) tmp = x; elseif (a <= 1.45e+47) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.7e-82], x, If[LessEqual[a, 1.45e+47], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+47}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.7000000000000001e-82 or 1.4499999999999999e47 < a Initial program 89.1%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in x around inf 60.9%
if -2.7000000000000001e-82 < a < 1.4499999999999999e47Initial program 99.9%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in x around 0 85.6%
mul-1-neg85.6%
distribute-frac-neg285.6%
*-commutative85.6%
associate-/l*83.2%
Simplified83.2%
Taylor expanded in z around 0 48.8%
associate-*r/49.6%
Simplified49.6%
Final simplification55.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.8e-82) x (if (<= a 1.08e+42) (/ t (/ a y)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e-82) {
tmp = x;
} else if (a <= 1.08e+42) {
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 <= (-3.8d-82)) then
tmp = x
else if (a <= 1.08d+42) 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 <= -3.8e-82) {
tmp = x;
} else if (a <= 1.08e+42) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.8e-82: tmp = x elif a <= 1.08e+42: tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.8e-82) tmp = x; elseif (a <= 1.08e+42) 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 <= -3.8e-82) tmp = x; elseif (a <= 1.08e+42) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.8e-82], x, If[LessEqual[a, 1.08e+42], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{+42}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.8000000000000002e-82 or 1.08e42 < a Initial program 89.1%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in x around inf 60.9%
if -3.8000000000000002e-82 < a < 1.08e42Initial program 99.9%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in x around 0 85.6%
mul-1-neg85.6%
distribute-frac-neg285.6%
*-commutative85.6%
associate-/l*83.2%
Simplified83.2%
Taylor expanded in z around 0 48.8%
associate-*r/49.6%
Simplified49.6%
clear-num49.6%
un-div-inv49.6%
Applied egg-rr49.6%
Final simplification55.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 94.0%
associate-/l*94.0%
Simplified94.0%
Final simplification94.0%
(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(y / Float64(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[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a}{t - z}}
\end{array}
Initial program 94.0%
associate-/l*94.0%
Simplified94.0%
clear-num93.9%
un-div-inv94.9%
Applied egg-rr94.9%
Final simplification94.9%
(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 94.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 40.1%
Final simplification40.1%
(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 2024089
(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)))