
(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 12 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 (/ -1.0 (* (/ a y) (/ 1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + (-1.0 / ((a / y) * (1.0 / (z - t))));
}
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 + ((-1.0d0) / ((a / y) * (1.0d0 / (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (-1.0 / ((a / y) * (1.0 / (z - t))));
}
def code(x, y, z, t, a): return x + (-1.0 / ((a / y) * (1.0 / (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(-1.0 / Float64(Float64(a / y) * Float64(1.0 / Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (-1.0 / ((a / y) * (1.0 / (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(-1.0 / N[(N[(a / y), $MachinePrecision] * N[(1.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-1}{\frac{a}{y} \cdot \frac{1}{z - t}}
\end{array}
Initial program 96.2%
associate-/l*91.4%
Simplified91.4%
associate-*r/96.2%
clear-num96.1%
Applied egg-rr96.1%
associate-/r*99.0%
div-inv99.0%
Applied egg-rr99.0%
Final simplification99.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ t a))))
(if (<= a -1e-32)
x
(if (<= a -1.25e-121)
t_1
(if (<= a 2.1e-62)
(* z (/ (- y) a))
(if (<= a 5.8e-22) t_1 (if (<= a 2.8e+49) (* y (/ z (- a))) x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (t / a);
double tmp;
if (a <= -1e-32) {
tmp = x;
} else if (a <= -1.25e-121) {
tmp = t_1;
} else if (a <= 2.1e-62) {
tmp = z * (-y / a);
} else if (a <= 5.8e-22) {
tmp = t_1;
} else if (a <= 2.8e+49) {
tmp = y * (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) :: t_1
real(8) :: tmp
t_1 = y * (t / a)
if (a <= (-1d-32)) then
tmp = x
else if (a <= (-1.25d-121)) then
tmp = t_1
else if (a <= 2.1d-62) then
tmp = z * (-y / a)
else if (a <= 5.8d-22) then
tmp = t_1
else if (a <= 2.8d+49) then
tmp = y * (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 t_1 = y * (t / a);
double tmp;
if (a <= -1e-32) {
tmp = x;
} else if (a <= -1.25e-121) {
tmp = t_1;
} else if (a <= 2.1e-62) {
tmp = z * (-y / a);
} else if (a <= 5.8e-22) {
tmp = t_1;
} else if (a <= 2.8e+49) {
tmp = y * (z / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (t / a) tmp = 0 if a <= -1e-32: tmp = x elif a <= -1.25e-121: tmp = t_1 elif a <= 2.1e-62: tmp = z * (-y / a) elif a <= 5.8e-22: tmp = t_1 elif a <= 2.8e+49: tmp = y * (z / -a) else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(t / a)) tmp = 0.0 if (a <= -1e-32) tmp = x; elseif (a <= -1.25e-121) tmp = t_1; elseif (a <= 2.1e-62) tmp = Float64(z * Float64(Float64(-y) / a)); elseif (a <= 5.8e-22) tmp = t_1; elseif (a <= 2.8e+49) tmp = Float64(y * Float64(z / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (t / a); tmp = 0.0; if (a <= -1e-32) tmp = x; elseif (a <= -1.25e-121) tmp = t_1; elseif (a <= 2.1e-62) tmp = z * (-y / a); elseif (a <= 5.8e-22) tmp = t_1; elseif (a <= 2.8e+49) tmp = y * (z / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e-32], x, If[LessEqual[a, -1.25e-121], t$95$1, If[LessEqual[a, 2.1e-62], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.8e-22], t$95$1, If[LessEqual[a, 2.8e+49], N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{a}\\
\mathbf{if}\;a \leq -1 \cdot 10^{-32}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.1 \cdot 10^{-62}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+49}:\\
\;\;\;\;y \cdot \frac{z}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.00000000000000006e-32 or 2.7999999999999998e49 < a Initial program 93.6%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 62.3%
if -1.00000000000000006e-32 < a < -1.24999999999999997e-121 or 2.0999999999999999e-62 < a < 5.8000000000000003e-22Initial program 99.8%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in t around inf 64.0%
*-commutative64.0%
associate-/l*64.0%
Simplified64.0%
if -1.24999999999999997e-121 < a < 2.0999999999999999e-62Initial program 98.8%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in x around 0 87.7%
mul-1-neg87.7%
distribute-frac-neg87.7%
*-commutative87.7%
distribute-lft-neg-in87.7%
associate-*r/87.7%
*-commutative87.7%
neg-sub087.7%
sub-neg87.7%
+-commutative87.7%
associate--r+87.7%
neg-sub087.7%
remove-double-neg87.7%
Simplified87.7%
Taylor expanded in t around 0 65.9%
neg-mul-165.9%
Simplified65.9%
if 5.8000000000000003e-22 < a < 2.7999999999999998e49Initial program 93.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 55.6%
mul-1-neg55.6%
associate-/l*62.4%
distribute-rgt-neg-in62.4%
distribute-frac-neg262.4%
Simplified62.4%
Final simplification63.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y a))))
(if (<= y -1e+40)
t_1
(if (<= y -7.4e-110) (* y (/ (- z) a)) (if (<= y 6.6e-21) x t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (y <= -1e+40) {
tmp = t_1;
} else if (y <= -7.4e-110) {
tmp = y * (-z / a);
} else if (y <= 6.6e-21) {
tmp = x;
} else {
tmp = 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 = t * (y / a)
if (y <= (-1d+40)) then
tmp = t_1
else if (y <= (-7.4d-110)) then
tmp = y * (-z / a)
else if (y <= 6.6d-21) then
tmp = x
else
tmp = 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 = t * (y / a);
double tmp;
if (y <= -1e+40) {
tmp = t_1;
} else if (y <= -7.4e-110) {
tmp = y * (-z / a);
} else if (y <= 6.6e-21) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if y <= -1e+40: tmp = t_1 elif y <= -7.4e-110: tmp = y * (-z / a) elif y <= 6.6e-21: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) tmp = 0.0 if (y <= -1e+40) tmp = t_1; elseif (y <= -7.4e-110) tmp = Float64(y * Float64(Float64(-z) / a)); elseif (y <= 6.6e-21) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / a); tmp = 0.0; if (y <= -1e+40) tmp = t_1; elseif (y <= -7.4e-110) tmp = y * (-z / a); elseif (y <= 6.6e-21) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+40], t$95$1, If[LessEqual[y, -7.4e-110], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e-21], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -1 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.4 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.00000000000000003e40 or 6.60000000000000018e-21 < y Initial program 93.3%
clear-num93.2%
associate-/r/93.3%
Applied egg-rr93.3%
Taylor expanded in t around inf 47.4%
associate-/l*55.3%
Simplified55.3%
if -1.00000000000000003e40 < y < -7.40000000000000032e-110Initial program 99.9%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around inf 49.9%
mul-1-neg49.9%
associate-/l*49.8%
distribute-rgt-neg-in49.8%
distribute-frac-neg249.8%
Simplified49.8%
if -7.40000000000000032e-110 < y < 6.60000000000000018e-21Initial program 99.0%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in x around inf 63.3%
Final simplification57.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.25e-161) (not (<= a 4.4e-107))) (+ x (* y (/ (- t z) a))) (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.25e-161) || !(a <= 4.4e-107)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.25d-161)) .or. (.not. (a <= 4.4d-107))) then
tmp = x + (y * ((t - z) / a))
else
tmp = (y / a) * (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.25e-161) || !(a <= 4.4e-107)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.25e-161) or not (a <= 4.4e-107): tmp = x + (y * ((t - z) / a)) else: tmp = (y / a) * (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.25e-161) || !(a <= 4.4e-107)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(Float64(y / a) * Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.25e-161) || ~((a <= 4.4e-107))) tmp = x + (y * ((t - z) / a)); else tmp = (y / a) * (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.25e-161], N[Not[LessEqual[a, 4.4e-107]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{-161} \lor \neg \left(a \leq 4.4 \cdot 10^{-107}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -2.2499999999999998e-161 or 4.40000000000000025e-107 < a Initial program 95.2%
associate-/l*97.2%
Simplified97.2%
if -2.2499999999999998e-161 < a < 4.40000000000000025e-107Initial program 98.7%
associate-/l*77.4%
Simplified77.4%
Taylor expanded in x around 0 91.0%
mul-1-neg91.0%
distribute-frac-neg91.0%
*-commutative91.0%
distribute-lft-neg-in91.0%
associate-*r/92.3%
*-commutative92.3%
neg-sub092.3%
sub-neg92.3%
+-commutative92.3%
associate--r+92.3%
neg-sub092.3%
remove-double-neg92.3%
Simplified92.3%
Final simplification95.8%
(FPCore (x y z t a) :precision binary64 (if (<= (* y (- z t)) (- INFINITY)) (- x (/ y (/ a (- z t)))) (+ x (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * (z - t)) <= -((double) INFINITY)) {
tmp = x - (y / (a / (z - t)));
} 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)) <= -Double.POSITIVE_INFINITY) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y * (z - t)) <= -math.inf: tmp = x - (y / (a / (z - t))) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(y * Float64(z - t)) <= Float64(-Inf)) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); 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)) <= -Inf) tmp = x - (y / (a / (z - t))); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \leq -\infty:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -inf.0Initial program 78.5%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
if -inf.0 < (*.f64 y (-.f64 z t)) Initial program 97.9%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.4e+43) (not (<= t 5.8e+47))) (+ x (* y (/ t a))) (- x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.4e+43) || !(t <= 5.8e+47)) {
tmp = x + (y * (t / 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.4d+43)) .or. (.not. (t <= 5.8d+47))) then
tmp = x + (y * (t / 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.4e+43) || !(t <= 5.8e+47)) {
tmp = x + (y * (t / a));
} else {
tmp = x - ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.4e+43) or not (t <= 5.8e+47): tmp = x + (y * (t / a)) else: tmp = x - ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.4e+43) || !(t <= 5.8e+47)) tmp = Float64(x + Float64(y * Float64(t / 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 <= -1.4e+43) || ~((t <= 5.8e+47))) tmp = x + (y * (t / a)); else tmp = x - ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.4e+43], N[Not[LessEqual[t, 5.8e+47]], $MachinePrecision]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+43} \lor \neg \left(t \leq 5.8 \cdot 10^{+47}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.40000000000000009e43 or 5.79999999999999961e47 < t Initial program 96.2%
associate-/l*89.1%
Simplified89.1%
associate-*r/96.2%
clear-num96.1%
Applied egg-rr96.1%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 89.2%
cancel-sign-sub-inv89.2%
metadata-eval89.2%
*-commutative89.2%
*-lft-identity89.2%
associate-*r/86.6%
Simplified86.6%
if -1.40000000000000009e43 < t < 5.79999999999999961e47Initial program 96.2%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in z around inf 88.1%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.2e+40) (not (<= t 2.3e+50))) (+ x (* y (/ t a))) (- x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.2e+40) || !(t <= 2.3e+50)) {
tmp = x + (y * (t / 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 <= (-5.2d+40)) .or. (.not. (t <= 2.3d+50))) then
tmp = x + (y * (t / 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 <= -5.2e+40) || !(t <= 2.3e+50)) {
tmp = x + (y * (t / a));
} else {
tmp = x - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.2e+40) or not (t <= 2.3e+50): tmp = x + (y * (t / a)) else: tmp = x - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.2e+40) || !(t <= 2.3e+50)) tmp = Float64(x + Float64(y * Float64(t / 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 <= -5.2e+40) || ~((t <= 2.3e+50))) tmp = x + (y * (t / a)); else tmp = x - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.2e+40], N[Not[LessEqual[t, 2.3e+50]], $MachinePrecision]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+40} \lor \neg \left(t \leq 2.3 \cdot 10^{+50}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -5.2000000000000001e40 or 2.29999999999999997e50 < t Initial program 96.2%
associate-/l*89.1%
Simplified89.1%
associate-*r/96.2%
clear-num96.1%
Applied egg-rr96.1%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 89.2%
cancel-sign-sub-inv89.2%
metadata-eval89.2%
*-commutative89.2%
*-lft-identity89.2%
associate-*r/86.6%
Simplified86.6%
if -5.2000000000000001e40 < t < 2.29999999999999997e50Initial program 96.2%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in z around inf 88.1%
associate-/l*85.4%
Simplified85.4%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.5e-117) (not (<= a 5.8e+47))) (+ x (* y (/ t a))) (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.5e-117) || !(a <= 5.8e+47)) {
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 <= (-6.5d-117)) .or. (.not. (a <= 5.8d+47))) 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 <= -6.5e-117) || !(a <= 5.8e+47)) {
tmp = x + (y * (t / a));
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.5e-117) or not (a <= 5.8e+47): 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 <= -6.5e-117) || !(a <= 5.8e+47)) 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 <= -6.5e-117) || ~((a <= 5.8e+47))) 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, -6.5e-117], N[Not[LessEqual[a, 5.8e+47]], $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 -6.5 \cdot 10^{-117} \lor \neg \left(a \leq 5.8 \cdot 10^{+47}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -6.5000000000000001e-117 or 5.79999999999999961e47 < a Initial program 94.6%
associate-/l*96.5%
Simplified96.5%
associate-*r/94.6%
clear-num94.5%
Applied egg-rr94.5%
associate-/r*99.1%
div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 79.8%
cancel-sign-sub-inv79.8%
metadata-eval79.8%
*-commutative79.8%
*-lft-identity79.8%
associate-*r/81.5%
Simplified81.5%
if -6.5000000000000001e-117 < a < 5.79999999999999961e47Initial program 98.3%
associate-/l*84.9%
Simplified84.9%
Taylor expanded in x around 0 85.3%
mul-1-neg85.3%
distribute-frac-neg85.3%
*-commutative85.3%
distribute-lft-neg-in85.3%
associate-*r/86.1%
*-commutative86.1%
neg-sub086.1%
sub-neg86.1%
+-commutative86.1%
associate--r+86.1%
neg-sub086.1%
remove-double-neg86.1%
Simplified86.1%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.8e+91) x (if (<= a 1.26e+184) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.8e+91) {
tmp = x;
} else if (a <= 1.26e+184) {
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 <= (-5.8d+91)) then
tmp = x
else if (a <= 1.26d+184) 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 <= -5.8e+91) {
tmp = x;
} else if (a <= 1.26e+184) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.8e+91: tmp = x elif a <= 1.26e+184: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.8e+91) tmp = x; elseif (a <= 1.26e+184) 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 <= -5.8e+91) tmp = x; elseif (a <= 1.26e+184) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.8e+91], x, If[LessEqual[a, 1.26e+184], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.26 \cdot 10^{+184}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.80000000000000028e91 or 1.26e184 < a Initial program 91.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 75.1%
if -5.80000000000000028e91 < a < 1.26e184Initial program 98.3%
associate-/l*87.7%
Simplified87.7%
Taylor expanded in x around 0 77.5%
mul-1-neg77.5%
distribute-frac-neg77.5%
*-commutative77.5%
distribute-lft-neg-in77.5%
associate-*r/78.5%
*-commutative78.5%
neg-sub078.5%
sub-neg78.5%
+-commutative78.5%
associate--r+78.5%
neg-sub078.5%
remove-double-neg78.5%
Simplified78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -360.0) (not (<= y 7.5e-20))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -360.0) || !(y <= 7.5e-20)) {
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 ((y <= (-360.0d0)) .or. (.not. (y <= 7.5d-20))) 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 ((y <= -360.0) || !(y <= 7.5e-20)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -360.0) or not (y <= 7.5e-20): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -360.0) || !(y <= 7.5e-20)) 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 ((y <= -360.0) || ~((y <= 7.5e-20))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -360.0], N[Not[LessEqual[y, 7.5e-20]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -360 \lor \neg \left(y \leq 7.5 \cdot 10^{-20}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -360 or 7.49999999999999981e-20 < y Initial program 93.5%
clear-num93.4%
associate-/r/93.5%
Applied egg-rr93.5%
Taylor expanded in t around inf 46.9%
associate-/l*54.5%
Simplified54.5%
if -360 < y < 7.49999999999999981e-20Initial program 99.2%
associate-/l*83.0%
Simplified83.0%
Taylor expanded in x around inf 57.8%
Final simplification56.1%
(FPCore (x y z t a) :precision binary64 (+ x (/ 1.0 (/ (/ a y) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x + (1.0 / ((a / y) / (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 + (1.0d0 / ((a / y) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (1.0 / ((a / y) / (t - z)));
}
def code(x, y, z, t, a): return x + (1.0 / ((a / y) / (t - z)))
function code(x, y, z, t, a) return Float64(x + Float64(1.0 / Float64(Float64(a / y) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (1.0 / ((a / y) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(1.0 / N[(N[(a / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{1}{\frac{\frac{a}{y}}{t - z}}
\end{array}
Initial program 96.2%
clear-num96.1%
associate-/r/96.2%
Applied egg-rr96.2%
associate-/r/96.1%
associate-/r*99.0%
Applied egg-rr99.0%
Final simplification99.0%
(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 96.2%
associate-/l*91.4%
Simplified91.4%
Taylor expanded in x around inf 38.6%
(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 2024110
(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)))