
(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 11 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 (* (/ a z) (/ t z))))
(if (<= z -4.6e+95)
(/ (* x y) (fma 0.5 t_1 -1.0))
(if (<= z 1.65e-117)
(* y (* z (* x (pow (- (* z z) (* a t)) -0.5))))
(* y (/ x (sqrt (- 1.0 t_1))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = (a / z) * (t / z);
double tmp;
if (z <= -4.6e+95) {
tmp = (x * y) / fma(0.5, t_1, -1.0);
} else if (z <= 1.65e-117) {
tmp = y * (z * (x * pow(((z * z) - (a * t)), -0.5)));
} else {
tmp = y * (x / sqrt((1.0 - t_1)));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(Float64(a / z) * Float64(t / z)) tmp = 0.0 if (z <= -4.6e+95) tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0)); elseif (z <= 1.65e-117) tmp = Float64(y * Float64(z * Float64(x * (Float64(Float64(z * z) - Float64(a * t)) ^ -0.5)))); else tmp = Float64(y * Float64(x / sqrt(Float64(1.0 - t_1)))); end return 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[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+95], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-117], N[(y * N[(z * N[(x * N[Power[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \frac{a}{z} \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+95}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-117}:\\
\;\;\;\;y \cdot \left(z \cdot \left(x \cdot {\left(z \cdot z - a \cdot t\right)}^{-0.5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\sqrt{1 - t_1}}\\
\end{array}
\end{array}
if z < -4.59999999999999994e95Initial program 38.6%
associate-/l*40.5%
Simplified40.5%
Taylor expanded in z around -inf 92.0%
fma-neg92.0%
unpow292.0%
times-frac97.0%
metadata-eval97.0%
Simplified97.0%
if -4.59999999999999994e95 < z < 1.65000000000000008e-117Initial program 80.3%
*-commutative80.3%
associate-*l*79.8%
associate-*r/84.0%
Simplified84.0%
div-inv83.9%
*-commutative83.9%
associate-*l*86.0%
pow1/286.0%
pow-flip86.0%
metadata-eval86.0%
Applied egg-rr86.0%
if 1.65000000000000008e-117 < z Initial program 58.0%
associate-/l*62.0%
Simplified62.0%
add-sqr-sqrt62.0%
sqrt-unprod62.0%
frac-times56.5%
add-sqr-sqrt56.5%
Applied egg-rr56.5%
div-sub56.5%
*-inverses94.9%
*-commutative94.9%
times-frac98.9%
Simplified98.9%
expm1-log1p-u78.2%
expm1-udef38.1%
associate-/l*38.1%
associate-*l/38.1%
Applied egg-rr38.1%
expm1-def78.1%
expm1-log1p98.7%
associate-/r/98.9%
*-commutative98.9%
associate-*r/98.9%
Simplified98.9%
Final simplification93.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+89)
(* x (- y))
(if (<= z 2.6e+21)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(/ (* x y) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+89) {
tmp = x * -y;
} else if (z <= 2.6e+21) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
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 <= (-6d+89)) then
tmp = x * -y
else if (z <= 2.6d+21) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
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 <= -6e+89) {
tmp = x * -y;
} else if (z <= 2.6e+21) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6e+89: tmp = x * -y elif z <= 2.6e+21: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+89) tmp = Float64(x * Float64(-y)); elseif (z <= 2.6e+21) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -6e+89)
tmp = x * -y;
elseif (z <= 2.6e+21)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
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, -6e+89], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.6e+21], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+89}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -6.00000000000000025e89Initial program 38.6%
*-commutative38.6%
associate-*l*35.2%
associate-*r/35.5%
Simplified35.5%
Taylor expanded in z around -inf 97.0%
neg-mul-197.0%
Simplified97.0%
if -6.00000000000000025e89 < z < 2.6e21Initial program 84.2%
*-commutative84.2%
associate-*l*82.8%
associate-*r/86.0%
Simplified86.0%
if 2.6e21 < z Initial program 41.2%
associate-/l*47.0%
Simplified47.0%
clear-num47.0%
associate-/r/47.0%
Applied egg-rr47.0%
Taylor expanded in z around inf 92.9%
*-commutative92.9%
unpow292.9%
times-frac98.7%
Simplified98.7%
Final simplification92.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 -8.6e+87)
(* x (- y))
(if (<= z 7.8e-117)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(* y (/ x (sqrt (- 1.0 (* (/ a z) (/ t z)))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+87) {
tmp = x * -y;
} else if (z <= 7.8e-117) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = y * (x / sqrt((1.0 - ((a / z) * (t / z)))));
}
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 <= (-8.6d+87)) then
tmp = x * -y
else if (z <= 7.8d-117) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = y * (x / sqrt((1.0d0 - ((a / z) * (t / z)))))
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 <= -8.6e+87) {
tmp = x * -y;
} else if (z <= 7.8e-117) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = y * (x / Math.sqrt((1.0 - ((a / z) * (t / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+87: tmp = x * -y elif z <= 7.8e-117: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = y * (x / math.sqrt((1.0 - ((a / z) * (t / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+87) tmp = Float64(x * Float64(-y)); elseif (z <= 7.8e-117) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(y * Float64(x / sqrt(Float64(1.0 - Float64(Float64(a / z) * Float64(t / z)))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -8.6e+87)
tmp = x * -y;
elseif (z <= 7.8e-117)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = y * (x / sqrt((1.0 - ((a / z) * (t / z)))));
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, -8.6e+87], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 7.8e-117], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[Sqrt[N[(1.0 - N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+87}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-117}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\sqrt{1 - \frac{a}{z} \cdot \frac{t}{z}}}\\
\end{array}
\end{array}
if z < -8.6000000000000002e87Initial program 38.6%
*-commutative38.6%
associate-*l*35.2%
associate-*r/35.5%
Simplified35.5%
Taylor expanded in z around -inf 97.0%
neg-mul-197.0%
Simplified97.0%
if -8.6000000000000002e87 < z < 7.79999999999999984e-117Initial program 80.3%
*-commutative80.3%
associate-*l*79.8%
associate-*r/84.0%
Simplified84.0%
if 7.79999999999999984e-117 < z Initial program 58.0%
associate-/l*62.0%
Simplified62.0%
add-sqr-sqrt62.0%
sqrt-unprod62.0%
frac-times56.5%
add-sqr-sqrt56.5%
Applied egg-rr56.5%
div-sub56.5%
*-inverses94.9%
*-commutative94.9%
times-frac98.9%
Simplified98.9%
expm1-log1p-u78.2%
expm1-udef38.1%
associate-/l*38.1%
associate-*l/38.1%
Applied egg-rr38.1%
expm1-def78.1%
expm1-log1p98.7%
associate-/r/98.9%
*-commutative98.9%
associate-*r/98.9%
Simplified98.9%
Final simplification92.9%
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 (* (/ a z) (/ t z))))
(if (<= z -2.5e+93)
(/ (* x y) (fma 0.5 t_1 -1.0))
(if (<= z 4.4e-116)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(* y (/ x (sqrt (- 1.0 t_1))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = (a / z) * (t / z);
double tmp;
if (z <= -2.5e+93) {
tmp = (x * y) / fma(0.5, t_1, -1.0);
} else if (z <= 4.4e-116) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = y * (x / sqrt((1.0 - t_1)));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(Float64(a / z) * Float64(t / z)) tmp = 0.0 if (z <= -2.5e+93) tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0)); elseif (z <= 4.4e-116) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(y * Float64(x / sqrt(Float64(1.0 - t_1)))); end return 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[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+93], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e-116], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \frac{a}{z} \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+93}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-116}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\sqrt{1 - t_1}}\\
\end{array}
\end{array}
if z < -2.5000000000000001e93Initial program 38.6%
associate-/l*40.5%
Simplified40.5%
Taylor expanded in z around -inf 92.0%
fma-neg92.0%
unpow292.0%
times-frac97.0%
metadata-eval97.0%
Simplified97.0%
if -2.5000000000000001e93 < z < 4.4000000000000002e-116Initial program 80.3%
*-commutative80.3%
associate-*l*79.8%
associate-*r/84.0%
Simplified84.0%
if 4.4000000000000002e-116 < z Initial program 58.0%
associate-/l*62.0%
Simplified62.0%
add-sqr-sqrt62.0%
sqrt-unprod62.0%
frac-times56.5%
add-sqr-sqrt56.5%
Applied egg-rr56.5%
div-sub56.5%
*-inverses94.9%
*-commutative94.9%
times-frac98.9%
Simplified98.9%
expm1-log1p-u78.2%
expm1-udef38.1%
associate-/l*38.1%
associate-*l/38.1%
Applied egg-rr38.1%
expm1-def78.1%
expm1-log1p98.7%
associate-/r/98.9%
*-commutative98.9%
associate-*r/98.9%
Simplified98.9%
Final simplification92.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.4)
(* x (- y))
(if (<= z 2.35e-152)
(* y (/ (* z x) (sqrt (* a (- t)))))
(/ (* x y) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.4) {
tmp = x * -y;
} else if (z <= 2.35e-152) {
tmp = y * ((z * x) / sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
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.4d0)) then
tmp = x * -y
else if (z <= 2.35d-152) then
tmp = y * ((z * x) / sqrt((a * -t)))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
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.4) {
tmp = x * -y;
} else if (z <= 2.35e-152) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -7.4: tmp = x * -y elif z <= 2.35e-152: tmp = y * ((z * x) / math.sqrt((a * -t))) else: tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.4) tmp = Float64(x * Float64(-y)); elseif (z <= 2.35e-152) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); 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.4)
tmp = x * -y;
elseif (z <= 2.35e-152)
tmp = y * ((z * x) / sqrt((a * -t)));
else
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
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.4], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.35e-152], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-152}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -7.4000000000000004Initial program 54.1%
*-commutative54.1%
associate-*l*48.1%
associate-*r/48.3%
Simplified48.3%
Taylor expanded in z around -inf 95.5%
neg-mul-195.5%
Simplified95.5%
if -7.4000000000000004 < z < 2.35000000000000006e-152Initial program 76.4%
*-commutative76.4%
associate-*l*80.1%
associate-*r/84.5%
Simplified84.5%
Taylor expanded in z around 0 78.6%
mul-1-neg78.6%
distribute-rgt-neg-out78.6%
Simplified78.6%
if 2.35000000000000006e-152 < z Initial program 58.1%
associate-/l*63.6%
Simplified63.6%
clear-num63.6%
associate-/r/63.5%
Applied egg-rr63.5%
Taylor expanded in z around inf 84.8%
*-commutative84.8%
unpow284.8%
times-frac88.6%
Simplified88.6%
Final simplification88.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 -1.5e-147) (* x (- y)) (if (<= z 1.1e+22) (* y (/ (* z x) (+ z (* -0.5 (/ (* a t) z))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e-147) {
tmp = x * -y;
} else if (z <= 1.1e+22) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
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.5d-147)) then
tmp = x * -y
else if (z <= 1.1d+22) then
tmp = y * ((z * x) / (z + ((-0.5d0) * ((a * t) / z))))
else
tmp = x * y
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.5e-147) {
tmp = x * -y;
} else if (z <= 1.1e+22) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.5e-147: tmp = x * -y elif z <= 1.1e+22: tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e-147) tmp = Float64(x * Float64(-y)); elseif (z <= 1.1e+22) tmp = Float64(y * Float64(Float64(z * x) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / z))))); else tmp = Float64(x * y); 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.5e-147)
tmp = x * -y;
elseif (z <= 1.1e+22)
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
else
tmp = x * y;
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.5e-147], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.1e+22], N[(y * N[(N[(z * x), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-147}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+22}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.5000000000000001e-147Initial program 60.8%
*-commutative60.8%
associate-*l*56.1%
associate-*r/57.3%
Simplified57.3%
Taylor expanded in z around -inf 82.7%
neg-mul-182.7%
Simplified82.7%
if -1.5000000000000001e-147 < z < 1.1e22Initial program 79.9%
*-commutative79.9%
associate-*l*81.4%
associate-*r/84.9%
Simplified84.9%
Taylor expanded in z around inf 50.1%
if 1.1e22 < z Initial program 41.2%
*-commutative41.2%
associate-*l*39.7%
associate-*r/45.3%
Simplified45.3%
Taylor expanded in z around inf 98.3%
Final simplification76.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -6.2e-147) (* x (- y)) (if (<= z 1.3e-152) (* -2.0 (* (/ y a) (/ (* x (* z z)) t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-147) {
tmp = x * -y;
} else if (z <= 1.3e-152) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = x * y;
}
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 <= (-6.2d-147)) then
tmp = x * -y
else if (z <= 1.3d-152) then
tmp = (-2.0d0) * ((y / a) * ((x * (z * z)) / t))
else
tmp = x * y
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 <= -6.2e-147) {
tmp = x * -y;
} else if (z <= 1.3e-152) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6.2e-147: tmp = x * -y elif z <= 1.3e-152: tmp = -2.0 * ((y / a) * ((x * (z * z)) / t)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e-147) tmp = Float64(x * Float64(-y)); elseif (z <= 1.3e-152) tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(Float64(x * Float64(z * z)) / t))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -6.2e-147)
tmp = x * -y;
elseif (z <= 1.3e-152)
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
else
tmp = x * y;
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, -6.2e-147], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.3e-152], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-147}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-152}:\\
\;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -6.2000000000000005e-147Initial program 60.8%
*-commutative60.8%
associate-*l*56.1%
associate-*r/57.3%
Simplified57.3%
Taylor expanded in z around -inf 82.7%
neg-mul-182.7%
Simplified82.7%
if -6.2000000000000005e-147 < z < 1.30000000000000006e-152Initial program 71.8%
associate-/l*73.3%
Simplified73.3%
clear-num73.2%
associate-/r/73.2%
Applied egg-rr73.2%
Taylor expanded in z around inf 32.8%
*-commutative32.8%
unpow232.8%
times-frac35.5%
Simplified35.5%
Taylor expanded in t around inf 33.1%
times-frac33.1%
unpow233.1%
Simplified33.1%
if 1.30000000000000006e-152 < z Initial program 58.1%
*-commutative58.1%
associate-*l*55.9%
associate-*r/60.4%
Simplified60.4%
Taylor expanded in z around inf 84.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 -4.8e-145) (* x (- y)) (if (<= z 2.2e-152) (* z (* -2.0 (* (/ z (/ t y)) (/ x a)))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-145) {
tmp = x * -y;
} else if (z <= 2.2e-152) {
tmp = z * (-2.0 * ((z / (t / y)) * (x / a)));
} else {
tmp = x * y;
}
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 <= (-4.8d-145)) then
tmp = x * -y
else if (z <= 2.2d-152) then
tmp = z * ((-2.0d0) * ((z / (t / y)) * (x / a)))
else
tmp = x * y
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 <= -4.8e-145) {
tmp = x * -y;
} else if (z <= 2.2e-152) {
tmp = z * (-2.0 * ((z / (t / y)) * (x / a)));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.8e-145: tmp = x * -y elif z <= 2.2e-152: tmp = z * (-2.0 * ((z / (t / y)) * (x / a))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e-145) tmp = Float64(x * Float64(-y)); elseif (z <= 2.2e-152) tmp = Float64(z * Float64(-2.0 * Float64(Float64(z / Float64(t / y)) * Float64(x / a)))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.8e-145)
tmp = x * -y;
elseif (z <= 2.2e-152)
tmp = z * (-2.0 * ((z / (t / y)) * (x / a)));
else
tmp = x * y;
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, -4.8e-145], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.2e-152], N[(z * N[(-2.0 * N[(N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-145}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-152}:\\
\;\;\;\;z \cdot \left(-2 \cdot \left(\frac{z}{\frac{t}{y}} \cdot \frac{x}{a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.8000000000000003e-145Initial program 60.8%
*-commutative60.8%
associate-*l*56.1%
associate-*r/57.3%
Simplified57.3%
Taylor expanded in z around -inf 82.7%
neg-mul-182.7%
Simplified82.7%
if -4.8000000000000003e-145 < z < 2.19999999999999985e-152Initial program 71.8%
associate-*l/75.4%
Simplified75.4%
Taylor expanded in z around inf 35.9%
Taylor expanded in z around 0 35.5%
associate-*r*35.6%
*-commutative35.6%
times-frac33.6%
*-commutative33.6%
associate-/l*33.5%
Simplified33.5%
if 2.19999999999999985e-152 < z Initial program 58.1%
*-commutative58.1%
associate-*l*55.9%
associate-*r/60.4%
Simplified60.4%
Taylor expanded in z around inf 84.3%
Final simplification74.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 -1.55e-146) (* x (- y)) (/ (* x y) (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-146) {
tmp = x * -y;
} else {
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
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.55d-146)) then
tmp = x * -y
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
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.55e-146) {
tmp = x * -y;
} else {
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.55e-146: tmp = x * -y else: tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e-146) tmp = Float64(x * Float64(-y)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); 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.55e-146)
tmp = x * -y;
else
tmp = (x * y) / (1.0 + (-0.5 * ((a / z) * (t / z))));
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.55e-146], N[(x * (-y)), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-146}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -1.5499999999999999e-146Initial program 60.8%
*-commutative60.8%
associate-*l*56.1%
associate-*r/57.3%
Simplified57.3%
Taylor expanded in z around -inf 82.7%
neg-mul-182.7%
Simplified82.7%
if -1.5499999999999999e-146 < z Initial program 62.1%
associate-/l*66.4%
Simplified66.4%
clear-num66.4%
associate-/r/66.4%
Applied egg-rr66.4%
Taylor expanded in z around inf 69.6%
*-commutative69.6%
unpow269.6%
times-frac73.0%
Simplified73.0%
Final simplification77.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.75e-304) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-304) {
tmp = x * -y;
} else {
tmp = x * y;
}
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.75d-304)) then
tmp = x * -y
else
tmp = x * y
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.75e-304) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.75e-304: tmp = x * -y else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e-304) tmp = Float64(x * Float64(-y)); else tmp = Float64(x * y); 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.75e-304)
tmp = x * -y;
else
tmp = x * y;
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.75e-304], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-304}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.75e-304Initial program 63.9%
*-commutative63.9%
associate-*l*59.7%
associate-*r/60.8%
Simplified60.8%
Taylor expanded in z around -inf 70.7%
neg-mul-170.7%
Simplified70.7%
if -1.75e-304 < z Initial program 59.3%
*-commutative59.3%
associate-*l*59.7%
associate-*r/64.9%
Simplified64.9%
Taylor expanded in z around inf 73.4%
Final simplification72.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
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 = x * y
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return x * y
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(x * y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Initial program 61.6%
*-commutative61.6%
associate-*l*59.7%
associate-*r/62.8%
Simplified62.8%
Taylor expanded in z around inf 45.9%
Final simplification45.9%
(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 2023242
(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)))))