
(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: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z z) (* a t))))
(if (<= z -1.5e+146)
(* y (- x))
(if (<= z -6.5e-216)
(* x (* y (* z (pow t_1 -0.5))))
(if (<= z 5.4e-147)
(* x (/ (* z y) (* (sqrt (- t)) (sqrt a))))
(if (<= z 6.2e+133) (* x (/ z (/ (sqrt t_1) y))) (* y x)))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * z) - (a * t);
double tmp;
if (z <= -1.5e+146) {
tmp = y * -x;
} else if (z <= -6.5e-216) {
tmp = x * (y * (z * pow(t_1, -0.5)));
} else if (z <= 5.4e-147) {
tmp = x * ((z * y) / (sqrt(-t) * sqrt(a)));
} else if (z <= 6.2e+133) {
tmp = x * (z / (sqrt(t_1) / y));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z * z) - (a * t)
if (z <= (-1.5d+146)) then
tmp = y * -x
else if (z <= (-6.5d-216)) then
tmp = x * (y * (z * (t_1 ** (-0.5d0))))
else if (z <= 5.4d-147) then
tmp = x * ((z * y) / (sqrt(-t) * sqrt(a)))
else if (z <= 6.2d+133) then
tmp = x * (z / (sqrt(t_1) / y))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * z) - (a * t);
double tmp;
if (z <= -1.5e+146) {
tmp = y * -x;
} else if (z <= -6.5e-216) {
tmp = x * (y * (z * Math.pow(t_1, -0.5)));
} else if (z <= 5.4e-147) {
tmp = x * ((z * y) / (Math.sqrt(-t) * Math.sqrt(a)));
} else if (z <= 6.2e+133) {
tmp = x * (z / (Math.sqrt(t_1) / y));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = (z * z) - (a * t) tmp = 0 if z <= -1.5e+146: tmp = y * -x elif z <= -6.5e-216: tmp = x * (y * (z * math.pow(t_1, -0.5))) elif z <= 5.4e-147: tmp = x * ((z * y) / (math.sqrt(-t) * math.sqrt(a))) elif z <= 6.2e+133: tmp = x * (z / (math.sqrt(t_1) / y)) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(z * z) - Float64(a * t)) tmp = 0.0 if (z <= -1.5e+146) tmp = Float64(y * Float64(-x)); elseif (z <= -6.5e-216) tmp = Float64(x * Float64(y * Float64(z * (t_1 ^ -0.5)))); elseif (z <= 5.4e-147) tmp = Float64(x * Float64(Float64(z * y) / Float64(sqrt(Float64(-t)) * sqrt(a)))); elseif (z <= 6.2e+133) tmp = Float64(x * Float64(z / Float64(sqrt(t_1) / y))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (z * z) - (a * t);
tmp = 0.0;
if (z <= -1.5e+146)
tmp = y * -x;
elseif (z <= -6.5e-216)
tmp = x * (y * (z * (t_1 ^ -0.5)));
elseif (z <= 5.4e-147)
tmp = x * ((z * y) / (sqrt(-t) * sqrt(a)));
elseif (z <= 6.2e+133)
tmp = x * (z / (sqrt(t_1) / y));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+146], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -6.5e-216], N[(x * N[(y * N[(z * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-147], N[(x * N[(N[(z * y), $MachinePrecision] / N[(N[Sqrt[(-t)], $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+133], N[(x * N[(z / N[(N[Sqrt[t$95$1], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := z \cdot z - a \cdot t\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+146}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \left(y \cdot \left(z \cdot {t_1}^{-0.5}\right)\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-147}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{-t} \cdot \sqrt{a}}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+133}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{t_1}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.50000000000000001e146Initial program 12.3%
associate-*l*12.1%
associate-*r/12.4%
*-commutative12.4%
associate-/l*12.9%
Simplified12.9%
Taylor expanded in z around -inf 93.0%
associate-*r*93.0%
neg-mul-193.0%
*-commutative93.0%
Simplified93.0%
if -1.50000000000000001e146 < z < -6.4999999999999999e-216Initial program 84.2%
associate-*l*81.1%
associate-*r/84.2%
*-commutative84.2%
associate-/l*87.2%
Simplified87.2%
clear-num87.1%
associate-/r*84.2%
associate-/r/84.3%
pow1/284.3%
pow-flip84.2%
metadata-eval84.2%
*-commutative84.2%
Applied egg-rr84.2%
Taylor expanded in y around 0 84.2%
associate-*l*88.5%
*-commutative88.5%
unpow288.5%
unpow-188.5%
metadata-eval88.5%
pow-sqr88.5%
rem-sqrt-square88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in z around 0 88.5%
unpow288.5%
metadata-eval88.5%
pow-sqr88.2%
fabs-sqr88.2%
pow-sqr88.5%
metadata-eval88.5%
Simplified88.5%
if -6.4999999999999999e-216 < z < 5.3999999999999999e-147Initial program 72.4%
associate-*l*70.5%
associate-*r/70.3%
Simplified70.3%
Taylor expanded in z around 0 67.7%
mul-1-neg67.7%
distribute-rgt-neg-out67.7%
Simplified67.7%
*-commutative67.7%
sqrt-prod38.3%
Applied egg-rr38.3%
if 5.3999999999999999e-147 < z < 6.2e133Initial program 91.5%
associate-*l*82.7%
associate-*r/87.8%
*-commutative87.8%
associate-/l*96.4%
Simplified96.4%
if 6.2e133 < z Initial program 22.8%
associate-*l*22.5%
associate-*r/22.7%
*-commutative22.7%
associate-/l*21.2%
Simplified21.2%
Taylor expanded in z around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification85.8%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.6e+156) (* y (- x)) (if (<= z 6.5e+133) (* x (/ z (/ (sqrt (- (* z z) (* a t))) y))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e+156) {
tmp = y * -x;
} else if (z <= 6.5e+133) {
tmp = x * (z / (sqrt(((z * z) - (a * t))) / y));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.6d+156)) then
tmp = y * -x
else if (z <= 6.5d+133) then
tmp = x * (z / (sqrt(((z * z) - (a * t))) / y))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e+156) {
tmp = y * -x;
} else if (z <= 6.5e+133) {
tmp = x * (z / (Math.sqrt(((z * z) - (a * t))) / y));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5.6e+156: tmp = y * -x elif z <= 6.5e+133: tmp = x * (z / (math.sqrt(((z * z) - (a * t))) / y)) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e+156) tmp = Float64(y * Float64(-x)); elseif (z <= 6.5e+133) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.6e+156)
tmp = y * -x;
elseif (z <= 6.5e+133)
tmp = x * (z / (sqrt(((z * z) - (a * t))) / y));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.6e+156], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 6.5e+133], N[(x * N[(z / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+156}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+133}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -5.59999999999999975e156Initial program 7.0%
associate-*l*6.8%
associate-*r/7.2%
*-commutative7.2%
associate-/l*7.6%
Simplified7.6%
Taylor expanded in z around -inf 94.4%
associate-*r*94.4%
neg-mul-194.4%
*-commutative94.4%
Simplified94.4%
if -5.59999999999999975e156 < z < 6.5000000000000004e133Initial program 83.8%
associate-*l*79.2%
associate-*r/82.2%
*-commutative82.2%
associate-/l*86.9%
Simplified86.9%
if 6.5000000000000004e133 < z Initial program 22.8%
associate-*l*22.5%
associate-*r/22.7%
*-commutative22.7%
associate-/l*21.2%
Simplified21.2%
Taylor expanded in z around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification90.5%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.6e-94) (* y (- x)) (if (<= z 950000000.0) (* x (* y (* z (pow (* t (- a)) -0.5)))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-94) {
tmp = y * -x;
} else if (z <= 950000000.0) {
tmp = x * (y * (z * pow((t * -a), -0.5)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a 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.6d-94)) then
tmp = y * -x
else if (z <= 950000000.0d0) then
tmp = x * (y * (z * ((t * -a) ** (-0.5d0))))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-94) {
tmp = y * -x;
} else if (z <= 950000000.0) {
tmp = x * (y * (z * Math.pow((t * -a), -0.5)));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-94: tmp = y * -x elif z <= 950000000.0: tmp = x * (y * (z * math.pow((t * -a), -0.5))) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-94) tmp = Float64(y * Float64(-x)); elseif (z <= 950000000.0) tmp = Float64(x * Float64(y * Float64(z * (Float64(t * Float64(-a)) ^ -0.5)))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.6e-94)
tmp = y * -x;
elseif (z <= 950000000.0)
tmp = x * (y * (z * ((t * -a) ^ -0.5)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-94], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 950000000.0], N[(x * N[(y * N[(z * N[Power[N[(t * (-a)), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-94}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 950000000:\\
\;\;\;\;x \cdot \left(y \cdot \left(z \cdot {\left(t \cdot \left(-a\right)\right)}^{-0.5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.59999999999999998e-94Initial program 48.1%
associate-*l*45.0%
associate-*r/47.3%
*-commutative47.3%
associate-/l*49.5%
Simplified49.5%
Taylor expanded in z around -inf 88.0%
associate-*r*88.0%
neg-mul-188.0%
*-commutative88.0%
Simplified88.0%
if -1.59999999999999998e-94 < z < 9.5e8Initial program 78.3%
associate-*l*77.3%
associate-*r/79.6%
Simplified79.6%
Taylor expanded in z around 0 69.5%
mul-1-neg69.5%
distribute-rgt-neg-out69.5%
Simplified69.5%
div-inv69.4%
pow1/270.8%
pow-flip70.9%
metadata-eval70.9%
Applied egg-rr70.9%
associate-*l*69.2%
Simplified69.2%
if 9.5e8 < z Initial program 54.1%
associate-*l*48.9%
associate-*r/50.3%
*-commutative50.3%
associate-/l*54.5%
Simplified54.5%
Taylor expanded in z around inf 92.7%
*-commutative92.7%
Simplified92.7%
Final simplification83.7%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.9e-93) (* y (- x)) (if (<= z 950000000.0) (* x (/ z (/ (sqrt (* t (- a))) y))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-93) {
tmp = y * -x;
} else if (z <= 950000000.0) {
tmp = x * (z / (sqrt((t * -a)) / y));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a 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.9d-93)) then
tmp = y * -x
else if (z <= 950000000.0d0) then
tmp = x * (z / (sqrt((t * -a)) / y))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-93) {
tmp = y * -x;
} else if (z <= 950000000.0) {
tmp = x * (z / (Math.sqrt((t * -a)) / y));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.9e-93: tmp = y * -x elif z <= 950000000.0: tmp = x * (z / (math.sqrt((t * -a)) / y)) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e-93) tmp = Float64(y * Float64(-x)); elseif (z <= 950000000.0) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(t * Float64(-a))) / y))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.9e-93)
tmp = y * -x;
elseif (z <= 950000000.0)
tmp = x * (z / (sqrt((t * -a)) / y));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e-93], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 950000000.0], N[(x * N[(z / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-93}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 950000000:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{t \cdot \left(-a\right)}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.8999999999999998e-93Initial program 48.1%
associate-*l*45.0%
associate-*r/47.3%
*-commutative47.3%
associate-/l*49.5%
Simplified49.5%
Taylor expanded in z around -inf 88.0%
associate-*r*88.0%
neg-mul-188.0%
*-commutative88.0%
Simplified88.0%
if -2.8999999999999998e-93 < z < 9.5e8Initial program 78.3%
associate-*l*77.3%
associate-*r/79.6%
*-commutative79.6%
associate-/l*82.1%
Simplified82.1%
Taylor expanded in z around 0 70.7%
mul-1-neg69.5%
distribute-rgt-neg-out69.5%
Simplified70.7%
if 9.5e8 < z Initial program 54.1%
associate-*l*48.9%
associate-*r/50.3%
*-commutative50.3%
associate-/l*54.5%
Simplified54.5%
Taylor expanded in z around inf 92.7%
*-commutative92.7%
Simplified92.7%
Final simplification84.2%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.6e+156) (* y (- x)) (if (<= z 5.7e-179) (* x (/ z (/ (- (* 0.5 (/ a (/ z t))) z) y))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e+156) {
tmp = y * -x;
} else if (z <= 5.7e-179) {
tmp = x * (z / (((0.5 * (a / (z / t))) - z) / y));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.6d+156)) then
tmp = y * -x
else if (z <= 5.7d-179) then
tmp = x * (z / (((0.5d0 * (a / (z / t))) - z) / y))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e+156) {
tmp = y * -x;
} else if (z <= 5.7e-179) {
tmp = x * (z / (((0.5 * (a / (z / t))) - z) / y));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5.6e+156: tmp = y * -x elif z <= 5.7e-179: tmp = x * (z / (((0.5 * (a / (z / t))) - z) / y)) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e+156) tmp = Float64(y * Float64(-x)); elseif (z <= 5.7e-179) tmp = Float64(x * Float64(z / Float64(Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z) / y))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.6e+156)
tmp = y * -x;
elseif (z <= 5.7e-179)
tmp = x * (z / (((0.5 * (a / (z / t))) - z) / y));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.6e+156], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5.7e-179], N[(x * N[(z / N[(N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+156}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{-179}:\\
\;\;\;\;x \cdot \frac{z}{\frac{0.5 \cdot \frac{a}{\frac{z}{t}} - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -5.59999999999999975e156Initial program 7.0%
associate-*l*6.8%
associate-*r/7.2%
*-commutative7.2%
associate-/l*7.6%
Simplified7.6%
Taylor expanded in z around -inf 94.4%
associate-*r*94.4%
neg-mul-194.4%
*-commutative94.4%
Simplified94.4%
if -5.59999999999999975e156 < z < 5.6999999999999999e-179Initial program 80.7%
associate-*l*78.0%
associate-*r/80.1%
*-commutative80.1%
associate-/l*82.9%
Simplified82.9%
Taylor expanded in z around -inf 68.1%
neg-mul-168.1%
+-commutative68.1%
unsub-neg68.1%
associate-/l*68.2%
Simplified68.2%
if 5.6999999999999999e-179 < z Initial program 62.1%
associate-*l*57.2%
associate-*r/60.0%
*-commutative60.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification78.3%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.6e-210) (* y (- x)) (if (<= z 1.25e-186) (* -2.0 (* (/ x a) (/ (* y (* z z)) t))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-210) {
tmp = y * -x;
} else if (z <= 1.25e-186) {
tmp = -2.0 * ((x / a) * ((y * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.6d-210)) then
tmp = y * -x
else if (z <= 1.25d-186) then
tmp = (-2.0d0) * ((x / a) * ((y * (z * z)) / t))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-210) {
tmp = y * -x;
} else if (z <= 1.25e-186) {
tmp = -2.0 * ((x / a) * ((y * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -3.6e-210: tmp = y * -x elif z <= 1.25e-186: tmp = -2.0 * ((x / a) * ((y * (z * z)) / t)) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e-210) tmp = Float64(y * Float64(-x)); elseif (z <= 1.25e-186) tmp = Float64(-2.0 * Float64(Float64(x / a) * Float64(Float64(y * Float64(z * z)) / t))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.6e-210)
tmp = y * -x;
elseif (z <= 1.25e-186)
tmp = -2.0 * ((x / a) * ((y * (z * z)) / t));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e-210], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.25e-186], 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}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-210}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-186}:\\
\;\;\;\;-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 < -3.5999999999999999e-210Initial program 52.3%
associate-*l*50.5%
associate-*r/52.4%
*-commutative52.4%
associate-/l*54.3%
Simplified54.3%
Taylor expanded in z around -inf 81.2%
associate-*r*81.2%
neg-mul-181.2%
*-commutative81.2%
Simplified81.2%
if -3.5999999999999999e-210 < z < 1.25e-186Initial program 74.7%
associate-*l*72.5%
associate-*r/72.4%
*-commutative72.4%
associate-/l*75.3%
Simplified75.3%
clear-num75.3%
un-div-inv75.4%
associate-/l/72.4%
Applied egg-rr72.4%
Taylor expanded in z around inf 48.2%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around 0 47.7%
times-frac47.6%
*-commutative47.6%
unpow247.6%
Simplified47.6%
if 1.25e-186 < z Initial program 62.1%
associate-*l*57.2%
associate-*r/60.0%
*-commutative60.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification76.7%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.6e-210) (* y (- x)) (if (<= z 1.6e-186) (* (/ 2.0 a) (/ (* x (* y (* z z))) t)) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-210) {
tmp = y * -x;
} else if (z <= 1.6e-186) {
tmp = (2.0 / a) * ((x * (y * (z * z))) / t);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.6d-210)) then
tmp = y * -x
else if (z <= 1.6d-186) then
tmp = (2.0d0 / a) * ((x * (y * (z * z))) / t)
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-210) {
tmp = y * -x;
} else if (z <= 1.6e-186) {
tmp = (2.0 / a) * ((x * (y * (z * z))) / t);
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -3.6e-210: tmp = y * -x elif z <= 1.6e-186: tmp = (2.0 / a) * ((x * (y * (z * z))) / t) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e-210) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e-186) tmp = Float64(Float64(2.0 / a) * Float64(Float64(x * Float64(y * Float64(z * z))) / t)); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.6e-210)
tmp = y * -x;
elseif (z <= 1.6e-186)
tmp = (2.0 / a) * ((x * (y * (z * z))) / t);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e-210], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e-186], N[(N[(2.0 / a), $MachinePrecision] * N[(N[(x * N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-210}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-186}:\\
\;\;\;\;\frac{2}{a} \cdot \frac{x \cdot \left(y \cdot \left(z \cdot z\right)\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.5999999999999999e-210Initial program 52.3%
associate-*l*50.5%
associate-*r/52.4%
*-commutative52.4%
associate-/l*54.3%
Simplified54.3%
Taylor expanded in z around -inf 81.2%
associate-*r*81.2%
neg-mul-181.2%
*-commutative81.2%
Simplified81.2%
if -3.5999999999999999e-210 < z < 1.6e-186Initial program 74.7%
*-commutative74.7%
associate-/l*73.2%
Simplified73.2%
Taylor expanded in z around -inf 47.6%
Taylor expanded in z around 0 47.7%
associate-*r/47.7%
*-commutative47.7%
unpow247.7%
Simplified47.7%
times-frac48.0%
*-commutative48.0%
Applied egg-rr48.0%
if 1.6e-186 < z Initial program 62.1%
associate-*l*57.2%
associate-*r/60.0%
*-commutative60.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification76.8%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1e-131) (* y (- x)) (if (<= z 3e-197) (* (/ -1.0 z) (/ z (/ 1.0 (* y x)))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-131) {
tmp = y * -x;
} else if (z <= 3e-197) {
tmp = (-1.0 / z) * (z / (1.0 / (y * x)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a 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 <= (-1d-131)) then
tmp = y * -x
else if (z <= 3d-197) then
tmp = ((-1.0d0) / z) * (z / (1.0d0 / (y * x)))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-131) {
tmp = y * -x;
} else if (z <= 3e-197) {
tmp = (-1.0 / z) * (z / (1.0 / (y * x)));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1e-131: tmp = y * -x elif z <= 3e-197: tmp = (-1.0 / z) * (z / (1.0 / (y * x))) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e-131) tmp = Float64(y * Float64(-x)); elseif (z <= 3e-197) tmp = Float64(Float64(-1.0 / z) * Float64(z / Float64(1.0 / Float64(y * x)))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1e-131)
tmp = y * -x;
elseif (z <= 3e-197)
tmp = (-1.0 / z) * (z / (1.0 / (y * x)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e-131], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3e-197], N[(N[(-1.0 / z), $MachinePrecision] * N[(z / N[(1.0 / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-131}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-197}:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{z}{\frac{1}{y \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -9.9999999999999999e-132Initial program 50.6%
associate-*l*47.7%
associate-*r/49.8%
*-commutative49.8%
associate-/l*51.9%
Simplified51.9%
Taylor expanded in z around -inf 84.4%
associate-*r*84.4%
neg-mul-184.4%
*-commutative84.4%
Simplified84.4%
if -9.9999999999999999e-132 < z < 3.00000000000000026e-197Initial program 73.9%
*-commutative73.9%
associate-/l*70.6%
Simplified70.6%
Taylor expanded in z around -inf 32.5%
associate-*r/32.5%
neg-mul-132.5%
*-commutative32.5%
Simplified32.5%
*-un-lft-identity32.5%
div-inv32.4%
times-frac48.2%
add-sqr-sqrt29.0%
sqrt-unprod6.3%
sqr-neg6.3%
sqrt-prod19.7%
add-sqr-sqrt43.5%
frac-2neg43.5%
metadata-eval43.5%
add-sqr-sqrt23.8%
sqrt-unprod5.2%
sqr-neg5.2%
sqrt-prod19.2%
add-sqr-sqrt48.2%
Applied egg-rr48.2%
if 3.00000000000000026e-197 < z Initial program 61.8%
associate-*l*57.1%
associate-*r/59.9%
*-commutative59.9%
associate-/l*63.8%
Simplified63.8%
Taylor expanded in z around inf 79.4%
*-commutative79.4%
Simplified79.4%
Final simplification76.3%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 7.2e-302) (* y (- x)) (if (<= z 2.8e-132) (* x (/ (* z y) z)) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 7.2e-302) {
tmp = y * -x;
} else if (z <= 2.8e-132) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a 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.2d-302) then
tmp = y * -x
else if (z <= 2.8d-132) then
tmp = x * ((z * y) / z)
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 7.2e-302) {
tmp = y * -x;
} else if (z <= 2.8e-132) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= 7.2e-302: tmp = y * -x elif z <= 2.8e-132: tmp = x * ((z * y) / z) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 7.2e-302) tmp = Float64(y * Float64(-x)); elseif (z <= 2.8e-132) tmp = Float64(x * Float64(Float64(z * y) / z)); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 7.2e-302)
tmp = y * -x;
elseif (z <= 2.8e-132)
tmp = x * ((z * y) / z);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 7.2e-302], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.8e-132], N[(x * N[(N[(z * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{-302}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-132}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < 7.2000000000000001e-302Initial program 55.2%
associate-*l*52.9%
associate-*r/54.6%
*-commutative54.6%
associate-/l*56.3%
Simplified56.3%
Taylor expanded in z around -inf 76.5%
associate-*r*76.5%
neg-mul-176.5%
*-commutative76.5%
Simplified76.5%
if 7.2000000000000001e-302 < z < 2.80000000000000002e-132Initial program 67.6%
associate-*l*68.1%
associate-*r/71.2%
Simplified71.2%
Taylor expanded in z around inf 36.4%
if 2.80000000000000002e-132 < z Initial program 62.2%
associate-*l*56.9%
associate-*r/59.1%
*-commutative59.1%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in z around inf 84.4%
*-commutative84.4%
Simplified84.4%
Final simplification75.3%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 7.2e-302) (* y (- x)) (* y x)))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 7.2e-302) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: t and a 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.2d-302) then
tmp = y * -x
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 7.2e-302) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= 7.2e-302: tmp = y * -x else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 7.2e-302) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 7.2e-302)
tmp = y * -x;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 7.2e-302], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{-302}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < 7.2000000000000001e-302Initial program 55.2%
associate-*l*52.9%
associate-*r/54.6%
*-commutative54.6%
associate-/l*56.3%
Simplified56.3%
Taylor expanded in z around -inf 76.5%
associate-*r*76.5%
neg-mul-176.5%
*-commutative76.5%
Simplified76.5%
if 7.2000000000000001e-302 < z Initial program 63.4%
associate-*l*59.4%
associate-*r/61.8%
*-commutative61.8%
associate-/l*65.9%
Simplified65.9%
Taylor expanded in z around inf 70.8%
*-commutative70.8%
Simplified70.8%
Final simplification73.8%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y x))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
return y * x;
}
NOTE: t and a 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 t < a;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): return y * x
t, a = sort([t, a]) function code(x, y, z, t, a) return Float64(y * x) end
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = y * x;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
y \cdot x
\end{array}
Initial program 59.1%
associate-*l*56.0%
associate-*r/58.0%
*-commutative58.0%
associate-/l*60.9%
Simplified60.9%
Taylor expanded in z around inf 41.1%
*-commutative41.1%
Simplified41.1%
Final simplification41.1%
(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 2023271
(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)))))