
(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 15 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 (<= z 1.9e-122) (+ x (/ (* y (- z t)) a)) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.9e-122) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + ((z - 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.9d-122) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + ((z - 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.9e-122) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.9e-122: tmp = x + ((y * (z - t)) / a) else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.9e-122) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.9e-122) tmp = x + ((y * (z - t)) / a); else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.9e-122], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.9 \cdot 10^{-122}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < 1.9e-122Initial program 98.1%
if 1.9e-122 < z Initial program 93.4%
+-commutative93.4%
*-commutative93.4%
associate-/l*99.0%
Applied egg-rr99.0%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y) a))) (t_2 (/ (* z y) a)))
(if (<= a -1.3e+104)
x
(if (<= a -1.5e+25)
(* y (/ z a))
(if (<= a -3.6e-42)
x
(if (<= a -1.82e-183)
t_1
(if (<= a 5.1e-64)
t_2
(if (<= a 360.0)
x
(if (<= a 1.9e+32) t_2 (if (<= a 1e+57) t_1 x))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-y / a);
double t_2 = (z * y) / a;
double tmp;
if (a <= -1.3e+104) {
tmp = x;
} else if (a <= -1.5e+25) {
tmp = y * (z / a);
} else if (a <= -3.6e-42) {
tmp = x;
} else if (a <= -1.82e-183) {
tmp = t_1;
} else if (a <= 5.1e-64) {
tmp = t_2;
} else if (a <= 360.0) {
tmp = x;
} else if (a <= 1.9e+32) {
tmp = t_2;
} else if (a <= 1e+57) {
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 = t * (-y / a)
t_2 = (z * y) / a
if (a <= (-1.3d+104)) then
tmp = x
else if (a <= (-1.5d+25)) then
tmp = y * (z / a)
else if (a <= (-3.6d-42)) then
tmp = x
else if (a <= (-1.82d-183)) then
tmp = t_1
else if (a <= 5.1d-64) then
tmp = t_2
else if (a <= 360.0d0) then
tmp = x
else if (a <= 1.9d+32) then
tmp = t_2
else if (a <= 1d+57) 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 = t * (-y / a);
double t_2 = (z * y) / a;
double tmp;
if (a <= -1.3e+104) {
tmp = x;
} else if (a <= -1.5e+25) {
tmp = y * (z / a);
} else if (a <= -3.6e-42) {
tmp = x;
} else if (a <= -1.82e-183) {
tmp = t_1;
} else if (a <= 5.1e-64) {
tmp = t_2;
} else if (a <= 360.0) {
tmp = x;
} else if (a <= 1.9e+32) {
tmp = t_2;
} else if (a <= 1e+57) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (-y / a) t_2 = (z * y) / a tmp = 0 if a <= -1.3e+104: tmp = x elif a <= -1.5e+25: tmp = y * (z / a) elif a <= -3.6e-42: tmp = x elif a <= -1.82e-183: tmp = t_1 elif a <= 5.1e-64: tmp = t_2 elif a <= 360.0: tmp = x elif a <= 1.9e+32: tmp = t_2 elif a <= 1e+57: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(-y) / a)) t_2 = Float64(Float64(z * y) / a) tmp = 0.0 if (a <= -1.3e+104) tmp = x; elseif (a <= -1.5e+25) tmp = Float64(y * Float64(z / a)); elseif (a <= -3.6e-42) tmp = x; elseif (a <= -1.82e-183) tmp = t_1; elseif (a <= 5.1e-64) tmp = t_2; elseif (a <= 360.0) tmp = x; elseif (a <= 1.9e+32) tmp = t_2; elseif (a <= 1e+57) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (-y / a); t_2 = (z * y) / a; tmp = 0.0; if (a <= -1.3e+104) tmp = x; elseif (a <= -1.5e+25) tmp = y * (z / a); elseif (a <= -3.6e-42) tmp = x; elseif (a <= -1.82e-183) tmp = t_1; elseif (a <= 5.1e-64) tmp = t_2; elseif (a <= 360.0) tmp = x; elseif (a <= 1.9e+32) tmp = t_2; elseif (a <= 1e+57) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -1.3e+104], x, If[LessEqual[a, -1.5e+25], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3.6e-42], x, If[LessEqual[a, -1.82e-183], t$95$1, If[LessEqual[a, 5.1e-64], t$95$2, If[LessEqual[a, 360.0], x, If[LessEqual[a, 1.9e+32], t$95$2, If[LessEqual[a, 1e+57], t$95$1, x]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{-y}{a}\\
t_2 := \frac{z \cdot y}{a}\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+104}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.5 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq -3.6 \cdot 10^{-42}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.82 \cdot 10^{-183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.1 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 360:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.3e104 or -1.50000000000000003e25 < a < -3.6000000000000002e-42 or 5.09999999999999984e-64 < a < 360 or 1.00000000000000005e57 < a Initial program 93.5%
Taylor expanded in x around inf 71.3%
if -1.3e104 < a < -1.50000000000000003e25Initial program 86.6%
Taylor expanded in x around 0 66.4%
Taylor expanded in z around inf 39.0%
associate-/l*72.8%
Simplified52.3%
if -3.6000000000000002e-42 < a < -1.82e-183 or 1.9000000000000002e32 < a < 1.00000000000000005e57Initial program 99.8%
Taylor expanded in x around 0 89.9%
Taylor expanded in z around 0 67.2%
associate-*r/67.2%
mul-1-neg67.2%
distribute-lft-neg-out67.2%
*-commutative67.2%
associate-/l*62.3%
distribute-neg-frac62.3%
distribute-neg-frac262.3%
Simplified62.3%
associate-*r/67.2%
distribute-frac-neg267.2%
*-commutative67.2%
add-sqr-sqrt12.8%
sqrt-unprod14.1%
sqr-neg14.1%
sqrt-unprod1.3%
add-sqr-sqrt1.3%
associate-*l/1.3%
div-inv1.3%
associate-*l*1.3%
add-sqr-sqrt1.3%
sqrt-unprod14.0%
sqr-neg14.0%
sqrt-unprod12.7%
add-sqr-sqrt67.1%
associate-/r/67.1%
clear-num67.2%
Applied egg-rr67.2%
if -1.82e-183 < a < 5.09999999999999984e-64 or 360 < a < 1.9000000000000002e32Initial program 99.8%
Taylor expanded in x around 0 91.3%
Taylor expanded in z around inf 55.7%
Final simplification64.4%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -5e+105)
(not
(or (<= a -2.05e+25)
(and (not (<= a -1.65e-31))
(or (<= a 3.6e-64) (and (not (<= a 54.0)) (<= a 8e+31)))))))
x
(* y (/ z a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5e+105) || !((a <= -2.05e+25) || (!(a <= -1.65e-31) && ((a <= 3.6e-64) || (!(a <= 54.0) && (a <= 8e+31)))))) {
tmp = x;
} else {
tmp = 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 ((a <= (-5d+105)) .or. (.not. (a <= (-2.05d+25)) .or. (.not. (a <= (-1.65d-31))) .and. (a <= 3.6d-64) .or. (.not. (a <= 54.0d0)) .and. (a <= 8d+31))) then
tmp = x
else
tmp = 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 ((a <= -5e+105) || !((a <= -2.05e+25) || (!(a <= -1.65e-31) && ((a <= 3.6e-64) || (!(a <= 54.0) && (a <= 8e+31)))))) {
tmp = x;
} else {
tmp = y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5e+105) or not ((a <= -2.05e+25) or (not (a <= -1.65e-31) and ((a <= 3.6e-64) or (not (a <= 54.0) and (a <= 8e+31))))): tmp = x else: tmp = y * (z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5e+105) || !((a <= -2.05e+25) || (!(a <= -1.65e-31) && ((a <= 3.6e-64) || (!(a <= 54.0) && (a <= 8e+31)))))) tmp = x; else tmp = Float64(y * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5e+105) || ~(((a <= -2.05e+25) || (~((a <= -1.65e-31)) && ((a <= 3.6e-64) || (~((a <= 54.0)) && (a <= 8e+31))))))) tmp = x; else tmp = y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5e+105], N[Not[Or[LessEqual[a, -2.05e+25], And[N[Not[LessEqual[a, -1.65e-31]], $MachinePrecision], Or[LessEqual[a, 3.6e-64], And[N[Not[LessEqual[a, 54.0]], $MachinePrecision], LessEqual[a, 8e+31]]]]]], $MachinePrecision]], x, N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+105} \lor \neg \left(a \leq -2.05 \cdot 10^{+25} \lor \neg \left(a \leq -1.65 \cdot 10^{-31}\right) \land \left(a \leq 3.6 \cdot 10^{-64} \lor \neg \left(a \leq 54\right) \land a \leq 8 \cdot 10^{+31}\right)\right):\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -5.00000000000000046e105 or -2.04999999999999983e25 < a < -1.65e-31 or 3.5999999999999998e-64 < a < 54 or 7.9999999999999997e31 < a Initial program 93.7%
Taylor expanded in x around inf 68.7%
if -5.00000000000000046e105 < a < -2.04999999999999983e25 or -1.65e-31 < a < 3.5999999999999998e-64 or 54 < a < 7.9999999999999997e31Initial program 98.5%
Taylor expanded in x around 0 87.4%
Taylor expanded in z around inf 51.5%
associate-/l*59.2%
Simplified48.2%
Final simplification57.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.1e+104)
x
(if (<= a -1.65e+25)
(* y (/ z a))
(if (<= a -2e-31)
x
(if (<= a 6e-63)
(/ z (/ a y))
(if (or (<= a 160.0) (not (<= a 5.2e+31))) x (/ (* z y) a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.1e+104) {
tmp = x;
} else if (a <= -1.65e+25) {
tmp = y * (z / a);
} else if (a <= -2e-31) {
tmp = x;
} else if (a <= 6e-63) {
tmp = z / (a / y);
} else if ((a <= 160.0) || !(a <= 5.2e+31)) {
tmp = x;
} else {
tmp = (z * 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 (a <= (-1.1d+104)) then
tmp = x
else if (a <= (-1.65d+25)) then
tmp = y * (z / a)
else if (a <= (-2d-31)) then
tmp = x
else if (a <= 6d-63) then
tmp = z / (a / y)
else if ((a <= 160.0d0) .or. (.not. (a <= 5.2d+31))) then
tmp = x
else
tmp = (z * 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 (a <= -1.1e+104) {
tmp = x;
} else if (a <= -1.65e+25) {
tmp = y * (z / a);
} else if (a <= -2e-31) {
tmp = x;
} else if (a <= 6e-63) {
tmp = z / (a / y);
} else if ((a <= 160.0) || !(a <= 5.2e+31)) {
tmp = x;
} else {
tmp = (z * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.1e+104: tmp = x elif a <= -1.65e+25: tmp = y * (z / a) elif a <= -2e-31: tmp = x elif a <= 6e-63: tmp = z / (a / y) elif (a <= 160.0) or not (a <= 5.2e+31): tmp = x else: tmp = (z * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.1e+104) tmp = x; elseif (a <= -1.65e+25) tmp = Float64(y * Float64(z / a)); elseif (a <= -2e-31) tmp = x; elseif (a <= 6e-63) tmp = Float64(z / Float64(a / y)); elseif ((a <= 160.0) || !(a <= 5.2e+31)) tmp = x; else tmp = Float64(Float64(z * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.1e+104) tmp = x; elseif (a <= -1.65e+25) tmp = y * (z / a); elseif (a <= -2e-31) tmp = x; elseif (a <= 6e-63) tmp = z / (a / y); elseif ((a <= 160.0) || ~((a <= 5.2e+31))) tmp = x; else tmp = (z * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.1e+104], x, If[LessEqual[a, -1.65e+25], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2e-31], x, If[LessEqual[a, 6e-63], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 160.0], N[Not[LessEqual[a, 5.2e+31]], $MachinePrecision]], x, N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+104}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.65 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;\frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 160 \lor \neg \left(a \leq 5.2 \cdot 10^{+31}\right):\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\end{array}
\end{array}
if a < -1.1e104 or -1.6500000000000001e25 < a < -2e-31 or 5.99999999999999959e-63 < a < 160 or 5.2e31 < a Initial program 93.7%
Taylor expanded in x around inf 68.7%
if -1.1e104 < a < -1.6500000000000001e25Initial program 86.6%
Taylor expanded in x around 0 66.4%
Taylor expanded in z around inf 39.0%
associate-/l*72.8%
Simplified52.3%
if -2e-31 < a < 5.99999999999999959e-63Initial program 99.8%
Taylor expanded in x around 0 89.1%
Taylor expanded in z around inf 51.8%
associate-/l*57.5%
Simplified46.9%
*-commutative57.5%
div-inv57.5%
associate-*l*62.0%
associate-/r/61.9%
clear-num62.0%
Applied egg-rr52.3%
clear-num52.2%
un-div-inv52.3%
Applied egg-rr52.3%
if 160 < a < 5.2e31Initial program 99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around inf 67.5%
Final simplification60.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z a))))
(if (<= a -1.36e+104)
x
(if (<= a -2.6e+25)
t_1
(if (<= a -1.9e-31)
x
(if (<= a 5.3e-63)
(/ z (/ a y))
(if (or (<= a 76.0) (not (<= a 3.2e+31))) x t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (a <= -1.36e+104) {
tmp = x;
} else if (a <= -2.6e+25) {
tmp = t_1;
} else if (a <= -1.9e-31) {
tmp = x;
} else if (a <= 5.3e-63) {
tmp = z / (a / y);
} else if ((a <= 76.0) || !(a <= 3.2e+31)) {
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 = y * (z / a)
if (a <= (-1.36d+104)) then
tmp = x
else if (a <= (-2.6d+25)) then
tmp = t_1
else if (a <= (-1.9d-31)) then
tmp = x
else if (a <= 5.3d-63) then
tmp = z / (a / y)
else if ((a <= 76.0d0) .or. (.not. (a <= 3.2d+31))) 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 = y * (z / a);
double tmp;
if (a <= -1.36e+104) {
tmp = x;
} else if (a <= -2.6e+25) {
tmp = t_1;
} else if (a <= -1.9e-31) {
tmp = x;
} else if (a <= 5.3e-63) {
tmp = z / (a / y);
} else if ((a <= 76.0) || !(a <= 3.2e+31)) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / a) tmp = 0 if a <= -1.36e+104: tmp = x elif a <= -2.6e+25: tmp = t_1 elif a <= -1.9e-31: tmp = x elif a <= 5.3e-63: tmp = z / (a / y) elif (a <= 76.0) or not (a <= 3.2e+31): tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / a)) tmp = 0.0 if (a <= -1.36e+104) tmp = x; elseif (a <= -2.6e+25) tmp = t_1; elseif (a <= -1.9e-31) tmp = x; elseif (a <= 5.3e-63) tmp = Float64(z / Float64(a / y)); elseif ((a <= 76.0) || !(a <= 3.2e+31)) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / a); tmp = 0.0; if (a <= -1.36e+104) tmp = x; elseif (a <= -2.6e+25) tmp = t_1; elseif (a <= -1.9e-31) tmp = x; elseif (a <= 5.3e-63) tmp = z / (a / y); elseif ((a <= 76.0) || ~((a <= 3.2e+31))) tmp = x; else tmp = t_1; 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.36e+104], x, If[LessEqual[a, -2.6e+25], t$95$1, If[LessEqual[a, -1.9e-31], x, If[LessEqual[a, 5.3e-63], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 76.0], N[Not[LessEqual[a, 3.2e+31]], $MachinePrecision]], x, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;a \leq -1.36 \cdot 10^{+104}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq 76 \lor \neg \left(a \leq 3.2 \cdot 10^{+31}\right):\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.3599999999999999e104 or -2.5999999999999998e25 < a < -1.9e-31 or 5.30000000000000034e-63 < a < 76 or 3.2000000000000001e31 < a Initial program 93.7%
Taylor expanded in x around inf 68.7%
if -1.3599999999999999e104 < a < -2.5999999999999998e25 or 76 < a < 3.2000000000000001e31Initial program 91.7%
Taylor expanded in x around 0 79.4%
Taylor expanded in z around inf 50.1%
associate-/l*67.1%
Simplified54.5%
if -1.9e-31 < a < 5.30000000000000034e-63Initial program 99.8%
Taylor expanded in x around 0 89.1%
Taylor expanded in z around inf 51.8%
associate-/l*57.5%
Simplified46.9%
*-commutative57.5%
div-inv57.5%
associate-*l*62.0%
associate-/r/61.9%
clear-num62.0%
Applied egg-rr52.3%
clear-num52.2%
un-div-inv52.3%
Applied egg-rr52.3%
Final simplification60.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z a))))
(if (<= a -8.6e+107)
x
(if (<= a -1.72e+25)
t_1
(if (<= a -8.6e-32)
x
(if (<= a 3.3e-63)
(* z (/ y a))
(if (or (<= a 106.0) (not (<= a 3.4e+28))) x t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (a <= -8.6e+107) {
tmp = x;
} else if (a <= -1.72e+25) {
tmp = t_1;
} else if (a <= -8.6e-32) {
tmp = x;
} else if (a <= 3.3e-63) {
tmp = z * (y / a);
} else if ((a <= 106.0) || !(a <= 3.4e+28)) {
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 = y * (z / a)
if (a <= (-8.6d+107)) then
tmp = x
else if (a <= (-1.72d+25)) then
tmp = t_1
else if (a <= (-8.6d-32)) then
tmp = x
else if (a <= 3.3d-63) then
tmp = z * (y / a)
else if ((a <= 106.0d0) .or. (.not. (a <= 3.4d+28))) 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 = y * (z / a);
double tmp;
if (a <= -8.6e+107) {
tmp = x;
} else if (a <= -1.72e+25) {
tmp = t_1;
} else if (a <= -8.6e-32) {
tmp = x;
} else if (a <= 3.3e-63) {
tmp = z * (y / a);
} else if ((a <= 106.0) || !(a <= 3.4e+28)) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / a) tmp = 0 if a <= -8.6e+107: tmp = x elif a <= -1.72e+25: tmp = t_1 elif a <= -8.6e-32: tmp = x elif a <= 3.3e-63: tmp = z * (y / a) elif (a <= 106.0) or not (a <= 3.4e+28): tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / a)) tmp = 0.0 if (a <= -8.6e+107) tmp = x; elseif (a <= -1.72e+25) tmp = t_1; elseif (a <= -8.6e-32) tmp = x; elseif (a <= 3.3e-63) tmp = Float64(z * Float64(y / a)); elseif ((a <= 106.0) || !(a <= 3.4e+28)) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / a); tmp = 0.0; if (a <= -8.6e+107) tmp = x; elseif (a <= -1.72e+25) tmp = t_1; elseif (a <= -8.6e-32) tmp = x; elseif (a <= 3.3e-63) tmp = z * (y / a); elseif ((a <= 106.0) || ~((a <= 3.4e+28))) tmp = x; else tmp = t_1; 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, -8.6e+107], x, If[LessEqual[a, -1.72e+25], t$95$1, If[LessEqual[a, -8.6e-32], x, If[LessEqual[a, 3.3e-63], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 106.0], N[Not[LessEqual[a, 3.4e+28]], $MachinePrecision]], x, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;a \leq -8.6 \cdot 10^{+107}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.72 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -8.6 \cdot 10^{-32}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-63}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 106 \lor \neg \left(a \leq 3.4 \cdot 10^{+28}\right):\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.5999999999999999e107 or -1.71999999999999995e25 < a < -8.5999999999999998e-32 or 3.29999999999999994e-63 < a < 106 or 3.4e28 < a Initial program 93.7%
Taylor expanded in x around inf 68.7%
if -8.5999999999999999e107 < a < -1.71999999999999995e25 or 106 < a < 3.4e28Initial program 91.7%
Taylor expanded in x around 0 79.4%
Taylor expanded in z around inf 50.1%
associate-/l*67.1%
Simplified54.5%
if -8.5999999999999998e-32 < a < 3.29999999999999994e-63Initial program 99.8%
Taylor expanded in x around 0 89.1%
Taylor expanded in z around inf 51.8%
associate-/l*57.5%
Simplified46.9%
*-commutative57.5%
div-inv57.5%
associate-*l*62.0%
associate-/r/61.9%
clear-num62.0%
Applied egg-rr52.3%
Final simplification60.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e+68)
(/ (* z y) a)
(if (<= z -1.02e-103)
x
(if (<= z -1.15e-159)
(* t (/ (- y) a))
(if (<= z -1.25e-231)
x
(if (<= z 2.3e-191)
(/ (* y (- t)) a)
(if (<= z 2.9e+139) x (* z (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+68) {
tmp = (z * y) / a;
} else if (z <= -1.02e-103) {
tmp = x;
} else if (z <= -1.15e-159) {
tmp = t * (-y / a);
} else if (z <= -1.25e-231) {
tmp = x;
} else if (z <= 2.3e-191) {
tmp = (y * -t) / a;
} else if (z <= 2.9e+139) {
tmp = x;
} else {
tmp = z * (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 <= (-3.1d+68)) then
tmp = (z * y) / a
else if (z <= (-1.02d-103)) then
tmp = x
else if (z <= (-1.15d-159)) then
tmp = t * (-y / a)
else if (z <= (-1.25d-231)) then
tmp = x
else if (z <= 2.3d-191) then
tmp = (y * -t) / a
else if (z <= 2.9d+139) then
tmp = x
else
tmp = z * (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 <= -3.1e+68) {
tmp = (z * y) / a;
} else if (z <= -1.02e-103) {
tmp = x;
} else if (z <= -1.15e-159) {
tmp = t * (-y / a);
} else if (z <= -1.25e-231) {
tmp = x;
} else if (z <= 2.3e-191) {
tmp = (y * -t) / a;
} else if (z <= 2.9e+139) {
tmp = x;
} else {
tmp = z * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e+68: tmp = (z * y) / a elif z <= -1.02e-103: tmp = x elif z <= -1.15e-159: tmp = t * (-y / a) elif z <= -1.25e-231: tmp = x elif z <= 2.3e-191: tmp = (y * -t) / a elif z <= 2.9e+139: tmp = x else: tmp = z * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+68) tmp = Float64(Float64(z * y) / a); elseif (z <= -1.02e-103) tmp = x; elseif (z <= -1.15e-159) tmp = Float64(t * Float64(Float64(-y) / a)); elseif (z <= -1.25e-231) tmp = x; elseif (z <= 2.3e-191) tmp = Float64(Float64(y * Float64(-t)) / a); elseif (z <= 2.9e+139) tmp = x; else tmp = Float64(z * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e+68) tmp = (z * y) / a; elseif (z <= -1.02e-103) tmp = x; elseif (z <= -1.15e-159) tmp = t * (-y / a); elseif (z <= -1.25e-231) tmp = x; elseif (z <= 2.3e-191) tmp = (y * -t) / a; elseif (z <= 2.9e+139) tmp = x; else tmp = z * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+68], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, -1.02e-103], x, If[LessEqual[z, -1.15e-159], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.25e-231], x, If[LessEqual[z, 2.3e-191], N[(N[(y * (-t)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 2.9e+139], x, N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+68}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-103}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-159}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-231}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-191}:\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+139}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.0999999999999998e68Initial program 95.7%
Taylor expanded in x around 0 78.2%
Taylor expanded in z around inf 63.9%
if -3.0999999999999998e68 < z < -1.01999999999999998e-103 or -1.14999999999999989e-159 < z < -1.25000000000000006e-231 or 2.30000000000000011e-191 < z < 2.8999999999999999e139Initial program 96.7%
Taylor expanded in x around inf 55.5%
if -1.01999999999999998e-103 < z < -1.14999999999999989e-159Initial program 93.3%
Taylor expanded in x around 0 77.6%
Taylor expanded in z around 0 59.1%
associate-*r/59.1%
mul-1-neg59.1%
distribute-lft-neg-out59.1%
*-commutative59.1%
associate-/l*59.2%
distribute-neg-frac59.2%
distribute-neg-frac259.2%
Simplified59.2%
associate-*r/59.1%
distribute-frac-neg259.1%
*-commutative59.1%
add-sqr-sqrt37.2%
sqrt-unprod43.4%
sqr-neg43.4%
sqrt-unprod0.1%
add-sqr-sqrt0.7%
associate-*l/0.7%
div-inv0.7%
associate-*l*0.7%
add-sqr-sqrt0.1%
sqrt-unprod43.5%
sqr-neg43.5%
sqrt-unprod50.4%
add-sqr-sqrt79.1%
associate-/r/79.2%
clear-num79.2%
Applied egg-rr79.2%
if -1.25000000000000006e-231 < z < 2.30000000000000011e-191Initial program 99.8%
Taylor expanded in x around 0 70.0%
Taylor expanded in z around 0 70.0%
mul-1-neg70.0%
distribute-rgt-neg-in70.0%
Simplified70.0%
if 2.8999999999999999e139 < z Initial program 93.0%
Taylor expanded in x around 0 72.1%
Taylor expanded in z around inf 67.5%
associate-/l*88.9%
Simplified63.5%
*-commutative88.9%
div-inv88.8%
associate-*l*93.2%
associate-/r/93.1%
clear-num93.2%
Applied egg-rr67.8%
Final simplification62.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) a)))
(if (<= t_1 -2e+96)
(/ y (/ a (- z t)))
(if (<= t_1 5e+150) (+ x (* y (/ z a))) (* (- z t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -2e+96) {
tmp = y / (a / (z - t));
} else if (t_1 <= 5e+150) {
tmp = x + (y * (z / a));
} else {
tmp = (z - 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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / a
if (t_1 <= (-2d+96)) then
tmp = y / (a / (z - t))
else if (t_1 <= 5d+150) then
tmp = x + (y * (z / a))
else
tmp = (z - t) * (y / a)
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 - t)) / a;
double tmp;
if (t_1 <= -2e+96) {
tmp = y / (a / (z - t));
} else if (t_1 <= 5e+150) {
tmp = x + (y * (z / a));
} else {
tmp = (z - t) * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -2e+96: tmp = y / (a / (z - t)) elif t_1 <= 5e+150: tmp = x + (y * (z / a)) else: tmp = (z - t) * (y / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -2e+96) tmp = Float64(y / Float64(a / Float64(z - t))); elseif (t_1 <= 5e+150) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(Float64(z - t) * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -2e+96) tmp = y / (a / (z - t)); elseif (t_1 <= 5e+150) tmp = x + (y * (z / a)); else tmp = (z - t) * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+96], N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+150], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+96}:\\
\;\;\;\;\frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+150}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -2.0000000000000001e96Initial program 91.5%
Taylor expanded in x around 0 90.1%
associate-/l*97.2%
clear-num97.2%
un-div-inv97.2%
Applied egg-rr93.1%
if -2.0000000000000001e96 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.00000000000000009e150Initial program 99.9%
Taylor expanded in z around inf 89.3%
associate-/l*88.5%
Simplified88.5%
if 5.00000000000000009e150 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 93.7%
Taylor expanded in x around 0 92.2%
*-commutative92.2%
associate-/l*95.3%
Applied egg-rr95.3%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -1.95e-60)
(and (not (<= a 4.6e-116)) (or (<= a 125.0) (not (<= a 1.18e+57)))))
(+ x (* y (/ z a)))
(* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.95e-60) || (!(a <= 4.6e-116) && ((a <= 125.0) || !(a <= 1.18e+57)))) {
tmp = x + (y * (z / a));
} else {
tmp = (z - 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 ((a <= (-1.95d-60)) .or. (.not. (a <= 4.6d-116)) .and. (a <= 125.0d0) .or. (.not. (a <= 1.18d+57))) then
tmp = x + (y * (z / a))
else
tmp = (z - 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 ((a <= -1.95e-60) || (!(a <= 4.6e-116) && ((a <= 125.0) || !(a <= 1.18e+57)))) {
tmp = x + (y * (z / a));
} else {
tmp = (z - t) * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.95e-60) or (not (a <= 4.6e-116) and ((a <= 125.0) or not (a <= 1.18e+57))): tmp = x + (y * (z / a)) else: tmp = (z - t) * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.95e-60) || (!(a <= 4.6e-116) && ((a <= 125.0) || !(a <= 1.18e+57)))) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(Float64(z - t) * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.95e-60) || (~((a <= 4.6e-116)) && ((a <= 125.0) || ~((a <= 1.18e+57))))) tmp = x + (y * (z / a)); else tmp = (z - t) * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.95e-60], And[N[Not[LessEqual[a, 4.6e-116]], $MachinePrecision], Or[LessEqual[a, 125.0], N[Not[LessEqual[a, 1.18e+57]], $MachinePrecision]]]], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-60} \lor \neg \left(a \leq 4.6 \cdot 10^{-116}\right) \land \left(a \leq 125 \lor \neg \left(a \leq 1.18 \cdot 10^{+57}\right)\right):\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -1.9500000000000001e-60 or 4.60000000000000003e-116 < a < 125 or 1.18e57 < a Initial program 93.6%
Taylor expanded in z around inf 81.1%
associate-/l*85.4%
Simplified85.4%
if -1.9500000000000001e-60 < a < 4.60000000000000003e-116 or 125 < a < 1.18e57Initial program 99.8%
Taylor expanded in x around 0 93.5%
*-commutative93.5%
associate-/l*89.9%
Applied egg-rr89.9%
Final simplification87.3%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -1.66e+153)
(and (not (<= a -1.35e+25))
(or (<= a -0.00032) (not (<= a 2.45e+59)))))
x
(* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.66e+153) || (!(a <= -1.35e+25) && ((a <= -0.00032) || !(a <= 2.45e+59)))) {
tmp = x;
} else {
tmp = (z - 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 ((a <= (-1.66d+153)) .or. (.not. (a <= (-1.35d+25))) .and. (a <= (-0.00032d0)) .or. (.not. (a <= 2.45d+59))) then
tmp = x
else
tmp = (z - 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 ((a <= -1.66e+153) || (!(a <= -1.35e+25) && ((a <= -0.00032) || !(a <= 2.45e+59)))) {
tmp = x;
} else {
tmp = (z - t) * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.66e+153) or (not (a <= -1.35e+25) and ((a <= -0.00032) or not (a <= 2.45e+59))): tmp = x else: tmp = (z - t) * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.66e+153) || (!(a <= -1.35e+25) && ((a <= -0.00032) || !(a <= 2.45e+59)))) tmp = x; else tmp = Float64(Float64(z - t) * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.66e+153) || (~((a <= -1.35e+25)) && ((a <= -0.00032) || ~((a <= 2.45e+59))))) tmp = x; else tmp = (z - t) * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.66e+153], And[N[Not[LessEqual[a, -1.35e+25]], $MachinePrecision], Or[LessEqual[a, -0.00032], N[Not[LessEqual[a, 2.45e+59]], $MachinePrecision]]]], x, N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.66 \cdot 10^{+153} \lor \neg \left(a \leq -1.35 \cdot 10^{+25}\right) \land \left(a \leq -0.00032 \lor \neg \left(a \leq 2.45 \cdot 10^{+59}\right)\right):\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -1.66e153 or -1.35e25 < a < -3.20000000000000026e-4 or 2.45000000000000004e59 < a Initial program 93.8%
Taylor expanded in x around inf 77.1%
if -1.66e153 < a < -1.35e25 or -3.20000000000000026e-4 < a < 2.45000000000000004e59Initial program 97.6%
Taylor expanded in x around 0 81.7%
*-commutative81.7%
associate-/l*80.6%
Applied egg-rr80.6%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ t a)))))
(if (<= t -4.6e+62)
t_1
(if (<= t 8.4e-130)
(+ x (* y (/ z a)))
(if (<= t 6.2e+84) (+ x (* z (/ y a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (t / a));
double tmp;
if (t <= -4.6e+62) {
tmp = t_1;
} else if (t <= 8.4e-130) {
tmp = x + (y * (z / a));
} else if (t <= 6.2e+84) {
tmp = x + (z * (y / a));
} 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 = x - (y * (t / a))
if (t <= (-4.6d+62)) then
tmp = t_1
else if (t <= 8.4d-130) then
tmp = x + (y * (z / a))
else if (t <= 6.2d+84) then
tmp = x + (z * (y / a))
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 = x - (y * (t / a));
double tmp;
if (t <= -4.6e+62) {
tmp = t_1;
} else if (t <= 8.4e-130) {
tmp = x + (y * (z / a));
} else if (t <= 6.2e+84) {
tmp = x + (z * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (t / a)) tmp = 0 if t <= -4.6e+62: tmp = t_1 elif t <= 8.4e-130: tmp = x + (y * (z / a)) elif t <= 6.2e+84: tmp = x + (z * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(t / a))) tmp = 0.0 if (t <= -4.6e+62) tmp = t_1; elseif (t <= 8.4e-130) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= 6.2e+84) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (t / a)); tmp = 0.0; if (t <= -4.6e+62) tmp = t_1; elseif (t <= 8.4e-130) tmp = x + (y * (z / a)); elseif (t <= 6.2e+84) tmp = x + (z * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e+62], t$95$1, If[LessEqual[t, 8.4e-130], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+84], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t}{a}\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{-130}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+84}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.59999999999999968e62 or 6.20000000000000006e84 < t Initial program 95.2%
Taylor expanded in z around 0 88.7%
mul-1-neg88.7%
unsub-neg88.7%
*-commutative88.7%
associate-/l*87.8%
Simplified87.8%
if -4.59999999999999968e62 < t < 8.40000000000000008e-130Initial program 98.1%
Taylor expanded in z around inf 91.4%
associate-/l*91.3%
Simplified91.3%
if 8.40000000000000008e-130 < t < 6.20000000000000006e84Initial program 94.0%
Taylor expanded in z around inf 78.4%
associate-/l*78.5%
Simplified78.5%
*-commutative78.5%
div-inv78.5%
associate-*l*88.2%
associate-/r/88.1%
clear-num88.2%
Applied egg-rr88.2%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (* y (- z t)) a) 5e+150) (+ x (/ y (/ a (- z t)))) (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / a) <= 5e+150) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = (z - 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 (((y * (z - t)) / a) <= 5d+150) then
tmp = x + (y / (a / (z - t)))
else
tmp = (z - 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 (((y * (z - t)) / a) <= 5e+150) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = (z - t) * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((y * (z - t)) / a) <= 5e+150: tmp = x + (y / (a / (z - t))) else: tmp = (z - t) * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(y * Float64(z - t)) / a) <= 5e+150) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(Float64(z - t) * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((y * (z - t)) / a) <= 5e+150) tmp = x + (y / (a / (z - t))); else tmp = (z - t) * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], 5e+150], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a} \leq 5 \cdot 10^{+150}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < 5.00000000000000009e150Initial program 97.0%
associate-/l*97.4%
clear-num96.9%
un-div-inv97.5%
Applied egg-rr97.5%
if 5.00000000000000009e150 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 93.7%
Taylor expanded in x around 0 92.2%
*-commutative92.2%
associate-/l*95.3%
Applied egg-rr95.3%
(FPCore (x y z t a) :precision binary64 (if (<= z 5e-160) (+ x (/ (* y (- z t)) a)) (+ x (/ (- z t) (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 5e-160) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + ((z - t) / (a / y));
}
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 <= 5d-160) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + ((z - t) / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 5e-160) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + ((z - t) / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 5e-160: tmp = x + ((y * (z - t)) / a) else: tmp = x + ((z - t) / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 5e-160) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(Float64(z - t) / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 5e-160) tmp = x + ((y * (z - t)) / a); else tmp = x + ((z - t) / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 5e-160], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-160}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < 4.99999999999999994e-160Initial program 98.0%
if 4.99999999999999994e-160 < z Initial program 93.7%
clear-num93.6%
associate-/r*98.9%
Applied egg-rr98.9%
clear-num99.0%
Applied egg-rr99.0%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.25e-74) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.25e-74) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / (a / (z - 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 (y <= 1.25d-74) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / (a / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.25e-74) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.25e-74: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.25e-74) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 1.25e-74) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.25e-74], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-74}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if y < 1.25e-74Initial program 97.8%
if 1.25e-74 < y Initial program 92.4%
associate-/l*99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.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 96.2%
Taylor expanded in x around inf 39.2%
(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 2024095
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
: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)))