
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * 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) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot 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) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * 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) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* t a)))))
(if (<= z -1.3e+88)
(* y (- x))
(if (<= z -1.45e-222)
(* z (/ (* y x) t_1))
(if (<= z 3.1e-240)
(/ x (/ (sqrt (* t (- a))) (* z y)))
(if (<= z 2.55e+29)
(* y (/ (* z x) t_1))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -1.3e+88) {
tmp = y * -x;
} else if (z <= -1.45e-222) {
tmp = z * ((y * x) / t_1);
} else if (z <= 3.1e-240) {
tmp = x / (sqrt((t * -a)) / (z * y));
} else if (z <= 2.55e+29) {
tmp = y * ((z * x) / t_1);
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = sqrt(((z * z) - (t * a)))
if (z <= (-1.3d+88)) then
tmp = y * -x
else if (z <= (-1.45d-222)) then
tmp = z * ((y * x) / t_1)
else if (z <= 3.1d-240) then
tmp = x / (sqrt((t * -a)) / (z * y))
else if (z <= 2.55d+29) then
tmp = y * ((z * x) / t_1)
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -1.3e+88) {
tmp = y * -x;
} else if (z <= -1.45e-222) {
tmp = z * ((y * x) / t_1);
} else if (z <= 3.1e-240) {
tmp = x / (Math.sqrt((t * -a)) / (z * y));
} else if (z <= 2.55e+29) {
tmp = y * ((z * x) / t_1);
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (t * a))) tmp = 0 if z <= -1.3e+88: tmp = y * -x elif z <= -1.45e-222: tmp = z * ((y * x) / t_1) elif z <= 3.1e-240: tmp = x / (math.sqrt((t * -a)) / (z * y)) elif z <= 2.55e+29: tmp = y * ((z * x) / t_1) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a))) tmp = 0.0 if (z <= -1.3e+88) tmp = Float64(y * Float64(-x)); elseif (z <= -1.45e-222) tmp = Float64(z * Float64(Float64(y * x) / t_1)); elseif (z <= 3.1e-240) tmp = Float64(x / Float64(sqrt(Float64(t * Float64(-a))) / Float64(z * y))); elseif (z <= 2.55e+29) tmp = Float64(y * Float64(Float64(z * x) / t_1)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (t * a)));
tmp = 0.0;
if (z <= -1.3e+88)
tmp = y * -x;
elseif (z <= -1.45e-222)
tmp = z * ((y * x) / t_1);
elseif (z <= 3.1e-240)
tmp = x / (sqrt((t * -a)) / (z * y));
elseif (z <= 2.55e+29)
tmp = y * ((z * x) / t_1);
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.3e+88], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -1.45e-222], N[(z * N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e-240], N[(x / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e+29], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+88}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-222}:\\
\;\;\;\;z \cdot \frac{y \cdot x}{t_1}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-240}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{t \cdot \left(-a\right)}}{z \cdot y}}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -1.3e88Initial program 37.8%
*-commutative37.8%
associate-*l*37.2%
associate-*r/39.1%
Simplified39.1%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.3e88 < z < -1.4500000000000001e-222Initial program 83.7%
associate-*l/87.5%
Simplified87.5%
if -1.4500000000000001e-222 < z < 3.10000000000000017e-240Initial program 64.8%
*-commutative64.8%
associate-*l*70.8%
associate-*r/70.8%
Simplified70.8%
*-commutative70.8%
associate-/l*66.2%
associate-/r/70.9%
associate-/l/80.1%
*-commutative80.1%
Applied egg-rr80.1%
Taylor expanded in z around 0 80.1%
associate-*r*80.1%
neg-mul-180.1%
Simplified80.1%
if 3.10000000000000017e-240 < z < 2.55e29Initial program 78.2%
*-commutative78.2%
associate-*l*82.8%
associate-*r/86.9%
Simplified86.9%
if 2.55e29 < z Initial program 52.5%
associate-/l*55.6%
Simplified55.6%
Taylor expanded in z around inf 91.2%
unpow291.2%
associate-/l*96.6%
Simplified96.6%
Final simplification91.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (* z (/ x (sqrt (- (* z z) (* t a))))))))
(if (<= z -2e+88)
(* y (- x))
(if (<= z -9.6e-67)
t_1
(if (<= z -2.7e-95)
(/ (* y x) (/ (- (* 0.5 (/ (* t a) z)) z) z))
(if (<= z -1.5e-106)
(/ x (/ (sqrt (* t (- a))) (* z y)))
(if (<= z 2.6e+119) t_1 (* y x))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z * (x / sqrt(((z * z) - (t * a)))));
double tmp;
if (z <= -2e+88) {
tmp = y * -x;
} else if (z <= -9.6e-67) {
tmp = t_1;
} else if (z <= -2.7e-95) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else if (z <= -1.5e-106) {
tmp = x / (sqrt((t * -a)) / (z * y));
} else if (z <= 2.6e+119) {
tmp = t_1;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (x / sqrt(((z * z) - (t * a)))))
if (z <= (-2d+88)) then
tmp = y * -x
else if (z <= (-9.6d-67)) then
tmp = t_1
else if (z <= (-2.7d-95)) then
tmp = (y * x) / (((0.5d0 * ((t * a) / z)) - z) / z)
else if (z <= (-1.5d-106)) then
tmp = x / (sqrt((t * -a)) / (z * y))
else if (z <= 2.6d+119) then
tmp = t_1
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z * (x / Math.sqrt(((z * z) - (t * a)))));
double tmp;
if (z <= -2e+88) {
tmp = y * -x;
} else if (z <= -9.6e-67) {
tmp = t_1;
} else if (z <= -2.7e-95) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else if (z <= -1.5e-106) {
tmp = x / (Math.sqrt((t * -a)) / (z * y));
} else if (z <= 2.6e+119) {
tmp = t_1;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = y * (z * (x / math.sqrt(((z * z) - (t * a))))) tmp = 0 if z <= -2e+88: tmp = y * -x elif z <= -9.6e-67: tmp = t_1 elif z <= -2.7e-95: tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z) elif z <= -1.5e-106: tmp = x / (math.sqrt((t * -a)) / (z * y)) elif z <= 2.6e+119: tmp = t_1 else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(z * Float64(x / sqrt(Float64(Float64(z * z) - Float64(t * a)))))) tmp = 0.0 if (z <= -2e+88) tmp = Float64(y * Float64(-x)); elseif (z <= -9.6e-67) tmp = t_1; elseif (z <= -2.7e-95) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(0.5 * Float64(Float64(t * a) / z)) - z) / z)); elseif (z <= -1.5e-106) tmp = Float64(x / Float64(sqrt(Float64(t * Float64(-a))) / Float64(z * y))); elseif (z <= 2.6e+119) tmp = t_1; else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (z * (x / sqrt(((z * z) - (t * a)))));
tmp = 0.0;
if (z <= -2e+88)
tmp = y * -x;
elseif (z <= -9.6e-67)
tmp = t_1;
elseif (z <= -2.7e-95)
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
elseif (z <= -1.5e-106)
tmp = x / (sqrt((t * -a)) / (z * y));
elseif (z <= 2.6e+119)
tmp = t_1;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z * N[(x / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+88], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -9.6e-67], t$95$1, If[LessEqual[z, -2.7e-95], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.5e-106], N[(x / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+119], t$95$1, N[(y * x), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot \frac{x}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+88}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-95}:\\
\;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot \frac{t \cdot a}{z} - z}{z}}\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-106}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{t \cdot \left(-a\right)}}{z \cdot y}}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+119}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.99999999999999992e88Initial program 37.8%
*-commutative37.8%
associate-*l*37.2%
associate-*r/39.1%
Simplified39.1%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.99999999999999992e88 < z < -9.6e-67 or -1.50000000000000009e-106 < z < 2.6e119Initial program 80.4%
*-commutative80.4%
associate-*l*81.8%
associate-*r/84.5%
Simplified84.5%
associate-/l*86.7%
associate-/r/86.7%
Applied egg-rr86.7%
if -9.6e-67 < z < -2.7e-95Initial program 78.5%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in z around -inf 78.8%
if -2.7e-95 < z < -1.50000000000000009e-106Initial program 99.5%
*-commutative99.5%
associate-*l*70.1%
associate-*r/70.1%
Simplified70.1%
*-commutative70.1%
associate-/l*70.1%
associate-/r/99.5%
associate-/l/99.5%
*-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 99.5%
associate-*r*99.5%
neg-mul-199.5%
Simplified99.5%
if 2.6e119 < z Initial program 36.2%
*-commutative36.2%
associate-*l*35.6%
associate-*r/35.9%
Simplified35.9%
Taylor expanded in z around inf 97.0%
Final simplification91.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.4e+98)
(* y (- x))
(if (<= z 3e+30)
(* y (/ (* z x) (sqrt (- (* z z) (* t a)))))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e+98) {
tmp = y * -x;
} else if (z <= 3e+30) {
tmp = y * ((z * x) / sqrt(((z * z) - (t * a))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.4d+98)) then
tmp = y * -x
else if (z <= 3d+30) then
tmp = y * ((z * x) / sqrt(((z * z) - (t * a))))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e+98) {
tmp = y * -x;
} else if (z <= 3e+30) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (t * a))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.4e+98: tmp = y * -x elif z <= 3e+30: tmp = y * ((z * x) / math.sqrt(((z * z) - (t * a)))) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.4e+98) tmp = Float64(y * Float64(-x)); elseif (z <= 3e+30) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(t * a))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.4e+98)
tmp = y * -x;
elseif (z <= 3e+30)
tmp = y * ((z * x) / sqrt(((z * z) - (t * a))));
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.4e+98], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3e+30], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+98}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -3.39999999999999972e98Initial program 33.8%
*-commutative33.8%
associate-*l*33.2%
associate-*r/35.2%
Simplified35.2%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -3.39999999999999972e98 < z < 2.99999999999999978e30Initial program 79.7%
*-commutative79.7%
associate-*l*81.8%
associate-*r/83.8%
Simplified83.8%
if 2.99999999999999978e30 < z Initial program 52.5%
associate-/l*55.6%
Simplified55.6%
Taylor expanded in z around inf 91.2%
unpow291.2%
associate-/l*96.6%
Simplified96.6%
Final simplification90.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.2e+105)
(* y (- x))
(if (<= z 2.5e+30)
(/ x (/ (sqrt (- (* z z) (* t a))) (* z y)))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+105) {
tmp = y * -x;
} else if (z <= 2.5e+30) {
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-2.2d+105)) then
tmp = y * -x
else if (z <= 2.5d+30) then
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+105) {
tmp = y * -x;
} else if (z <= 2.5e+30) {
tmp = x / (Math.sqrt(((z * z) - (t * a))) / (z * y));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.2e+105: tmp = y * -x elif z <= 2.5e+30: tmp = x / (math.sqrt(((z * z) - (t * a))) / (z * y)) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e+105) tmp = Float64(y * Float64(-x)); elseif (z <= 2.5e+30) tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(t * a))) / Float64(z * y))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.2e+105)
tmp = y * -x;
elseif (z <= 2.5e+30)
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y));
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e+105], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.5e+30], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+105}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -2.20000000000000007e105Initial program 32.3%
*-commutative32.3%
associate-*l*31.8%
associate-*r/33.8%
Simplified33.8%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -2.20000000000000007e105 < z < 2.4999999999999999e30Initial program 79.8%
*-commutative79.8%
associate-*l*81.9%
associate-*r/83.9%
Simplified83.9%
*-commutative83.9%
associate-/l*84.4%
associate-/r/85.2%
associate-/l/84.4%
*-commutative84.4%
Applied egg-rr84.4%
if 2.4999999999999999e30 < z Initial program 52.5%
associate-/l*55.6%
Simplified55.6%
Taylor expanded in z around inf 91.2%
unpow291.2%
associate-/l*96.6%
Simplified96.6%
Final simplification90.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.7e-148)
(/ (* y x) (/ (- (* 0.5 (/ (* t a) z)) z) z))
(if (<= z 5.5e-132)
(* y (* z (/ x (sqrt (* t (- a))))))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.7e-148) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else if (z <= 5.5e-132) {
tmp = y * (z * (x / sqrt((t * -a))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-5.7d-148)) then
tmp = (y * x) / (((0.5d0 * ((t * a) / z)) - z) / z)
else if (z <= 5.5d-132) then
tmp = y * (z * (x / sqrt((t * -a))))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.7e-148) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else if (z <= 5.5e-132) {
tmp = y * (z * (x / Math.sqrt((t * -a))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5.7e-148: tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z) elif z <= 5.5e-132: tmp = y * (z * (x / math.sqrt((t * -a)))) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.7e-148) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(0.5 * Float64(Float64(t * a) / z)) - z) / z)); elseif (z <= 5.5e-132) tmp = Float64(y * Float64(z * Float64(x / sqrt(Float64(t * Float64(-a)))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.7e-148)
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
elseif (z <= 5.5e-132)
tmp = y * (z * (x / sqrt((t * -a))));
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.7e-148], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-132], N[(y * N[(z * N[(x / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{-148}:\\
\;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot \frac{t \cdot a}{z} - z}{z}}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-132}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{x}{\sqrt{t \cdot \left(-a\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -5.6999999999999999e-148Initial program 61.8%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in z around -inf 84.6%
if -5.6999999999999999e-148 < z < 5.4999999999999999e-132Initial program 69.2%
*-commutative69.2%
associate-*l*74.4%
associate-*r/76.0%
Simplified76.0%
associate-/l*73.6%
associate-/r/74.6%
Applied egg-rr74.6%
Taylor expanded in z around 0 74.5%
associate-*r*75.1%
neg-mul-175.1%
Simplified74.5%
if 5.4999999999999999e-132 < z Initial program 63.5%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in z around inf 87.7%
unpow287.7%
associate-/l*91.5%
Simplified91.5%
Final simplification84.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -9.5e-148)
(/ (* y x) (/ (- (* 0.5 (/ (* t a) z)) z) z))
(if (<= z 2.9e-131)
(/ x (/ (sqrt (* t (- a))) (* z y)))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-148) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else if (z <= 2.9e-131) {
tmp = x / (sqrt((t * -a)) / (z * y));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-9.5d-148)) then
tmp = (y * x) / (((0.5d0 * ((t * a) / z)) - z) / z)
else if (z <= 2.9d-131) then
tmp = x / (sqrt((t * -a)) / (z * y))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-148) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else if (z <= 2.9e-131) {
tmp = x / (Math.sqrt((t * -a)) / (z * y));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -9.5e-148: tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z) elif z <= 2.9e-131: tmp = x / (math.sqrt((t * -a)) / (z * y)) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-148) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(0.5 * Float64(Float64(t * a) / z)) - z) / z)); elseif (z <= 2.9e-131) tmp = Float64(x / Float64(sqrt(Float64(t * Float64(-a))) / Float64(z * y))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -9.5e-148)
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
elseif (z <= 2.9e-131)
tmp = x / (sqrt((t * -a)) / (z * y));
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-148], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-131], N[(x / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-148}:\\
\;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot \frac{t \cdot a}{z} - z}{z}}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{t \cdot \left(-a\right)}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -9.50000000000000069e-148Initial program 61.8%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in z around -inf 84.6%
if -9.50000000000000069e-148 < z < 2.9000000000000002e-131Initial program 69.2%
*-commutative69.2%
associate-*l*74.4%
associate-*r/76.0%
Simplified76.0%
*-commutative76.0%
associate-/l*73.6%
associate-/r/74.3%
associate-/l/75.2%
*-commutative75.2%
Applied egg-rr75.2%
Taylor expanded in z around 0 75.1%
associate-*r*75.1%
neg-mul-175.1%
Simplified75.1%
if 2.9000000000000002e-131 < z Initial program 63.5%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in z around inf 87.7%
unpow287.7%
associate-/l*91.5%
Simplified91.5%
Final simplification84.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.8e-175)
(* y (- x))
(if (<= z 1.25e+30)
(* y (/ (* z x) (+ z (* -0.5 (/ (* t a) z)))))
(* y x))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e-175) {
tmp = y * -x;
} else if (z <= 1.25e+30) {
tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-7.8d-175)) then
tmp = y * -x
else if (z <= 1.25d+30) then
tmp = y * ((z * x) / (z + ((-0.5d0) * ((t * a) / z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e-175) {
tmp = y * -x;
} else if (z <= 1.25e+30) {
tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -7.8e-175: tmp = y * -x elif z <= 1.25e+30: tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.8e-175) tmp = Float64(y * Float64(-x)); elseif (z <= 1.25e+30) tmp = Float64(y * Float64(Float64(z * x) / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -7.8e-175)
tmp = y * -x;
elseif (z <= 1.25e+30)
tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.8e-175], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.25e+30], N[(y * N[(N[(z * x), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-175}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -7.79999999999999997e-175Initial program 62.4%
*-commutative62.4%
associate-*l*61.9%
associate-*r/63.7%
Simplified63.7%
Taylor expanded in z around -inf 79.8%
neg-mul-179.8%
Simplified79.8%
if -7.79999999999999997e-175 < z < 1.25e30Initial program 76.8%
*-commutative76.8%
associate-*l*81.1%
associate-*r/83.5%
Simplified83.5%
Taylor expanded in z around inf 49.2%
if 1.25e30 < z Initial program 52.5%
*-commutative52.5%
associate-*l*49.1%
associate-*r/50.8%
Simplified50.8%
Taylor expanded in z around inf 96.6%
Final simplification75.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.05e-174) (* y (- x)) (/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-174) {
tmp = y * -x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.05d-174)) then
tmp = y * -x
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-174) {
tmp = y * -x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-174: tmp = y * -x else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-174) tmp = Float64(y * Float64(-x)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.05e-174)
tmp = y * -x;
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-174], N[(y * (-x)), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-174}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -1.05000000000000005e-174Initial program 62.4%
*-commutative62.4%
associate-*l*61.9%
associate-*r/63.7%
Simplified63.7%
Taylor expanded in z around -inf 79.8%
neg-mul-179.8%
Simplified79.8%
if -1.05000000000000005e-174 < z Initial program 65.5%
associate-/l*67.8%
Simplified67.8%
Taylor expanded in z around inf 67.0%
unpow267.0%
associate-/l*69.7%
Simplified69.7%
Final simplification74.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 3.3e-237) (/ (* y x) (/ (- (* 0.5 (/ (* t a) z)) z) z)) (* y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 3.3e-237) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.3d-237) then
tmp = (y * x) / (((0.5d0 * ((t * a) / z)) - z) / z)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 3.3e-237) {
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= 3.3e-237: tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 3.3e-237) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(0.5 * Float64(Float64(t * a) / z)) - z) / z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 3.3e-237)
tmp = (y * x) / (((0.5 * ((t * a) / z)) - z) / z);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 3.3e-237], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.3 \cdot 10^{-237}:\\
\;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot \frac{t \cdot a}{z} - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < 3.3000000000000001e-237Initial program 65.4%
associate-/l*66.8%
Simplified66.8%
Taylor expanded in z around -inf 72.2%
if 3.3000000000000001e-237 < z Initial program 62.5%
*-commutative62.5%
associate-*l*62.4%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 78.3%
Final simplification74.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5e-69) (* y (- x)) (if (<= z 2.1e-254) (/ (* z (* y x)) (- z)) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-69) {
tmp = y * -x;
} else if (z <= 2.1e-254) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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-69)) then
tmp = y * -x
else if (z <= 2.1d-254) then
tmp = (z * (y * x)) / -z
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-69) {
tmp = y * -x;
} else if (z <= 2.1e-254) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5e-69: tmp = y * -x elif z <= 2.1e-254: tmp = (z * (y * x)) / -z else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e-69) tmp = Float64(y * Float64(-x)); elseif (z <= 2.1e-254) tmp = Float64(Float64(z * Float64(y * x)) / Float64(-z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5e-69)
tmp = y * -x;
elseif (z <= 2.1e-254)
tmp = (z * (y * x)) / -z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-69], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.1e-254], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-69}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-254}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -5.00000000000000033e-69Initial program 57.5%
*-commutative57.5%
associate-*l*59.0%
associate-*r/61.0%
Simplified61.0%
Taylor expanded in z around -inf 88.2%
neg-mul-188.2%
Simplified88.2%
if -5.00000000000000033e-69 < z < 2.09999999999999997e-254Initial program 75.7%
Taylor expanded in z around -inf 48.9%
neg-mul-148.9%
Simplified48.9%
if 2.09999999999999997e-254 < z Initial program 63.5%
*-commutative63.5%
associate-*l*62.5%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 76.3%
Final simplification74.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.7e-186) (* y (- x)) (if (<= z 5e-125) (/ (* z (* y x)) z) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e-186) {
tmp = y * -x;
} else if (z <= 5e-125) {
tmp = (z * (y * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.7d-186)) then
tmp = y * -x
else if (z <= 5d-125) then
tmp = (z * (y * x)) / z
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e-186) {
tmp = y * -x;
} else if (z <= 5e-125) {
tmp = (z * (y * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.7e-186: tmp = y * -x elif z <= 5e-125: tmp = (z * (y * x)) / z else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e-186) tmp = Float64(y * Float64(-x)); elseif (z <= 5e-125) tmp = Float64(Float64(z * Float64(y * x)) / z); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.7e-186)
tmp = y * -x;
elseif (z <= 5e-125)
tmp = (z * (y * x)) / z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e-186], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5e-125], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-186}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-125}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.7e-186Initial program 63.6%
*-commutative63.6%
associate-*l*63.2%
associate-*r/64.9%
Simplified64.9%
Taylor expanded in z around -inf 78.1%
neg-mul-178.1%
Simplified78.1%
if -1.7e-186 < z < 4.99999999999999967e-125Initial program 69.8%
Taylor expanded in z around inf 38.9%
if 4.99999999999999967e-125 < z Initial program 61.4%
*-commutative61.4%
associate-*l*58.0%
associate-*r/60.3%
Simplified60.3%
Taylor expanded in z around inf 89.9%
Final simplification74.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2e-310) (* y (- x)) (* y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-310) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-2d-310)) then
tmp = y * -x
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-310) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2e-310: tmp = y * -x else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-310) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e-310)
tmp = y * -x;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-310], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 64.9%
*-commutative64.9%
associate-*l*64.7%
associate-*r/66.2%
Simplified66.2%
Taylor expanded in z around -inf 71.0%
neg-mul-171.0%
Simplified71.0%
if -1.999999999999994e-310 < z Initial program 63.3%
*-commutative63.3%
associate-*l*63.9%
associate-*r/66.3%
Simplified66.3%
Taylor expanded in z around inf 72.1%
Final simplification71.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y x))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return y * x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = y * x
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return y * x
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(y * x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = y * x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot x
\end{array}
Initial program 64.1%
*-commutative64.1%
associate-*l*64.3%
associate-*r/66.2%
Simplified66.2%
Taylor expanded in z around inf 42.5%
Final simplification42.5%
(FPCore (x y z t a)
:precision binary64
(if (< z -3.1921305903852764e+46)
(- (* y x))
(if (< z 5.976268120920894e+90)
(/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
(* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * 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 (z < (-3.1921305903852764d+46)) then
tmp = -(y * x)
else if (z < 5.976268120920894d+90) then
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
else
tmp = y * x
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.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z < -3.1921305903852764e+46: tmp = -(y * x) elif z < 5.976268120920894e+90: tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z < -3.1921305903852764e+46) tmp = Float64(-Float64(y * x)); elseif (z < 5.976268120920894e+90) tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z < -3.1921305903852764e+46) tmp = -(y * x); elseif (z < 5.976268120920894e+90) tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
herbie shell --seed 2023230
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))