
(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/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ z a) (- y))) (t_2 (/ (* y t) a)))
(if (<= a -3.7e-75)
x
(if (<= a -1.46e-265)
t_2
(if (<= a 6.4e-287)
t_1
(if (<= a 5.4e-217) t_2 (if (<= a 5.6e-64) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z / a) * -y;
double t_2 = (y * t) / a;
double tmp;
if (a <= -3.7e-75) {
tmp = x;
} else if (a <= -1.46e-265) {
tmp = t_2;
} else if (a <= 6.4e-287) {
tmp = t_1;
} else if (a <= 5.4e-217) {
tmp = t_2;
} else if (a <= 5.6e-64) {
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) :: t_2
real(8) :: tmp
t_1 = (z / a) * -y
t_2 = (y * t) / a
if (a <= (-3.7d-75)) then
tmp = x
else if (a <= (-1.46d-265)) then
tmp = t_2
else if (a <= 6.4d-287) then
tmp = t_1
else if (a <= 5.4d-217) then
tmp = t_2
else if (a <= 5.6d-64) 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 = (z / a) * -y;
double t_2 = (y * t) / a;
double tmp;
if (a <= -3.7e-75) {
tmp = x;
} else if (a <= -1.46e-265) {
tmp = t_2;
} else if (a <= 6.4e-287) {
tmp = t_1;
} else if (a <= 5.4e-217) {
tmp = t_2;
} else if (a <= 5.6e-64) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z / a) * -y t_2 = (y * t) / a tmp = 0 if a <= -3.7e-75: tmp = x elif a <= -1.46e-265: tmp = t_2 elif a <= 6.4e-287: tmp = t_1 elif a <= 5.4e-217: tmp = t_2 elif a <= 5.6e-64: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z / a) * Float64(-y)) t_2 = Float64(Float64(y * t) / a) tmp = 0.0 if (a <= -3.7e-75) tmp = x; elseif (a <= -1.46e-265) tmp = t_2; elseif (a <= 6.4e-287) tmp = t_1; elseif (a <= 5.4e-217) tmp = t_2; elseif (a <= 5.6e-64) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z / a) * -y; t_2 = (y * t) / a; tmp = 0.0; if (a <= -3.7e-75) tmp = x; elseif (a <= -1.46e-265) tmp = t_2; elseif (a <= 6.4e-287) tmp = t_1; elseif (a <= 5.4e-217) tmp = t_2; elseif (a <= 5.6e-64) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -3.7e-75], x, If[LessEqual[a, -1.46e-265], t$95$2, If[LessEqual[a, 6.4e-287], t$95$1, If[LessEqual[a, 5.4e-217], t$95$2, If[LessEqual[a, 5.6e-64], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{a} \cdot \left(-y\right)\\
t_2 := \frac{y \cdot t}{a}\\
\mathbf{if}\;a \leq -3.7 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.46 \cdot 10^{-265}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 6.4 \cdot 10^{-287}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{-217}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.70000000000000024e-75 or 5.60000000000000008e-64 < a Initial program 88.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in x around inf 59.6%
if -3.70000000000000024e-75 < a < -1.46000000000000005e-265 or 6.40000000000000037e-287 < a < 5.40000000000000032e-217Initial program 99.9%
associate-*r/89.0%
Simplified89.0%
Taylor expanded in t around inf 67.8%
if -1.46000000000000005e-265 < a < 6.40000000000000037e-287 or 5.40000000000000032e-217 < a < 5.60000000000000008e-64Initial program 97.7%
associate-*r/85.2%
Simplified85.2%
associate-*r/97.7%
clear-num97.7%
associate-/r*91.3%
Applied egg-rr91.3%
Taylor expanded in z around inf 66.9%
mul-1-neg66.9%
associate-*r/63.1%
distribute-rgt-neg-in63.1%
Simplified63.1%
Final simplification61.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y a) (- z))) (t_2 (/ (* y t) a)))
(if (<= a -8.2e-77)
x
(if (<= a -2.8e-276)
t_2
(if (<= a 3.3e-283)
t_1
(if (<= a 4.8e-217) t_2 (if (<= a 3.1e-64) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * -z;
double t_2 = (y * t) / a;
double tmp;
if (a <= -8.2e-77) {
tmp = x;
} else if (a <= -2.8e-276) {
tmp = t_2;
} else if (a <= 3.3e-283) {
tmp = t_1;
} else if (a <= 4.8e-217) {
tmp = t_2;
} else if (a <= 3.1e-64) {
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) :: t_2
real(8) :: tmp
t_1 = (y / a) * -z
t_2 = (y * t) / a
if (a <= (-8.2d-77)) then
tmp = x
else if (a <= (-2.8d-276)) then
tmp = t_2
else if (a <= 3.3d-283) then
tmp = t_1
else if (a <= 4.8d-217) then
tmp = t_2
else if (a <= 3.1d-64) 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) * -z;
double t_2 = (y * t) / a;
double tmp;
if (a <= -8.2e-77) {
tmp = x;
} else if (a <= -2.8e-276) {
tmp = t_2;
} else if (a <= 3.3e-283) {
tmp = t_1;
} else if (a <= 4.8e-217) {
tmp = t_2;
} else if (a <= 3.1e-64) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * -z t_2 = (y * t) / a tmp = 0 if a <= -8.2e-77: tmp = x elif a <= -2.8e-276: tmp = t_2 elif a <= 3.3e-283: tmp = t_1 elif a <= 4.8e-217: tmp = t_2 elif a <= 3.1e-64: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(-z)) t_2 = Float64(Float64(y * t) / a) tmp = 0.0 if (a <= -8.2e-77) tmp = x; elseif (a <= -2.8e-276) tmp = t_2; elseif (a <= 3.3e-283) tmp = t_1; elseif (a <= 4.8e-217) tmp = t_2; elseif (a <= 3.1e-64) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * -z; t_2 = (y * t) / a; tmp = 0.0; if (a <= -8.2e-77) tmp = x; elseif (a <= -2.8e-276) tmp = t_2; elseif (a <= 3.3e-283) tmp = t_1; elseif (a <= 4.8e-217) tmp = t_2; elseif (a <= 3.1e-64) 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] * (-z)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -8.2e-77], x, If[LessEqual[a, -2.8e-276], t$95$2, If[LessEqual[a, 3.3e-283], t$95$1, If[LessEqual[a, 4.8e-217], t$95$2, If[LessEqual[a, 3.1e-64], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(-z\right)\\
t_2 := \frac{y \cdot t}{a}\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{-77}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-276}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-283}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{-217}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.19999999999999925e-77 or 3.10000000000000025e-64 < a Initial program 88.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in x around inf 59.6%
if -8.19999999999999925e-77 < a < -2.79999999999999986e-276 or 3.30000000000000019e-283 < a < 4.7999999999999997e-217Initial program 99.9%
associate-*r/87.8%
Simplified87.8%
Taylor expanded in t around inf 66.3%
if -2.79999999999999986e-276 < a < 3.30000000000000019e-283 or 4.7999999999999997e-217 < a < 3.10000000000000025e-64Initial program 97.5%
associate-*r/86.1%
Simplified86.1%
Taylor expanded in z around inf 68.2%
mul-1-neg68.2%
associate-*l/66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
distribute-frac-neg66.4%
Simplified66.4%
Final simplification62.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.1e+204)
(* (/ z a) (- y))
(if (or (<= z 2.7e+29) (and (not (<= z 1.6e+57)) (<= z 2.2e+224)))
(+ x (* (/ y a) t))
(* (/ y a) (- z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+204) {
tmp = (z / a) * -y;
} else if ((z <= 2.7e+29) || (!(z <= 1.6e+57) && (z <= 2.2e+224))) {
tmp = x + ((y / a) * t);
} else {
tmp = (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 (z <= (-1.1d+204)) then
tmp = (z / a) * -y
else if ((z <= 2.7d+29) .or. (.not. (z <= 1.6d+57)) .and. (z <= 2.2d+224)) then
tmp = x + ((y / a) * t)
else
tmp = (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 (z <= -1.1e+204) {
tmp = (z / a) * -y;
} else if ((z <= 2.7e+29) || (!(z <= 1.6e+57) && (z <= 2.2e+224))) {
tmp = x + ((y / a) * t);
} else {
tmp = (y / a) * -z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+204: tmp = (z / a) * -y elif (z <= 2.7e+29) or (not (z <= 1.6e+57) and (z <= 2.2e+224)): tmp = x + ((y / a) * t) else: tmp = (y / a) * -z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+204) tmp = Float64(Float64(z / a) * Float64(-y)); elseif ((z <= 2.7e+29) || (!(z <= 1.6e+57) && (z <= 2.2e+224))) tmp = Float64(x + Float64(Float64(y / a) * t)); else tmp = Float64(Float64(y / a) * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+204) tmp = (z / a) * -y; elseif ((z <= 2.7e+29) || (~((z <= 1.6e+57)) && (z <= 2.2e+224))) tmp = x + ((y / a) * t); else tmp = (y / a) * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+204], N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision], If[Or[LessEqual[z, 2.7e+29], And[N[Not[LessEqual[z, 1.6e+57]], $MachinePrecision], LessEqual[z, 2.2e+224]]], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+204}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+29} \lor \neg \left(z \leq 1.6 \cdot 10^{+57}\right) \land z \leq 2.2 \cdot 10^{+224}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\end{array}
\end{array}
if z < -1.10000000000000006e204Initial program 84.0%
associate-*r/88.7%
Simplified88.7%
associate-*r/84.0%
clear-num84.2%
associate-/r*94.5%
Applied egg-rr94.5%
Taylor expanded in z around inf 62.8%
mul-1-neg62.8%
associate-*r/83.3%
distribute-rgt-neg-in83.3%
Simplified83.3%
if -1.10000000000000006e204 < z < 2.7e29 or 1.60000000000000015e57 < z < 2.2e224Initial program 93.3%
associate-*r/95.9%
Simplified95.9%
Taylor expanded in z around 0 80.1%
sub-neg80.1%
mul-1-neg80.1%
remove-double-neg80.1%
+-commutative80.1%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
if 2.7e29 < z < 1.60000000000000015e57 or 2.2e224 < z Initial program 86.1%
associate-*r/90.8%
Simplified90.8%
Taylor expanded in z around inf 67.7%
mul-1-neg67.7%
associate-*l/81.4%
*-commutative81.4%
distribute-rgt-neg-in81.4%
distribute-frac-neg81.4%
Simplified81.4%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.7e-73) (+ x (/ t (/ a y))) (if (<= t 48.0) (- x (* y (/ z a))) (+ x (* (/ y a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e-73) {
tmp = x + (t / (a / y));
} else if (t <= 48.0) {
tmp = x - (y * (z / a));
} else {
tmp = x + ((y / a) * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.7d-73)) then
tmp = x + (t / (a / y))
else if (t <= 48.0d0) then
tmp = x - (y * (z / a))
else
tmp = x + ((y / a) * t)
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-73) {
tmp = x + (t / (a / y));
} else if (t <= 48.0) {
tmp = x - (y * (z / a));
} else {
tmp = x + ((y / a) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e-73: tmp = x + (t / (a / y)) elif t <= 48.0: tmp = x - (y * (z / a)) else: tmp = x + ((y / a) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e-73) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (t <= 48.0) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y / a) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.7e-73) tmp = x + (t / (a / y)); elseif (t <= 48.0) tmp = x - (y * (z / a)); else tmp = x + ((y / a) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e-73], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 48.0], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-73}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 48:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\end{array}
\end{array}
if t < -2.69999999999999994e-73Initial program 92.7%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in z around 0 85.5%
sub-neg85.5%
mul-1-neg85.5%
remove-double-neg85.5%
+-commutative85.5%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
clear-num52.7%
un-div-inv52.7%
Applied egg-rr89.9%
if -2.69999999999999994e-73 < t < 48Initial program 92.7%
associate-*r/96.6%
Simplified96.6%
Taylor expanded in z around inf 87.3%
if 48 < t Initial program 90.3%
associate-*r/92.7%
Simplified92.7%
Taylor expanded in z around 0 81.9%
sub-neg81.9%
mul-1-neg81.9%
remove-double-neg81.9%
+-commutative81.9%
associate-*l/89.6%
*-commutative89.6%
Simplified89.6%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.2e-76) (+ x (/ t (/ a y))) (if (<= t 51.0) (- x (/ y (/ a z))) (+ x (* (/ y a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e-76) {
tmp = x + (t / (a / y));
} else if (t <= 51.0) {
tmp = x - (y / (a / z));
} else {
tmp = x + ((y / a) * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.2d-76)) then
tmp = x + (t / (a / y))
else if (t <= 51.0d0) then
tmp = x - (y / (a / z))
else
tmp = x + ((y / a) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e-76) {
tmp = x + (t / (a / y));
} else if (t <= 51.0) {
tmp = x - (y / (a / z));
} else {
tmp = x + ((y / a) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.2e-76: tmp = x + (t / (a / y)) elif t <= 51.0: tmp = x - (y / (a / z)) else: tmp = x + ((y / a) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.2e-76) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (t <= 51.0) tmp = Float64(x - Float64(y / Float64(a / z))); else tmp = Float64(x + Float64(Float64(y / a) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.2e-76) tmp = x + (t / (a / y)); elseif (t <= 51.0) tmp = x - (y / (a / z)); else tmp = x + ((y / a) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.2e-76], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 51.0], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-76}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 51:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\end{array}
\end{array}
if t < -3.1999999999999998e-76Initial program 92.7%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in z around 0 85.5%
sub-neg85.5%
mul-1-neg85.5%
remove-double-neg85.5%
+-commutative85.5%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
clear-num52.7%
un-div-inv52.7%
Applied egg-rr89.9%
if -3.1999999999999998e-76 < t < 51Initial program 92.7%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around inf 87.3%
if 51 < t Initial program 90.3%
associate-*r/92.7%
Simplified92.7%
Taylor expanded in z around 0 81.9%
sub-neg81.9%
mul-1-neg81.9%
remove-double-neg81.9%
+-commutative81.9%
associate-*l/89.6%
*-commutative89.6%
Simplified89.6%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e+36) (not (<= t 1.55e+134))) (* (/ y a) t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e+36) || !(t <= 1.55e+134)) {
tmp = (y / a) * t;
} 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 ((t <= (-2.4d+36)) .or. (.not. (t <= 1.55d+134))) then
tmp = (y / a) * t
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 ((t <= -2.4e+36) || !(t <= 1.55e+134)) {
tmp = (y / a) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e+36) or not (t <= 1.55e+134): tmp = (y / a) * t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e+36) || !(t <= 1.55e+134)) tmp = Float64(Float64(y / a) * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.4e+36) || ~((t <= 1.55e+134))) tmp = (y / a) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e+36], N[Not[LessEqual[t, 1.55e+134]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+36} \lor \neg \left(t \leq 1.55 \cdot 10^{+134}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.39999999999999992e36 or 1.54999999999999991e134 < t Initial program 91.8%
associate-*r/92.6%
Simplified92.6%
Taylor expanded in t around inf 58.7%
associate-*l/63.4%
*-commutative63.4%
Simplified63.4%
if -2.39999999999999992e36 < t < 1.54999999999999991e134Initial program 92.3%
associate-*r/96.3%
Simplified96.3%
Taylor expanded in x around inf 50.5%
Final simplification55.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.2e+31) (/ t (/ a y)) (if (<= t 1.9e+132) x (* (/ y a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.2e+31) {
tmp = t / (a / y);
} else if (t <= 1.9e+132) {
tmp = x;
} else {
tmp = (y / a) * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-7.2d+31)) then
tmp = t / (a / y)
else if (t <= 1.9d+132) then
tmp = x
else
tmp = (y / a) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.2e+31) {
tmp = t / (a / y);
} else if (t <= 1.9e+132) {
tmp = x;
} else {
tmp = (y / a) * t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.2e+31: tmp = t / (a / y) elif t <= 1.9e+132: tmp = x else: tmp = (y / a) * t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.2e+31) tmp = Float64(t / Float64(a / y)); elseif (t <= 1.9e+132) tmp = x; else tmp = Float64(Float64(y / a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.2e+31) tmp = t / (a / y); elseif (t <= 1.9e+132) tmp = x; else tmp = (y / a) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.2e+31], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+132], x, N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+31}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+132}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\end{array}
\end{array}
if t < -7.19999999999999992e31Initial program 92.2%
associate-*r/92.1%
Simplified92.1%
Taylor expanded in t around inf 55.2%
associate-*l/59.0%
*-commutative59.0%
Simplified59.0%
clear-num59.1%
un-div-inv59.1%
Applied egg-rr59.1%
if -7.19999999999999992e31 < t < 1.90000000000000003e132Initial program 92.3%
associate-*r/96.3%
Simplified96.3%
Taylor expanded in x around inf 50.5%
if 1.90000000000000003e132 < t Initial program 91.4%
associate-*r/93.2%
Simplified93.2%
Taylor expanded in t around inf 62.7%
associate-*l/68.2%
*-commutative68.2%
Simplified68.2%
Final simplification55.2%
(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-*r/94.9%
Simplified94.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 92.1%
associate-*r/94.9%
Simplified94.9%
Taylor expanded in x around inf 43.0%
Final simplification43.0%
(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 2023196
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(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)))