
(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 (<= (/ (* y (- z t)) a) (- INFINITY)) (* (/ y a) (- t z)) (+ x (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / a) <= -((double) INFINITY)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / a) <= -Double.POSITIVE_INFINITY) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((y * (z - t)) / a) <= -math.inf: tmp = (y / a) * (t - z) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(y * Float64(z - t)) / a) <= Float64(-Inf)) tmp = Float64(Float64(y / a) * Float64(t - z)); 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 (((y * (z - t)) / a) <= -Inf) tmp = (y / a) * (t - z); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], (-Infinity)], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a} \leq -\infty:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0Initial program 78.2%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 78.2%
mul-1-neg78.2%
associate-*r/99.9%
distribute-rgt-neg-in99.9%
neg-sub099.9%
div-sub94.8%
associate--r-94.8%
neg-sub094.8%
+-commutative94.8%
sub-neg94.8%
distribute-rgt-out--92.2%
associate-*l/80.2%
associate-*r/92.3%
associate-*l/82.5%
associate-*r/87.1%
distribute-rgt-out--100.0%
Simplified100.0%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 97.7%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- a)))))
(if (<= a -1.62e-87)
x
(if (<= a 6e-275)
(/ t (/ a y))
(if (<= a 1.85e-172)
t_1
(if (<= a 3.6e-126) (* t (/ y a)) (if (<= a 5.0) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / -a);
double tmp;
if (a <= -1.62e-87) {
tmp = x;
} else if (a <= 6e-275) {
tmp = t / (a / y);
} else if (a <= 1.85e-172) {
tmp = t_1;
} else if (a <= 3.6e-126) {
tmp = t * (y / a);
} else if (a <= 5.0) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * (z / -a)
if (a <= (-1.62d-87)) then
tmp = x
else if (a <= 6d-275) then
tmp = t / (a / y)
else if (a <= 1.85d-172) then
tmp = t_1
else if (a <= 3.6d-126) then
tmp = t * (y / a)
else if (a <= 5.0d0) 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 * (z / -a);
double tmp;
if (a <= -1.62e-87) {
tmp = x;
} else if (a <= 6e-275) {
tmp = t / (a / y);
} else if (a <= 1.85e-172) {
tmp = t_1;
} else if (a <= 3.6e-126) {
tmp = t * (y / a);
} else if (a <= 5.0) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / -a) tmp = 0 if a <= -1.62e-87: tmp = x elif a <= 6e-275: tmp = t / (a / y) elif a <= 1.85e-172: tmp = t_1 elif a <= 3.6e-126: tmp = t * (y / a) elif a <= 5.0: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(-a))) tmp = 0.0 if (a <= -1.62e-87) tmp = x; elseif (a <= 6e-275) tmp = Float64(t / Float64(a / y)); elseif (a <= 1.85e-172) tmp = t_1; elseif (a <= 3.6e-126) tmp = Float64(t * Float64(y / a)); elseif (a <= 5.0) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / -a); tmp = 0.0; if (a <= -1.62e-87) tmp = x; elseif (a <= 6e-275) tmp = t / (a / y); elseif (a <= 1.85e-172) tmp = t_1; elseif (a <= 3.6e-126) tmp = t * (y / a); elseif (a <= 5.0) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.62e-87], x, If[LessEqual[a, 6e-275], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e-172], t$95$1, If[LessEqual[a, 3.6e-126], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.0], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{-a}\\
\mathbf{if}\;a \leq -1.62 \cdot 10^{-87}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-275}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 5:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.6200000000000001e-87 or 5 < a Initial program 91.3%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in x around inf 66.6%
if -1.6200000000000001e-87 < a < 6.000000000000001e-275Initial program 98.0%
associate-/l*77.7%
Simplified77.7%
clear-num77.7%
un-div-inv79.7%
Applied egg-rr79.7%
Taylor expanded in t around inf 49.1%
associate-*r/53.0%
Simplified53.0%
Taylor expanded in t around 0 49.1%
associate-*l/40.3%
associate-/r/53.0%
Simplified53.0%
if 6.000000000000001e-275 < a < 1.85e-172 or 3.5999999999999999e-126 < a < 5Initial program 99.9%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 63.0%
mul-1-neg63.0%
associate-/l*59.5%
distribute-rgt-neg-in59.5%
distribute-frac-neg259.5%
Simplified59.5%
if 1.85e-172 < a < 3.5999999999999999e-126Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
clear-num99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 76.0%
associate-*r/87.7%
Simplified87.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.4e-83) x (if (<= a -2.7e-198) (/ t (/ a y)) (if (<= a 0.8) (* z (/ (- y) a)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.4e-83) {
tmp = x;
} else if (a <= -2.7e-198) {
tmp = t / (a / y);
} else if (a <= 0.8) {
tmp = z * (-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.4d-83)) then
tmp = x
else if (a <= (-2.7d-198)) then
tmp = t / (a / y)
else if (a <= 0.8d0) then
tmp = z * (-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.4e-83) {
tmp = x;
} else if (a <= -2.7e-198) {
tmp = t / (a / y);
} else if (a <= 0.8) {
tmp = z * (-y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.4e-83: tmp = x elif a <= -2.7e-198: tmp = t / (a / y) elif a <= 0.8: tmp = z * (-y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.4e-83) tmp = x; elseif (a <= -2.7e-198) tmp = Float64(t / Float64(a / y)); elseif (a <= 0.8) tmp = Float64(z * Float64(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.4e-83) tmp = x; elseif (a <= -2.7e-198) tmp = t / (a / y); elseif (a <= 0.8) tmp = z * (-y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.4e-83], x, If[LessEqual[a, -2.7e-198], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.8], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{-83}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-198}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 0.8:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.4000000000000001e-83 or 0.80000000000000004 < a Initial program 91.3%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in x around inf 66.6%
if -2.4000000000000001e-83 < a < -2.7000000000000002e-198Initial program 99.7%
associate-/l*78.7%
Simplified78.7%
clear-num78.7%
un-div-inv78.7%
Applied egg-rr78.7%
Taylor expanded in t around inf 57.1%
associate-*r/61.6%
Simplified61.6%
Taylor expanded in t around 0 57.1%
associate-*l/44.9%
associate-/r/61.6%
Simplified61.6%
if -2.7000000000000002e-198 < a < 0.80000000000000004Initial program 98.8%
associate-/l*90.4%
Simplified90.4%
clear-num90.3%
un-div-inv91.5%
Applied egg-rr91.5%
Taylor expanded in x around 0 81.4%
mul-1-neg81.4%
associate-*r/75.2%
distribute-rgt-neg-in75.2%
neg-sub075.2%
div-sub70.8%
associate--r-70.8%
neg-sub070.8%
+-commutative70.8%
sub-neg70.8%
distribute-rgt-out--69.7%
associate-*l/71.8%
associate-*r/69.6%
associate-*l/74.8%
associate-*r/74.7%
distribute-rgt-out--82.4%
Simplified82.4%
Taylor expanded in t around 0 54.6%
associate-*r/54.6%
mul-1-neg54.6%
distribute-rgt-neg-out54.6%
associate-/l*50.4%
Simplified50.4%
Taylor expanded in y around 0 54.6%
mul-1-neg54.6%
distribute-frac-neg254.6%
*-commutative54.6%
associate-/l*60.9%
Simplified60.9%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.6e-46) (not (<= t 6.8e+82))) (+ x (* t (/ y a))) (- x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e-46) || !(t <= 6.8e+82)) {
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 <= (-2.6d-46)) .or. (.not. (t <= 6.8d+82))) 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 <= -2.6e-46) || !(t <= 6.8e+82)) {
tmp = x + (t * (y / a));
} else {
tmp = x - ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.6e-46) or not (t <= 6.8e+82): 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 <= -2.6e-46) || !(t <= 6.8e+82)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.6e-46) || ~((t <= 6.8e+82))) 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, -2.6e-46], N[Not[LessEqual[t, 6.8e+82]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{-46} \lor \neg \left(t \leq 6.8 \cdot 10^{+82}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2.6000000000000002e-46 or 6.79999999999999989e82 < t Initial program 92.3%
associate-/l*92.9%
Simplified92.9%
clear-num92.9%
un-div-inv94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 83.3%
mul-1-neg83.3%
associate-*r/87.8%
distribute-lft-neg-out87.8%
cancel-sign-sub87.8%
Simplified87.8%
if -2.6000000000000002e-46 < t < 6.79999999999999989e82Initial program 97.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around inf 92.1%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e-46) (not (<= t 6.8e+82))) (+ 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.1e-46) || !(t <= 6.8e+82)) {
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.1d-46)) .or. (.not. (t <= 6.8d+82))) 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.1e-46) || !(t <= 6.8e+82)) {
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.1e-46) or not (t <= 6.8e+82): 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.1e-46) || !(t <= 6.8e+82)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.1e-46) || ~((t <= 6.8e+82))) 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.1e-46], N[Not[LessEqual[t, 6.8e+82]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-46} \lor \neg \left(t \leq 6.8 \cdot 10^{+82}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.09999999999999987e-46 or 6.79999999999999989e82 < t Initial program 92.3%
associate-/l*92.9%
Simplified92.9%
clear-num92.9%
un-div-inv94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 83.3%
mul-1-neg83.3%
associate-*r/87.8%
distribute-lft-neg-out87.8%
cancel-sign-sub87.8%
Simplified87.8%
if -2.09999999999999987e-46 < t < 6.79999999999999989e82Initial program 97.0%
associate-/l*94.0%
Simplified94.0%
clear-num94.0%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in z around inf 89.8%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+164) (not (<= z 1.36e+107))) (* (/ y a) (- t z)) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+164) || !(z <= 1.36e+107)) {
tmp = (y / a) * (t - z);
} 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 <= (-1.45d+164)) .or. (.not. (z <= 1.36d+107))) then
tmp = (y / a) * (t - z)
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 <= -1.45e+164) || !(z <= 1.36e+107)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+164) or not (z <= 1.36e+107): tmp = (y / a) * (t - z) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+164) || !(z <= 1.36e+107)) tmp = Float64(Float64(y / a) * Float64(t - z)); 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 <= -1.45e+164) || ~((z <= 1.36e+107))) tmp = (y / a) * (t - z); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+164], N[Not[LessEqual[z, 1.36e+107]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+164} \lor \neg \left(z \leq 1.36 \cdot 10^{+107}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.4499999999999999e164 or 1.35999999999999998e107 < z Initial program 92.3%
associate-/l*90.3%
Simplified90.3%
clear-num90.3%
un-div-inv90.4%
Applied egg-rr90.4%
Taylor expanded in x around 0 71.0%
mul-1-neg71.0%
associate-*r/73.0%
distribute-rgt-neg-in73.0%
neg-sub073.0%
div-sub65.0%
associate--r-65.0%
neg-sub065.0%
+-commutative65.0%
sub-neg65.0%
distribute-rgt-out--64.9%
associate-*l/63.0%
associate-*r/64.9%
associate-*l/63.0%
associate-*r/70.5%
distribute-rgt-out--78.5%
Simplified78.5%
if -1.4499999999999999e164 < z < 1.35999999999999998e107Initial program 95.3%
associate-/l*94.3%
Simplified94.3%
clear-num94.2%
un-div-inv95.3%
Applied egg-rr95.3%
Taylor expanded in z around 0 81.2%
mul-1-neg81.2%
associate-*r/84.8%
distribute-lft-neg-out84.8%
cancel-sign-sub84.8%
Simplified84.8%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3e-46) (+ x (/ y (/ a t))) (if (<= t 6.8e+82) (- x (/ (* y z) a)) (+ x (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e-46) {
tmp = x + (y / (a / t));
} else if (t <= 6.8e+82) {
tmp = x - ((y * 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 (t <= (-3d-46)) then
tmp = x + (y / (a / t))
else if (t <= 6.8d+82) then
tmp = x - ((y * 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 (t <= -3e-46) {
tmp = x + (y / (a / t));
} else if (t <= 6.8e+82) {
tmp = x - ((y * z) / a);
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3e-46: tmp = x + (y / (a / t)) elif t <= 6.8e+82: tmp = x - ((y * z) / a) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e-46) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (t <= 6.8e+82) tmp = Float64(x - Float64(Float64(y * z) / 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 (t <= -3e-46) tmp = x + (y / (a / t)); elseif (t <= 6.8e+82) tmp = x - ((y * z) / a); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e-46], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+82], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-46}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+82}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.99999999999999987e-46Initial program 96.0%
associate-/l*93.1%
Simplified93.1%
clear-num93.1%
un-div-inv96.0%
Applied egg-rr96.0%
Taylor expanded in z around 0 86.0%
associate-*r/86.0%
mul-1-neg86.0%
Simplified86.0%
if -2.99999999999999987e-46 < t < 6.79999999999999989e82Initial program 97.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around inf 92.1%
if 6.79999999999999989e82 < t Initial program 87.2%
associate-/l*92.7%
Simplified92.7%
clear-num92.7%
un-div-inv92.8%
Applied egg-rr92.8%
Taylor expanded in z around 0 81.6%
mul-1-neg81.6%
associate-*r/90.7%
distribute-lft-neg-out90.7%
cancel-sign-sub90.7%
Simplified90.7%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.2e+29) x (if (<= x 3.1e+66) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.2e+29) {
tmp = x;
} else if (x <= 3.1e+66) {
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 (x <= (-1.2d+29)) then
tmp = x
else if (x <= 3.1d+66) 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 (x <= -1.2e+29) {
tmp = x;
} else if (x <= 3.1e+66) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.2e+29: tmp = x elif x <= 3.1e+66: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.2e+29) tmp = x; elseif (x <= 3.1e+66) 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 (x <= -1.2e+29) tmp = x; elseif (x <= 3.1e+66) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.2e+29], x, If[LessEqual[x, 3.1e+66], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.2e29 or 3.10000000000000019e66 < x Initial program 96.4%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in x around inf 74.9%
if -1.2e29 < x < 3.10000000000000019e66Initial program 93.5%
associate-/l*93.4%
Simplified93.4%
clear-num93.3%
un-div-inv93.5%
Applied egg-rr93.5%
Taylor expanded in x around 0 70.1%
mul-1-neg70.1%
associate-*r/70.0%
distribute-rgt-neg-in70.0%
neg-sub070.0%
div-sub68.0%
associate--r-68.0%
neg-sub068.0%
+-commutative68.0%
sub-neg68.0%
distribute-rgt-out--66.6%
associate-*l/66.0%
associate-*r/69.3%
associate-*l/69.3%
associate-*r/71.1%
distribute-rgt-out--75.8%
Simplified75.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.8e+24) x (if (<= x 2.8e+65) (* y (/ (- t z) a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.8e+24) {
tmp = x;
} else if (x <= 2.8e+65) {
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 (x <= (-4.8d+24)) then
tmp = x
else if (x <= 2.8d+65) 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 (x <= -4.8e+24) {
tmp = x;
} else if (x <= 2.8e+65) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.8e+24: tmp = x elif x <= 2.8e+65: tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.8e+24) tmp = x; elseif (x <= 2.8e+65) 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 (x <= -4.8e+24) tmp = x; elseif (x <= 2.8e+65) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.8e+24], x, If[LessEqual[x, 2.8e+65], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+24}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.8000000000000001e24 or 2.7999999999999999e65 < x Initial program 96.4%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in x around inf 74.5%
if -4.8000000000000001e24 < x < 2.7999999999999999e65Initial program 93.4%
associate-/l*94.0%
Simplified94.0%
clear-num93.9%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in x around 0 70.3%
mul-1-neg70.3%
associate-*r/70.9%
distribute-rgt-neg-in70.9%
neg-sub070.9%
div-sub68.9%
associate--r-68.9%
neg-sub068.9%
+-commutative68.9%
sub-neg68.9%
distribute-rgt-out--67.5%
associate-*l/66.2%
associate-*r/69.5%
associate-*l/69.5%
associate-*r/71.4%
distribute-rgt-out--76.1%
Simplified76.1%
Taylor expanded in y around 0 70.3%
associate-/l*70.9%
Simplified70.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.6e-22) x (if (<= x 1.7e+63) (* t (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.6e-22) {
tmp = x;
} else if (x <= 1.7e+63) {
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 (x <= (-6.6d-22)) then
tmp = x
else if (x <= 1.7d+63) 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 (x <= -6.6e-22) {
tmp = x;
} else if (x <= 1.7e+63) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.6e-22: tmp = x elif x <= 1.7e+63: tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.6e-22) tmp = x; elseif (x <= 1.7e+63) 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 (x <= -6.6e-22) tmp = x; elseif (x <= 1.7e+63) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.6e-22], x, If[LessEqual[x, 1.7e+63], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-22}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+63}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.6000000000000002e-22 or 1.6999999999999999e63 < x Initial program 96.7%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in x around inf 71.7%
if -6.6000000000000002e-22 < x < 1.6999999999999999e63Initial program 92.9%
associate-/l*93.5%
Simplified93.5%
clear-num93.4%
un-div-inv93.6%
Applied egg-rr93.6%
Taylor expanded in t around inf 42.9%
associate-*r/46.4%
Simplified46.4%
(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.7%
associate-/l*93.5%
Simplified93.5%
clear-num93.5%
un-div-inv94.3%
Applied egg-rr94.3%
Final simplification94.3%
(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.7%
associate-/l*93.5%
Simplified93.5%
Final simplification93.5%
(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.7%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in x around inf 46.3%
(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 2024084
(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)))