
(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 16 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
(if (<= z -2e+129)
(* y (/ x (fma 0.5 (* (/ a z) (/ t z)) -1.0)))
(if (<= z 6e-88)
(* y (/ x (/ (sqrt (- (* z z) (* a t))) z)))
(/ (* y x) (sqrt (- 1.0 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+129) {
tmp = y * (x / fma(0.5, ((a / z) * (t / z)), -1.0));
} else if (z <= 6e-88) {
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
} else {
tmp = (y * x) / sqrt((1.0 - (a / ((z * z) / t))));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+129) tmp = Float64(y * Float64(x / fma(0.5, Float64(Float64(a / z) * Float64(t / z)), -1.0))); elseif (z <= 6e-88) tmp = Float64(y * Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z))); else tmp = Float64(Float64(y * x) / sqrt(Float64(1.0 - Float64(a / Float64(Float64(z * z) / t))))); end return 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+129], N[(y * N[(x / N[(0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-88], N[(y * N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[Sqrt[N[(1.0 - 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 \cdot 10^{+129}:\\
\;\;\;\;y \cdot \frac{x}{\mathsf{fma}\left(0.5, \frac{a}{z} \cdot \frac{t}{z}, -1\right)}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-88}:\\
\;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}\\
\end{array}
\end{array}
if z < -2e129Initial program 23.7%
*-commutative23.7%
associate-*l*23.6%
associate-*r/26.2%
Simplified26.2%
associate-/l*26.7%
add-cube-cbrt26.6%
*-un-lft-identity26.6%
times-frac26.6%
pow226.6%
Applied egg-rr26.6%
/-rgt-identity26.6%
associate-*r/26.6%
unpow226.6%
rem-3cbrt-lft26.7%
*-commutative26.7%
Simplified26.7%
Taylor expanded in z around -inf 81.8%
fma-neg81.8%
unpow281.8%
times-frac94.9%
metadata-eval94.9%
Simplified94.9%
if -2e129 < z < 5.9999999999999999e-88Initial program 83.2%
*-commutative83.2%
associate-*l*83.0%
associate-*r/86.8%
Simplified86.8%
associate-/l*86.4%
add-cube-cbrt85.4%
*-un-lft-identity85.4%
times-frac85.5%
pow285.5%
Applied egg-rr85.5%
/-rgt-identity85.5%
associate-*r/85.4%
unpow285.4%
rem-3cbrt-lft86.4%
*-commutative86.4%
Simplified86.4%
if 5.9999999999999999e-88 < z Initial program 58.6%
associate-/l*61.9%
Simplified61.9%
add-sqr-sqrt61.9%
sqrt-unprod61.9%
frac-times52.3%
add-sqr-sqrt52.3%
Applied egg-rr52.3%
div-sub52.3%
*-inverses89.5%
*-commutative89.5%
associate-/l*95.8%
Simplified95.8%
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 -5e+153)
(* y (- x))
(if (<= z 3e+74)
(* y (/ x (/ (sqrt (- (* z z) (* a t))) z)))
(/ (* y x) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+153) {
tmp = y * -x;
} else if (z <= 3e+74) {
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
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+153)) then
tmp = y * -x
else if (z <= 3d+74) then
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z))
else
tmp = (y * x) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
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+153) {
tmp = y * -x;
} else if (z <= 3e+74) {
tmp = y * (x / (Math.sqrt(((z * z) - (a * t))) / z));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5e+153: tmp = y * -x elif z <= 3e+74: tmp = y * (x / (math.sqrt(((z * z) - (a * t))) / z)) else: tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+153) tmp = Float64(y * Float64(-x)); elseif (z <= 3e+74) tmp = Float64(y * Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); 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+153)
tmp = y * -x;
elseif (z <= 3e+74)
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
else
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
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+153], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3e+74], N[(y * N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+153}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -5.00000000000000018e153Initial program 12.5%
*-commutative12.5%
associate-*l*12.4%
associate-*r/12.5%
Simplified12.5%
Taylor expanded in z around -inf 95.6%
neg-mul-195.6%
Simplified95.6%
if -5.00000000000000018e153 < z < 3e74Initial program 83.1%
*-commutative83.1%
associate-*l*83.0%
associate-*r/87.5%
Simplified87.5%
associate-/l*87.3%
add-cube-cbrt86.3%
*-un-lft-identity86.3%
times-frac86.4%
pow286.4%
Applied egg-rr86.4%
/-rgt-identity86.4%
associate-*r/86.3%
unpow286.3%
rem-3cbrt-lft87.3%
*-commutative87.3%
Simplified87.3%
if 3e74 < z Initial program 45.0%
associate-/l*46.8%
Simplified46.8%
Taylor expanded in z around inf 88.7%
unpow288.7%
associate-/l*97.0%
Simplified97.0%
Final simplification90.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 -1e+154)
(* y (- x))
(if (<= z 2.85e+76)
(* y (/ x (/ (sqrt (- (* z z) (* a t))) z)))
(* y (/ x (fma -0.5 (* (/ a z) (/ t z)) 1.0))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+154) {
tmp = y * -x;
} else if (z <= 2.85e+76) {
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
} else {
tmp = y * (x / fma(-0.5, ((a / z) * (t / z)), 1.0));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+154) tmp = Float64(y * Float64(-x)); elseif (z <= 2.85e+76) tmp = Float64(y * Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z))); else tmp = Float64(y * Float64(x / fma(-0.5, Float64(Float64(a / z) * Float64(t / z)), 1.0))); end return 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, -1e+154], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.85e+76], N[(y * N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+76}:\\
\;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\mathsf{fma}\left(-0.5, \frac{a}{z} \cdot \frac{t}{z}, 1\right)}\\
\end{array}
\end{array}
if z < -1.00000000000000004e154Initial program 12.5%
*-commutative12.5%
associate-*l*12.4%
associate-*r/12.5%
Simplified12.5%
Taylor expanded in z around -inf 95.6%
neg-mul-195.6%
Simplified95.6%
if -1.00000000000000004e154 < z < 2.85000000000000002e76Initial program 83.1%
*-commutative83.1%
associate-*l*83.0%
associate-*r/87.5%
Simplified87.5%
associate-/l*87.3%
add-cube-cbrt86.3%
*-un-lft-identity86.3%
times-frac86.4%
pow286.4%
Applied egg-rr86.4%
/-rgt-identity86.4%
associate-*r/86.3%
unpow286.3%
rem-3cbrt-lft87.3%
*-commutative87.3%
Simplified87.3%
if 2.85000000000000002e76 < z Initial program 45.0%
*-commutative45.0%
associate-*l*43.3%
associate-*r/43.6%
Simplified43.6%
associate-/l*47.0%
add-cube-cbrt46.6%
*-un-lft-identity46.6%
times-frac46.6%
pow246.6%
Applied egg-rr46.6%
/-rgt-identity46.6%
associate-*r/46.6%
unpow246.6%
rem-3cbrt-lft47.0%
*-commutative47.0%
Simplified47.0%
Taylor expanded in z around inf 88.7%
+-commutative88.7%
fma-def88.7%
unpow288.7%
times-frac97.0%
Simplified97.0%
Final simplification90.7%
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 -2e+129)
(* y (/ x (fma 0.5 t_1 -1.0)))
(if (<= z 4e+74)
(* y (/ x (/ (sqrt (- (* z z) (* a t))) z)))
(* y (/ x (fma -0.5 t_1 1.0)))))))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 <= -2e+129) {
tmp = y * (x / fma(0.5, t_1, -1.0));
} else if (z <= 4e+74) {
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
} else {
tmp = y * (x / fma(-0.5, t_1, 1.0));
}
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 <= -2e+129) tmp = Float64(y * Float64(x / fma(0.5, t_1, -1.0))); elseif (z <= 4e+74) tmp = Float64(y * Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z))); else tmp = Float64(y * Float64(x / fma(-0.5, t_1, 1.0))); 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, -2e+129], N[(y * N[(x / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+74], N[(y * N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(-0.5 * t$95$1 + 1.0), $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 \cdot 10^{+129}:\\
\;\;\;\;y \cdot \frac{x}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\mathsf{fma}\left(-0.5, t_1, 1\right)}\\
\end{array}
\end{array}
if z < -2e129Initial program 23.7%
*-commutative23.7%
associate-*l*23.6%
associate-*r/26.2%
Simplified26.2%
associate-/l*26.7%
add-cube-cbrt26.6%
*-un-lft-identity26.6%
times-frac26.6%
pow226.6%
Applied egg-rr26.6%
/-rgt-identity26.6%
associate-*r/26.6%
unpow226.6%
rem-3cbrt-lft26.7%
*-commutative26.7%
Simplified26.7%
Taylor expanded in z around -inf 81.8%
fma-neg81.8%
unpow281.8%
times-frac94.9%
metadata-eval94.9%
Simplified94.9%
if -2e129 < z < 3.99999999999999981e74Initial program 83.6%
*-commutative83.6%
associate-*l*83.4%
associate-*r/87.6%
Simplified87.6%
associate-/l*87.4%
add-cube-cbrt86.3%
*-un-lft-identity86.3%
times-frac86.4%
pow286.4%
Applied egg-rr86.4%
/-rgt-identity86.4%
associate-*r/86.3%
unpow286.3%
rem-3cbrt-lft87.4%
*-commutative87.4%
Simplified87.4%
if 3.99999999999999981e74 < z Initial program 45.0%
*-commutative45.0%
associate-*l*43.3%
associate-*r/43.6%
Simplified43.6%
associate-/l*47.0%
add-cube-cbrt46.6%
*-un-lft-identity46.6%
times-frac46.6%
pow246.6%
Applied egg-rr46.6%
/-rgt-identity46.6%
associate-*r/46.6%
unpow246.6%
rem-3cbrt-lft47.0%
*-commutative47.0%
Simplified47.0%
Taylor expanded in z around inf 88.7%
+-commutative88.7%
fma-def88.7%
unpow288.7%
times-frac97.0%
Simplified97.0%
Final simplification90.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 -2.65e-120)
(* y (- x))
(if (<= z 8e-76)
(* y (/ (* z x) (sqrt (* a (- t)))))
(/ (* y x) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.65e-120) {
tmp = y * -x;
} else if (z <= 8e-76) {
tmp = y * ((z * x) / sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
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.65d-120)) then
tmp = y * -x
else if (z <= 8d-76) then
tmp = y * ((z * x) / sqrt((a * -t)))
else
tmp = (y * x) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
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.65e-120) {
tmp = y * -x;
} else if (z <= 8e-76) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.65e-120: tmp = y * -x elif z <= 8e-76: tmp = y * ((z * x) / math.sqrt((a * -t))) else: tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.65e-120) tmp = Float64(y * Float64(-x)); elseif (z <= 8e-76) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); 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.65e-120)
tmp = y * -x;
elseif (z <= 8e-76)
tmp = y * ((z * x) / sqrt((a * -t)));
else
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
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.65e-120], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8e-76], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-120}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-76}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -2.64999999999999999e-120Initial program 61.7%
*-commutative61.7%
associate-*l*59.6%
associate-*r/66.3%
Simplified66.3%
Taylor expanded in z around -inf 83.7%
neg-mul-183.7%
Simplified83.7%
if -2.64999999999999999e-120 < z < 7.99999999999999942e-76Initial program 80.1%
*-commutative80.1%
associate-*l*82.8%
associate-*r/81.7%
Simplified81.7%
Taylor expanded in z around 0 78.9%
associate-*r*78.9%
neg-mul-178.9%
Simplified78.9%
if 7.99999999999999942e-76 < z Initial program 58.2%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in z around inf 85.5%
unpow285.5%
associate-/l*91.0%
Simplified91.0%
Final simplification85.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 -1.5e-123)
(* y (- x))
(if (<= z 1.2e-82)
(/ y (/ (sqrt (* a (- t))) (* z x)))
(/ (* y x) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e-123) {
tmp = y * -x;
} else if (z <= 1.2e-82) {
tmp = y / (sqrt((a * -t)) / (z * x));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
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-123)) then
tmp = y * -x
else if (z <= 1.2d-82) then
tmp = y / (sqrt((a * -t)) / (z * x))
else
tmp = (y * x) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
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-123) {
tmp = y * -x;
} else if (z <= 1.2e-82) {
tmp = y / (Math.sqrt((a * -t)) / (z * x));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.5e-123: tmp = y * -x elif z <= 1.2e-82: tmp = y / (math.sqrt((a * -t)) / (z * x)) else: tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e-123) tmp = Float64(y * Float64(-x)); elseif (z <= 1.2e-82) tmp = Float64(y / Float64(sqrt(Float64(a * Float64(-t))) / Float64(z * x))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); 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-123)
tmp = y * -x;
elseif (z <= 1.2e-82)
tmp = y / (sqrt((a * -t)) / (z * x));
else
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
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-123], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.2e-82], N[(y / N[(N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-123}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{\frac{\sqrt{a \cdot \left(-t\right)}}{z \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -1.49999999999999992e-123Initial program 61.7%
*-commutative61.7%
associate-*l*59.6%
associate-*r/66.3%
Simplified66.3%
Taylor expanded in z around -inf 83.7%
neg-mul-183.7%
Simplified83.7%
if -1.49999999999999992e-123 < z < 1.20000000000000004e-82Initial program 80.1%
*-commutative80.1%
associate-*l*82.8%
associate-*r/81.7%
Simplified81.7%
clear-num81.3%
un-div-inv81.4%
*-commutative81.4%
Applied egg-rr81.4%
Taylor expanded in z around 0 78.5%
associate-*r*78.9%
neg-mul-178.9%
Simplified78.5%
if 1.20000000000000004e-82 < z Initial program 58.2%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in z around inf 85.5%
unpow285.5%
associate-/l*91.0%
Simplified91.0%
Final simplification85.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.8e-180) (* y (- x)) (if (<= z 8e-148) (* 2.0 (* (/ x a) (/ (* y (* z z)) t))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e-180) {
tmp = y * -x;
} else if (z <= 8e-148) {
tmp = 2.0 * ((x / a) * ((y * (z * z)) / t));
} 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.8d-180)) then
tmp = y * -x
else if (z <= 8d-148) then
tmp = 2.0d0 * ((x / a) * ((y * (z * z)) / t))
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.8e-180) {
tmp = y * -x;
} else if (z <= 8e-148) {
tmp = 2.0 * ((x / a) * ((y * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.8e-180: tmp = y * -x elif z <= 8e-148: tmp = 2.0 * ((x / a) * ((y * (z * z)) / t)) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e-180) tmp = Float64(y * Float64(-x)); elseif (z <= 8e-148) tmp = Float64(2.0 * Float64(Float64(x / a) * Float64(Float64(y * Float64(z * z)) / t))); 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.8e-180)
tmp = y * -x;
elseif (z <= 8e-148)
tmp = 2.0 * ((x / a) * ((y * (z * z)) / t));
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.8e-180], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8e-148], N[(2.0 * N[(N[(x / a), $MachinePrecision] * N[(N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-148}:\\
\;\;\;\;2 \cdot \left(\frac{x}{a} \cdot \frac{y \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.8e-180Initial program 61.9%
*-commutative61.9%
associate-*l*59.9%
associate-*r/67.0%
Simplified67.0%
Taylor expanded in z around -inf 80.4%
neg-mul-180.4%
Simplified80.4%
if -1.8e-180 < z < 7.99999999999999949e-148Initial program 80.5%
*-commutative80.5%
associate-*l*84.1%
associate-*r/80.8%
Simplified80.8%
Taylor expanded in z around -inf 38.0%
Taylor expanded in z around 0 37.8%
associate-*r*37.8%
*-commutative37.8%
times-frac37.5%
unpow237.5%
Simplified37.5%
if 7.99999999999999949e-148 < z Initial program 61.6%
*-commutative61.6%
associate-*l*60.6%
associate-*r/62.5%
Simplified62.5%
Taylor expanded in z around inf 82.1%
Final simplification72.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.85e-180) (* y (- x)) (if (<= z 9.8e-148) (* 2.0 (* (/ (* z (* z y)) t) (/ x a))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e-180) {
tmp = y * -x;
} else if (z <= 9.8e-148) {
tmp = 2.0 * (((z * (z * y)) / t) * (x / a));
} 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.85d-180)) then
tmp = y * -x
else if (z <= 9.8d-148) then
tmp = 2.0d0 * (((z * (z * y)) / t) * (x / a))
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.85e-180) {
tmp = y * -x;
} else if (z <= 9.8e-148) {
tmp = 2.0 * (((z * (z * y)) / t) * (x / a));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.85e-180: tmp = y * -x elif z <= 9.8e-148: tmp = 2.0 * (((z * (z * y)) / t) * (x / a)) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e-180) tmp = Float64(y * Float64(-x)); elseif (z <= 9.8e-148) tmp = Float64(2.0 * Float64(Float64(Float64(z * Float64(z * y)) / t) * Float64(x / a))); 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.85e-180)
tmp = y * -x;
elseif (z <= 9.8e-148)
tmp = 2.0 * (((z * (z * y)) / t) * (x / a));
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.85e-180], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9.8e-148], N[(2.0 * N[(N[(N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-148}:\\
\;\;\;\;2 \cdot \left(\frac{z \cdot \left(z \cdot y\right)}{t} \cdot \frac{x}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.85000000000000008e-180Initial program 61.9%
*-commutative61.9%
associate-*l*59.9%
associate-*r/67.0%
Simplified67.0%
Taylor expanded in z around -inf 80.4%
neg-mul-180.4%
Simplified80.4%
if -1.85000000000000008e-180 < z < 9.8000000000000001e-148Initial program 80.5%
*-commutative80.5%
associate-*l*84.1%
associate-*r/80.8%
Simplified80.8%
Taylor expanded in z around -inf 38.0%
Taylor expanded in z around 0 37.8%
associate-*r*37.8%
*-commutative37.8%
times-frac37.5%
unpow237.5%
Simplified37.5%
Taylor expanded in y around 0 37.5%
*-commutative37.5%
unpow237.5%
associate-*l*37.7%
Simplified37.7%
if 9.8000000000000001e-148 < z Initial program 61.6%
*-commutative61.6%
associate-*l*60.6%
associate-*r/62.5%
Simplified62.5%
Taylor expanded in z around inf 82.1%
Final simplification72.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 -6.6e-181) (* y (- x)) (if (<= z 1.55e-173) (* 2.0 (/ (* x (* z (* z (/ y t)))) a)) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e-181) {
tmp = y * -x;
} else if (z <= 1.55e-173) {
tmp = 2.0 * ((x * (z * (z * (y / t)))) / a);
} 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 <= (-6.6d-181)) then
tmp = y * -x
else if (z <= 1.55d-173) then
tmp = 2.0d0 * ((x * (z * (z * (y / t)))) / a)
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 <= -6.6e-181) {
tmp = y * -x;
} else if (z <= 1.55e-173) {
tmp = 2.0 * ((x * (z * (z * (y / t)))) / a);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6.6e-181: tmp = y * -x elif z <= 1.55e-173: tmp = 2.0 * ((x * (z * (z * (y / t)))) / a) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e-181) tmp = Float64(y * Float64(-x)); elseif (z <= 1.55e-173) tmp = Float64(2.0 * Float64(Float64(x * Float64(z * Float64(z * Float64(y / t)))) / a)); 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 <= -6.6e-181)
tmp = y * -x;
elseif (z <= 1.55e-173)
tmp = 2.0 * ((x * (z * (z * (y / t)))) / a);
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, -6.6e-181], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.55e-173], N[(2.0 * N[(N[(x * N[(z * N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-181}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-173}:\\
\;\;\;\;2 \cdot \frac{x \cdot \left(z \cdot \left(z \cdot \frac{y}{t}\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -6.60000000000000018e-181Initial program 61.9%
*-commutative61.9%
associate-*l*59.9%
associate-*r/67.0%
Simplified67.0%
Taylor expanded in z around -inf 80.4%
neg-mul-180.4%
Simplified80.4%
if -6.60000000000000018e-181 < z < 1.55000000000000003e-173Initial program 82.2%
*-commutative82.2%
associate-*l*88.6%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in z around -inf 40.3%
Taylor expanded in z around 0 40.3%
associate-*r*40.3%
*-commutative40.3%
times-frac39.8%
unpow239.8%
Simplified39.8%
associate-*r/40.4%
associate-/l*40.4%
Applied egg-rr40.4%
Taylor expanded in y around 0 40.4%
associate-*l/39.9%
*-commutative39.9%
unpow239.9%
associate-*l*40.3%
Simplified40.3%
if 1.55000000000000003e-173 < z Initial program 62.0%
*-commutative62.0%
associate-*l*60.2%
associate-*r/62.0%
Simplified62.0%
Taylor expanded in z around inf 78.7%
Final simplification72.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-180) (* y (- x)) (if (<= z 9.5e-148) (* 2.0 (/ (* x (/ y (/ t (* z z)))) a)) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-180) {
tmp = y * -x;
} else if (z <= 9.5e-148) {
tmp = 2.0 * ((x * (y / (t / (z * z)))) / a);
} 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.55d-180)) then
tmp = y * -x
else if (z <= 9.5d-148) then
tmp = 2.0d0 * ((x * (y / (t / (z * z)))) / a)
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.55e-180) {
tmp = y * -x;
} else if (z <= 9.5e-148) {
tmp = 2.0 * ((x * (y / (t / (z * z)))) / a);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.55e-180: tmp = y * -x elif z <= 9.5e-148: tmp = 2.0 * ((x * (y / (t / (z * z)))) / a) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e-180) tmp = Float64(y * Float64(-x)); elseif (z <= 9.5e-148) tmp = Float64(2.0 * Float64(Float64(x * Float64(y / Float64(t / Float64(z * z)))) / a)); 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.55e-180)
tmp = y * -x;
elseif (z <= 9.5e-148)
tmp = 2.0 * ((x * (y / (t / (z * z)))) / a);
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.55e-180], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9.5e-148], N[(2.0 * N[(N[(x * N[(y / N[(t / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-148}:\\
\;\;\;\;2 \cdot \frac{x \cdot \frac{y}{\frac{t}{z \cdot z}}}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.5499999999999999e-180Initial program 61.9%
*-commutative61.9%
associate-*l*59.9%
associate-*r/67.0%
Simplified67.0%
Taylor expanded in z around -inf 80.4%
neg-mul-180.4%
Simplified80.4%
if -1.5499999999999999e-180 < z < 9.50000000000000069e-148Initial program 80.5%
*-commutative80.5%
associate-*l*84.1%
associate-*r/80.8%
Simplified80.8%
Taylor expanded in z around -inf 38.0%
Taylor expanded in z around 0 37.8%
associate-*r*37.8%
*-commutative37.8%
times-frac37.5%
unpow237.5%
Simplified37.5%
associate-*r/38.0%
associate-/l*38.0%
Applied egg-rr38.0%
if 9.50000000000000069e-148 < z Initial program 61.6%
*-commutative61.6%
associate-*l*60.6%
associate-*r/62.5%
Simplified62.5%
Taylor expanded in z around inf 82.1%
Final simplification73.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.4e-180) (* y (- x)) (if (<= z 1.18e-147) (* y (* (/ 2.0 a) (/ (* x (* z z)) t))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e-180) {
tmp = y * -x;
} else if (z <= 1.18e-147) {
tmp = y * ((2.0 / a) * ((x * (z * z)) / t));
} 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.4d-180)) then
tmp = y * -x
else if (z <= 1.18d-147) then
tmp = y * ((2.0d0 / a) * ((x * (z * z)) / t))
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.4e-180) {
tmp = y * -x;
} else if (z <= 1.18e-147) {
tmp = y * ((2.0 / a) * ((x * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.4e-180: tmp = y * -x elif z <= 1.18e-147: tmp = y * ((2.0 / a) * ((x * (z * z)) / t)) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e-180) tmp = Float64(y * Float64(-x)); elseif (z <= 1.18e-147) tmp = Float64(y * Float64(Float64(2.0 / a) * Float64(Float64(x * Float64(z * z)) / t))); 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.4e-180)
tmp = y * -x;
elseif (z <= 1.18e-147)
tmp = y * ((2.0 / a) * ((x * (z * z)) / t));
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.4e-180], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.18e-147], N[(y * N[(N[(2.0 / a), $MachinePrecision] * N[(N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-147}:\\
\;\;\;\;y \cdot \left(\frac{2}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.39999999999999999e-180Initial program 61.9%
*-commutative61.9%
associate-*l*59.9%
associate-*r/67.0%
Simplified67.0%
Taylor expanded in z around -inf 80.4%
neg-mul-180.4%
Simplified80.4%
if -1.39999999999999999e-180 < z < 1.18000000000000003e-147Initial program 80.5%
*-commutative80.5%
associate-*l*84.1%
associate-*r/80.8%
Simplified80.8%
Taylor expanded in z around -inf 38.0%
expm1-log1p-u8.5%
expm1-udef8.5%
associate-/l*8.5%
Applied egg-rr8.5%
expm1-def8.5%
expm1-log1p38.0%
associate-/r/37.9%
Simplified37.9%
Taylor expanded in z around 0 37.8%
associate-*r/37.8%
times-frac38.0%
unpow238.0%
Simplified38.0%
if 1.18000000000000003e-147 < z Initial program 61.6%
*-commutative61.6%
associate-*l*60.6%
associate-*r/62.5%
Simplified62.5%
Taylor expanded in z around inf 82.1%
Final simplification73.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 -2.1e-180) (* y (- x)) (* y (/ x (/ (+ z (* -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 <= -2.1e-180) {
tmp = y * -x;
} else {
tmp = y * (x / ((z + (-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 <= (-2.1d-180)) then
tmp = y * -x
else
tmp = y * (x / ((z + ((-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 <= -2.1e-180) {
tmp = y * -x;
} else {
tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.1e-180: tmp = y * -x else: tmp = y * (x / ((z + (-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 <= -2.1e-180) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * Float64(x / Float64(Float64(z + Float64(-0.5 * Float64(Float64(a / z) * 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 <= -2.1e-180)
tmp = y * -x;
else
tmp = y * (x / ((z + (-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, -2.1e-180], N[(y * (-x)), $MachinePrecision], N[(y * N[(x / N[(N[(z + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\
\end{array}
\end{array}
if z < -2.0999999999999999e-180Initial program 61.9%
*-commutative61.9%
associate-*l*59.9%
associate-*r/67.0%
Simplified67.0%
Taylor expanded in z around -inf 80.4%
neg-mul-180.4%
Simplified80.4%
if -2.0999999999999999e-180 < z Initial program 67.7%
*-commutative67.7%
associate-*l*68.1%
associate-*r/68.4%
Simplified68.4%
associate-/l*68.3%
add-cube-cbrt67.6%
*-un-lft-identity67.6%
times-frac67.6%
pow267.6%
Applied egg-rr67.6%
/-rgt-identity67.6%
associate-*r/67.6%
unpow267.6%
rem-3cbrt-lft68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around inf 68.5%
associate-/l*71.0%
associate-/r/71.0%
Simplified71.0%
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.6e-278) (* y (- x)) (if (<= z 8.2e-195) (* y (/ (* z x) z)) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.6e-278) {
tmp = y * -x;
} else if (z <= 8.2e-195) {
tmp = y * ((z * 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 <= (-4.6d-278)) then
tmp = y * -x
else if (z <= 8.2d-195) then
tmp = y * ((z * 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 <= -4.6e-278) {
tmp = y * -x;
} else if (z <= 8.2e-195) {
tmp = y * ((z * x) / z);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.6e-278: tmp = y * -x elif z <= 8.2e-195: tmp = y * ((z * 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 <= -4.6e-278) tmp = Float64(y * Float64(-x)); elseif (z <= 8.2e-195) tmp = Float64(y * Float64(Float64(z * 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 <= -4.6e-278)
tmp = y * -x;
elseif (z <= 8.2e-195)
tmp = y * ((z * 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, -4.6e-278], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8.2e-195], N[(y * N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-278}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-195}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.60000000000000006e-278Initial program 62.2%
*-commutative62.2%
associate-*l*62.0%
associate-*r/68.1%
Simplified68.1%
Taylor expanded in z around -inf 71.0%
neg-mul-171.0%
Simplified71.0%
if -4.60000000000000006e-278 < z < 8.20000000000000024e-195Initial program 91.8%
*-commutative91.8%
associate-*l*95.9%
associate-*r/92.0%
Simplified92.0%
Taylor expanded in z around inf 38.0%
if 8.20000000000000024e-195 < z Initial program 63.3%
*-commutative63.3%
associate-*l*61.5%
associate-*r/62.7%
Simplified62.7%
Taylor expanded in z around inf 76.2%
Final simplification70.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 -4.6e-278) (* y (- x)) (if (<= z 1.7e-120) (/ (* 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 <= -4.6e-278) {
tmp = y * -x;
} else if (z <= 1.7e-120) {
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 <= (-4.6d-278)) then
tmp = y * -x
else if (z <= 1.7d-120) 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 <= -4.6e-278) {
tmp = y * -x;
} else if (z <= 1.7e-120) {
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 <= -4.6e-278: tmp = y * -x elif z <= 1.7e-120: 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 <= -4.6e-278) tmp = Float64(y * Float64(-x)); elseif (z <= 1.7e-120) 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 <= -4.6e-278)
tmp = y * -x;
elseif (z <= 1.7e-120)
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, -4.6e-278], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.7e-120], 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 -4.6 \cdot 10^{-278}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-120}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.60000000000000006e-278Initial program 62.2%
*-commutative62.2%
associate-*l*62.0%
associate-*r/68.1%
Simplified68.1%
Taylor expanded in z around -inf 71.0%
neg-mul-171.0%
Simplified71.0%
if -4.60000000000000006e-278 < z < 1.70000000000000005e-120Initial program 89.6%
Taylor expanded in z around inf 40.6%
if 1.70000000000000005e-120 < z Initial program 60.1%
*-commutative60.1%
associate-*l*60.0%
associate-*r/62.0%
Simplified62.0%
Taylor expanded in z around inf 85.2%
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 (if (<= z -5e-310) (* y (- x)) (* y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-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 <= (-5d-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 <= -5e-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 <= -5e-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 <= -5e-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 <= -5e-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, -5e-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 -5 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.999999999999985e-310Initial program 63.4%
*-commutative63.4%
associate-*l*62.4%
associate-*r/68.3%
Simplified68.3%
Taylor expanded in z around -inf 68.8%
neg-mul-168.8%
Simplified68.8%
if -4.999999999999985e-310 < z Initial program 67.1%
*-commutative67.1%
associate-*l*67.0%
associate-*r/67.3%
Simplified67.3%
Taylor expanded in z around inf 67.4%
Final simplification68.1%
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 65.3%
*-commutative65.3%
associate-*l*64.8%
associate-*r/67.8%
Simplified67.8%
Taylor expanded in z around inf 40.5%
Final simplification40.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 2023240
(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)))))