
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (pow B_m 2.0)))
(t_1
(/
(sqrt
(*
(- (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))) (+ A C))
(* 2.0 (* F t_0))))
t_0))
(t_2 (fma C (* A -4.0) (pow B_m 2.0)))
(t_3 (* 2.0 t_2))
(t_4 (- t_2)))
(if (<= t_1 (- INFINITY))
(-
(pow
(*
(sqrt (/ (sqrt 2.0) B_m))
(exp (* 0.25 (+ (log (* -0.5 (/ F C))) (* 2.0 (log B_m))))))
2.0))
(if (<= t_1 -5e-166)
(/ (* (sqrt (* F (+ A (- C (hypot B_m (- A C)))))) (sqrt t_3)) t_4)
(if (<= t_1 1e-168)
(/ (sqrt (* F (* t_3 (+ A (+ A (* -0.5 (/ (pow B_m 2.0) C))))))) t_4)
(if (<= t_1 INFINITY)
(/ (* (sqrt (* t_3 (- (+ A C) (hypot (- A C) B_m)))) (sqrt F)) t_4)
(/ (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (- B_m))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - pow(B_m, 2.0);
double t_1 = sqrt(((sqrt((pow(B_m, 2.0) + pow((A - C), 2.0))) - (A + C)) * (2.0 * (F * t_0)))) / t_0;
double t_2 = fma(C, (A * -4.0), pow(B_m, 2.0));
double t_3 = 2.0 * t_2;
double t_4 = -t_2;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = -pow((sqrt((sqrt(2.0) / B_m)) * exp((0.25 * (log((-0.5 * (F / C))) + (2.0 * log(B_m)))))), 2.0);
} else if (t_1 <= -5e-166) {
tmp = (sqrt((F * (A + (C - hypot(B_m, (A - C)))))) * sqrt(t_3)) / t_4;
} else if (t_1 <= 1e-168) {
tmp = sqrt((F * (t_3 * (A + (A + (-0.5 * (pow(B_m, 2.0) / C))))))) / t_4;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (sqrt((t_3 * ((A + C) - hypot((A - C), B_m)))) * sqrt(F)) / t_4;
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0)) t_1 = Float64(sqrt(Float64(Float64(sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))) - Float64(A + C)) * Float64(2.0 * Float64(F * t_0)))) / t_0) t_2 = fma(C, Float64(A * -4.0), (B_m ^ 2.0)) t_3 = Float64(2.0 * t_2) t_4 = Float64(-t_2) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(-(Float64(sqrt(Float64(sqrt(2.0) / B_m)) * exp(Float64(0.25 * Float64(log(Float64(-0.5 * Float64(F / C))) + Float64(2.0 * log(B_m)))))) ^ 2.0)); elseif (t_1 <= -5e-166) tmp = Float64(Float64(sqrt(Float64(F * Float64(A + Float64(C - hypot(B_m, Float64(A - C)))))) * sqrt(t_3)) / t_4); elseif (t_1 <= 1e-168) tmp = Float64(sqrt(Float64(F * Float64(t_3 * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C))))))) / t_4); elseif (t_1 <= Inf) tmp = Float64(Float64(sqrt(Float64(t_3 * Float64(Float64(A + C) - hypot(Float64(A - C), B_m)))) * sqrt(F)) / t_4); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) / Float64(-B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(A + C), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = (-t$95$2)}, If[LessEqual[t$95$1, (-Infinity)], (-N[Power[N[(N[Sqrt[N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(0.25 * N[(N[Log[N[(-0.5 * N[(F / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), If[LessEqual[t$95$1, -5e-166], N[(N[(N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[t$95$1, 1e-168], N[(N[Sqrt[N[(F * N[(t$95$3 * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[Sqrt[N[(t$95$3 * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - {B\_m}^{2}\\
t_1 := \frac{\sqrt{\left(\sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}} - \left(A + C\right)\right) \cdot \left(2 \cdot \left(F \cdot t\_0\right)\right)}}{t\_0}\\
t_2 := \mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)\\
t_3 := 2 \cdot t\_2\\
t_4 := -t\_2\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;-{\left(\sqrt{\frac{\sqrt{2}}{B\_m}} \cdot e^{0.25 \cdot \left(\log \left(-0.5 \cdot \frac{F}{C}\right) + 2 \cdot \log B\_m\right)}\right)}^{2}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)} \cdot \sqrt{t\_3}}{t\_4}\\
\mathbf{elif}\;t\_1 \leq 10^{-168}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(t\_3 \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)\right)}}{t\_4}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t\_3 \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(A - C, B\_m\right)\right)} \cdot \sqrt{F}}{t\_4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -inf.0Initial program 3.1%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
+-commutative8.6%
unpow28.6%
unpow28.6%
hypot-define9.2%
Simplified9.2%
add-sqr-sqrt8.8%
pow28.8%
associate-*l/8.8%
pow1/28.8%
pow1/28.8%
pow-prod-down8.8%
Applied egg-rr8.8%
unpow1/28.8%
Simplified8.8%
Taylor expanded in B around 0 2.6%
if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -5e-166Initial program 94.8%
Simplified77.5%
pow1/277.5%
associate-*r*94.7%
unpow-prod-down98.0%
associate-+r-98.0%
hypot-undefine98.0%
unpow298.0%
unpow298.0%
+-commutative98.0%
unpow298.0%
unpow298.0%
hypot-define98.0%
pow1/298.0%
Applied egg-rr98.0%
unpow1/298.0%
associate-+r-98.0%
hypot-undefine98.0%
unpow298.0%
unpow298.0%
+-commutative98.0%
unpow298.0%
unpow298.0%
hypot-undefine98.0%
Simplified98.0%
if -5e-166 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < 1e-168Initial program 24.6%
Simplified23.8%
Taylor expanded in C around inf 31.0%
mul-1-neg31.0%
Simplified31.0%
if 1e-168 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0Initial program 29.7%
Simplified48.8%
pow1/248.8%
*-commutative48.8%
unpow-prod-down73.5%
Applied egg-rr73.5%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
Taylor expanded in A around 0 3.4%
mul-1-neg3.4%
+-commutative3.4%
unpow23.4%
unpow23.4%
hypot-define22.1%
Simplified22.1%
neg-sub022.1%
associate-*l/22.1%
pow1/222.1%
pow1/222.1%
pow-prod-down22.2%
Applied egg-rr22.2%
neg-sub022.2%
distribute-neg-frac222.2%
unpow1/222.1%
Simplified22.1%
Final simplification32.8%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (pow B_m 2.0)))
(t_1
(/
(sqrt
(*
(- (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))) (+ A C))
(* 2.0 (* F t_0))))
t_0))
(t_2 (fma C (* A -4.0) (pow B_m 2.0)))
(t_3 (* 2.0 t_2))
(t_4 (- t_2)))
(if (<= t_1 (- INFINITY))
(-
(pow
(*
(sqrt (/ (sqrt 2.0) B_m))
(exp (* 0.25 (+ (log (* -0.5 (/ F C))) (* 2.0 (log B_m))))))
2.0))
(if (<= t_1 -5e-166)
(/ (* (sqrt (* F (+ A (- C (hypot B_m (- A C)))))) (sqrt t_3)) t_4)
(if (<= t_1 INFINITY)
(/ (sqrt (* F (* t_3 (+ A (+ A (* -0.5 (/ (pow B_m 2.0) C))))))) t_4)
(/ (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (- B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - pow(B_m, 2.0);
double t_1 = sqrt(((sqrt((pow(B_m, 2.0) + pow((A - C), 2.0))) - (A + C)) * (2.0 * (F * t_0)))) / t_0;
double t_2 = fma(C, (A * -4.0), pow(B_m, 2.0));
double t_3 = 2.0 * t_2;
double t_4 = -t_2;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = -pow((sqrt((sqrt(2.0) / B_m)) * exp((0.25 * (log((-0.5 * (F / C))) + (2.0 * log(B_m)))))), 2.0);
} else if (t_1 <= -5e-166) {
tmp = (sqrt((F * (A + (C - hypot(B_m, (A - C)))))) * sqrt(t_3)) / t_4;
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((F * (t_3 * (A + (A + (-0.5 * (pow(B_m, 2.0) / C))))))) / t_4;
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0)) t_1 = Float64(sqrt(Float64(Float64(sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))) - Float64(A + C)) * Float64(2.0 * Float64(F * t_0)))) / t_0) t_2 = fma(C, Float64(A * -4.0), (B_m ^ 2.0)) t_3 = Float64(2.0 * t_2) t_4 = Float64(-t_2) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(-(Float64(sqrt(Float64(sqrt(2.0) / B_m)) * exp(Float64(0.25 * Float64(log(Float64(-0.5 * Float64(F / C))) + Float64(2.0 * log(B_m)))))) ^ 2.0)); elseif (t_1 <= -5e-166) tmp = Float64(Float64(sqrt(Float64(F * Float64(A + Float64(C - hypot(B_m, Float64(A - C)))))) * sqrt(t_3)) / t_4); elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(F * Float64(t_3 * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C))))))) / t_4); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) / Float64(-B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(A + C), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = (-t$95$2)}, If[LessEqual[t$95$1, (-Infinity)], (-N[Power[N[(N[Sqrt[N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(0.25 * N[(N[Log[N[(-0.5 * N[(F / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), If[LessEqual[t$95$1, -5e-166], N[(N[(N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(F * N[(t$95$3 * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$4), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - {B\_m}^{2}\\
t_1 := \frac{\sqrt{\left(\sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}} - \left(A + C\right)\right) \cdot \left(2 \cdot \left(F \cdot t\_0\right)\right)}}{t\_0}\\
t_2 := \mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)\\
t_3 := 2 \cdot t\_2\\
t_4 := -t\_2\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;-{\left(\sqrt{\frac{\sqrt{2}}{B\_m}} \cdot e^{0.25 \cdot \left(\log \left(-0.5 \cdot \frac{F}{C}\right) + 2 \cdot \log B\_m\right)}\right)}^{2}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)} \cdot \sqrt{t\_3}}{t\_4}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(t\_3 \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)\right)}}{t\_4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -inf.0Initial program 3.1%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
+-commutative8.6%
unpow28.6%
unpow28.6%
hypot-define9.2%
Simplified9.2%
add-sqr-sqrt8.8%
pow28.8%
associate-*l/8.8%
pow1/28.8%
pow1/28.8%
pow-prod-down8.8%
Applied egg-rr8.8%
unpow1/28.8%
Simplified8.8%
Taylor expanded in B around 0 2.6%
if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -5e-166Initial program 94.8%
Simplified77.5%
pow1/277.5%
associate-*r*94.7%
unpow-prod-down98.0%
associate-+r-98.0%
hypot-undefine98.0%
unpow298.0%
unpow298.0%
+-commutative98.0%
unpow298.0%
unpow298.0%
hypot-define98.0%
pow1/298.0%
Applied egg-rr98.0%
unpow1/298.0%
associate-+r-98.0%
hypot-undefine98.0%
unpow298.0%
unpow298.0%
+-commutative98.0%
unpow298.0%
unpow298.0%
hypot-undefine98.0%
Simplified98.0%
if -5e-166 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0Initial program 26.0%
Simplified30.5%
Taylor expanded in C around inf 32.4%
mul-1-neg32.4%
Simplified32.4%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
Taylor expanded in A around 0 3.4%
mul-1-neg3.4%
+-commutative3.4%
unpow23.4%
unpow23.4%
hypot-define22.1%
Simplified22.1%
neg-sub022.1%
associate-*l/22.1%
pow1/222.1%
pow1/222.1%
pow-prod-down22.2%
Applied egg-rr22.2%
neg-sub022.2%
distribute-neg-frac222.2%
unpow1/222.1%
Simplified22.1%
Final simplification30.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (* (* 4.0 A) C) (pow B_m 2.0)))
(t_1
(/
(sqrt
(*
(- (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))) (+ A C))
(* 2.0 (* F t_0))))
t_0))
(t_2 (fma B_m B_m (* A (* C -4.0))))
(t_3 (fma C (* A -4.0) (pow B_m 2.0))))
(if (<= t_1 (- INFINITY))
(-
(pow
(*
(sqrt (/ (sqrt 2.0) B_m))
(exp (* 0.25 (+ (log (* -0.5 (/ F C))) (* 2.0 (log B_m))))))
2.0))
(if (<= t_1 -5e-166)
(/ (sqrt (* (* F t_2) (* 2.0 (+ A (- C (hypot B_m (- A C))))))) (- t_2))
(if (<= t_1 INFINITY)
(/
(sqrt (* F (* (* 2.0 t_3) (+ A (+ A (* -0.5 (/ (pow B_m 2.0) C)))))))
(- t_3))
(/ (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (- B_m)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = ((4.0 * A) * C) - pow(B_m, 2.0);
double t_1 = sqrt(((sqrt((pow(B_m, 2.0) + pow((A - C), 2.0))) - (A + C)) * (2.0 * (F * t_0)))) / t_0;
double t_2 = fma(B_m, B_m, (A * (C * -4.0)));
double t_3 = fma(C, (A * -4.0), pow(B_m, 2.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = -pow((sqrt((sqrt(2.0) / B_m)) * exp((0.25 * (log((-0.5 * (F / C))) + (2.0 * log(B_m)))))), 2.0);
} else if (t_1 <= -5e-166) {
tmp = sqrt(((F * t_2) * (2.0 * (A + (C - hypot(B_m, (A - C))))))) / -t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((F * ((2.0 * t_3) * (A + (A + (-0.5 * (pow(B_m, 2.0) / C))))))) / -t_3;
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0)) t_1 = Float64(sqrt(Float64(Float64(sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))) - Float64(A + C)) * Float64(2.0 * Float64(F * t_0)))) / t_0) t_2 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_3 = fma(C, Float64(A * -4.0), (B_m ^ 2.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(-(Float64(sqrt(Float64(sqrt(2.0) / B_m)) * exp(Float64(0.25 * Float64(log(Float64(-0.5 * Float64(F / C))) + Float64(2.0 * log(B_m)))))) ^ 2.0)); elseif (t_1 <= -5e-166) tmp = Float64(sqrt(Float64(Float64(F * t_2) * Float64(2.0 * Float64(A + Float64(C - hypot(B_m, Float64(A - C))))))) / Float64(-t_2)); elseif (t_1 <= Inf) tmp = Float64(sqrt(Float64(F * Float64(Float64(2.0 * t_3) * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C))))))) / Float64(-t_3)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) / Float64(-B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(A + C), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], (-N[Power[N[(N[Sqrt[N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(0.25 * N[(N[Log[N[(-0.5 * N[(F / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), If[LessEqual[t$95$1, -5e-166], N[(N[Sqrt[N[(N[(F * t$95$2), $MachinePrecision] * N[(2.0 * N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$2)), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(F * N[(N[(2.0 * t$95$3), $MachinePrecision] * N[(A + N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$3)), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - {B\_m}^{2}\\
t_1 := \frac{\sqrt{\left(\sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}} - \left(A + C\right)\right) \cdot \left(2 \cdot \left(F \cdot t\_0\right)\right)}}{t\_0}\\
t_2 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_3 := \mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;-{\left(\sqrt{\frac{\sqrt{2}}{B\_m}} \cdot e^{0.25 \cdot \left(\log \left(-0.5 \cdot \frac{F}{C}\right) + 2 \cdot \log B\_m\right)}\right)}^{2}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot t\_2\right) \cdot \left(2 \cdot \left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{-t\_2}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(\left(2 \cdot t\_3\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)\right)}}{-t\_3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -inf.0Initial program 3.1%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
+-commutative8.6%
unpow28.6%
unpow28.6%
hypot-define9.2%
Simplified9.2%
add-sqr-sqrt8.8%
pow28.8%
associate-*l/8.8%
pow1/28.8%
pow1/28.8%
pow-prod-down8.8%
Applied egg-rr8.8%
unpow1/28.8%
Simplified8.8%
Taylor expanded in B around 0 2.6%
if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -5e-166Initial program 94.8%
Simplified94.8%
if -5e-166 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0Initial program 26.0%
Simplified30.5%
Taylor expanded in C around inf 32.4%
mul-1-neg32.4%
Simplified32.4%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) Initial program 0.0%
Taylor expanded in A around 0 3.4%
mul-1-neg3.4%
+-commutative3.4%
unpow23.4%
unpow23.4%
hypot-define22.1%
Simplified22.1%
neg-sub022.1%
associate-*l/22.1%
pow1/222.1%
pow1/222.1%
pow-prod-down22.2%
Applied egg-rr22.2%
neg-sub022.2%
distribute-neg-frac222.2%
unpow1/222.1%
Simplified22.1%
Final simplification30.2%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))) (t_1 (sqrt (/ (sqrt 2.0) B_m))))
(if (<= (pow B_m 2.0) 5e-39)
(/ (/ (sqrt (* 4.0 (* t_0 (* A F)))) t_0) -1.0)
(if (<= (pow B_m 2.0) 1e+122)
(*
(sqrt (* (* F t_0) (* 2.0 (- (+ A C) (hypot (- A C) B_m)))))
(/ -1.0 t_0))
(if (<= (pow B_m 2.0) 2e+193)
(-
(pow
(* t_1 (exp (* 0.25 (+ (log (* -0.5 (/ F C))) (* 2.0 (log B_m))))))
2.0))
(-
(pow
(* t_1 (exp (* 0.25 (- (log (- F)) (log (/ 1.0 B_m))))))
2.0)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = sqrt((sqrt(2.0) / B_m));
double tmp;
if (pow(B_m, 2.0) <= 5e-39) {
tmp = (sqrt((4.0 * (t_0 * (A * F)))) / t_0) / -1.0;
} else if (pow(B_m, 2.0) <= 1e+122) {
tmp = sqrt(((F * t_0) * (2.0 * ((A + C) - hypot((A - C), B_m))))) * (-1.0 / t_0);
} else if (pow(B_m, 2.0) <= 2e+193) {
tmp = -pow((t_1 * exp((0.25 * (log((-0.5 * (F / C))) + (2.0 * log(B_m)))))), 2.0);
} else {
tmp = -pow((t_1 * exp((0.25 * (log(-F) - log((1.0 / B_m)))))), 2.0);
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = sqrt(Float64(sqrt(2.0) / B_m)) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-39) tmp = Float64(Float64(sqrt(Float64(4.0 * Float64(t_0 * Float64(A * F)))) / t_0) / -1.0); elseif ((B_m ^ 2.0) <= 1e+122) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(Float64(A + C) - hypot(Float64(A - C), B_m))))) * Float64(-1.0 / t_0)); elseif ((B_m ^ 2.0) <= 2e+193) tmp = Float64(-(Float64(t_1 * exp(Float64(0.25 * Float64(log(Float64(-0.5 * Float64(F / C))) + Float64(2.0 * log(B_m)))))) ^ 2.0)); else tmp = Float64(-(Float64(t_1 * exp(Float64(0.25 * Float64(log(Float64(-F)) - log(Float64(1.0 / B_m)))))) ^ 2.0)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-39], N[(N[(N[Sqrt[N[(4.0 * N[(t$95$0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / -1.0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+122], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+193], (-N[Power[N[(t$95$1 * N[Exp[N[(0.25 * N[(N[Log[N[(-0.5 * N[(F / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(2.0 * N[Log[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), (-N[Power[N[(t$95$1 * N[Exp[N[(0.25 * N[(N[Log[(-F)], $MachinePrecision] - N[Log[N[(1.0 / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision])]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \sqrt{\frac{\sqrt{2}}{B\_m}}\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\sqrt{4 \cdot \left(t\_0 \cdot \left(A \cdot F\right)\right)}}{t\_0}}{-1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+122}:\\
\;\;\;\;\sqrt{\left(F \cdot t\_0\right) \cdot \left(2 \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(A - C, B\_m\right)\right)\right)} \cdot \frac{-1}{t\_0}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+193}:\\
\;\;\;\;-{\left(t\_1 \cdot e^{0.25 \cdot \left(\log \left(-0.5 \cdot \frac{F}{C}\right) + 2 \cdot \log B\_m\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;-{\left(t\_1 \cdot e^{0.25 \cdot \left(\log \left(-F\right) - \log \left(\frac{1}{B\_m}\right)\right)}\right)}^{2}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 4.9999999999999998e-39Initial program 19.8%
Simplified26.4%
add-cbrt-cube20.5%
pow320.5%
Applied egg-rr22.9%
Taylor expanded in A around -inf 14.5%
Applied egg-rr20.0%
associate-*l/20.0%
associate-*r/20.0%
pow-sqr20.0%
metadata-eval20.0%
unpow1/219.9%
associate-*l*19.9%
associate-*r*20.6%
Simplified20.6%
if 4.9999999999999998e-39 < (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e122Initial program 45.8%
Simplified54.1%
div-inv54.1%
Applied egg-rr56.2%
if 1.00000000000000001e122 < (pow.f64 B #s(literal 2 binary64)) < 2.00000000000000013e193Initial program 2.1%
Taylor expanded in A around 0 2.5%
mul-1-neg2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-define10.4%
Simplified10.4%
add-sqr-sqrt10.2%
pow210.2%
associate-*l/10.2%
pow1/210.2%
pow1/210.2%
pow-prod-down10.2%
Applied egg-rr10.2%
unpow1/210.2%
Simplified10.2%
Taylor expanded in B around 0 15.1%
if 2.00000000000000013e193 < (pow.f64 B #s(literal 2 binary64)) Initial program 7.9%
Taylor expanded in A around 0 10.4%
mul-1-neg10.4%
+-commutative10.4%
unpow210.4%
unpow210.4%
hypot-define28.7%
Simplified28.7%
add-sqr-sqrt27.6%
pow227.6%
associate-*l/27.6%
pow1/227.6%
pow1/227.6%
pow-prod-down27.6%
Applied egg-rr27.6%
unpow1/227.6%
Simplified27.6%
Taylor expanded in B around inf 36.0%
Final simplification30.5%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 5e-39)
(/ (/ (sqrt (* 4.0 (* t_0 (* A F)))) t_0) -1.0)
(if (<= (pow B_m 2.0) 1e+122)
(*
(sqrt (* (* F t_0) (* 2.0 (- (+ A C) (hypot (- A C) B_m)))))
(/ -1.0 t_0))
(if (<= (pow B_m 2.0) 2e+193)
(/ (sqrt (* (pow B_m 2.0) (/ F (- C)))) (- B_m))
(-
(pow
(*
(sqrt (/ (sqrt 2.0) B_m))
(exp (* 0.25 (- (log (- F)) (log (/ 1.0 B_m))))))
2.0)))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 5e-39) {
tmp = (sqrt((4.0 * (t_0 * (A * F)))) / t_0) / -1.0;
} else if (pow(B_m, 2.0) <= 1e+122) {
tmp = sqrt(((F * t_0) * (2.0 * ((A + C) - hypot((A - C), B_m))))) * (-1.0 / t_0);
} else if (pow(B_m, 2.0) <= 2e+193) {
tmp = sqrt((pow(B_m, 2.0) * (F / -C))) / -B_m;
} else {
tmp = -pow((sqrt((sqrt(2.0) / B_m)) * exp((0.25 * (log(-F) - log((1.0 / B_m)))))), 2.0);
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-39) tmp = Float64(Float64(sqrt(Float64(4.0 * Float64(t_0 * Float64(A * F)))) / t_0) / -1.0); elseif ((B_m ^ 2.0) <= 1e+122) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(Float64(A + C) - hypot(Float64(A - C), B_m))))) * Float64(-1.0 / t_0)); elseif ((B_m ^ 2.0) <= 2e+193) tmp = Float64(sqrt(Float64((B_m ^ 2.0) * Float64(F / Float64(-C)))) / Float64(-B_m)); else tmp = Float64(-(Float64(sqrt(Float64(sqrt(2.0) / B_m)) * exp(Float64(0.25 * Float64(log(Float64(-F)) - log(Float64(1.0 / B_m)))))) ^ 2.0)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-39], N[(N[(N[Sqrt[N[(4.0 * N[(t$95$0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / -1.0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+122], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+193], N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] * N[(F / (-C)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], (-N[Power[N[(N[Sqrt[N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(0.25 * N[(N[Log[(-F)], $MachinePrecision] - N[Log[N[(1.0 / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision])]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\sqrt{4 \cdot \left(t\_0 \cdot \left(A \cdot F\right)\right)}}{t\_0}}{-1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+122}:\\
\;\;\;\;\sqrt{\left(F \cdot t\_0\right) \cdot \left(2 \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(A - C, B\_m\right)\right)\right)} \cdot \frac{-1}{t\_0}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+193}:\\
\;\;\;\;\frac{\sqrt{{B\_m}^{2} \cdot \frac{F}{-C}}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;-{\left(\sqrt{\frac{\sqrt{2}}{B\_m}} \cdot e^{0.25 \cdot \left(\log \left(-F\right) - \log \left(\frac{1}{B\_m}\right)\right)}\right)}^{2}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 4.9999999999999998e-39Initial program 19.8%
Simplified26.4%
add-cbrt-cube20.5%
pow320.5%
Applied egg-rr22.9%
Taylor expanded in A around -inf 14.5%
Applied egg-rr20.0%
associate-*l/20.0%
associate-*r/20.0%
pow-sqr20.0%
metadata-eval20.0%
unpow1/219.9%
associate-*l*19.9%
associate-*r*20.6%
Simplified20.6%
if 4.9999999999999998e-39 < (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e122Initial program 45.8%
Simplified54.1%
div-inv54.1%
Applied egg-rr56.2%
if 1.00000000000000001e122 < (pow.f64 B #s(literal 2 binary64)) < 2.00000000000000013e193Initial program 2.1%
Taylor expanded in A around 0 2.5%
mul-1-neg2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-define10.4%
Simplified10.4%
neg-sub010.4%
associate-*l/10.4%
pow1/210.4%
pow1/210.4%
pow-prod-down10.4%
Applied egg-rr10.4%
neg-sub010.4%
distribute-neg-frac210.4%
unpow1/210.4%
Simplified10.4%
Taylor expanded in C around inf 18.0%
mul-1-neg18.0%
associate-/l*16.4%
Simplified16.4%
if 2.00000000000000013e193 < (pow.f64 B #s(literal 2 binary64)) Initial program 7.9%
Taylor expanded in A around 0 10.4%
mul-1-neg10.4%
+-commutative10.4%
unpow210.4%
unpow210.4%
hypot-define28.7%
Simplified28.7%
add-sqr-sqrt27.6%
pow227.6%
associate-*l/27.6%
pow1/227.6%
pow1/227.6%
pow-prod-down27.6%
Applied egg-rr27.6%
unpow1/227.6%
Simplified27.6%
Taylor expanded in B around inf 36.0%
Final simplification30.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 5e-39)
(/ (/ (sqrt (* 4.0 (* t_0 (* A F)))) t_0) -1.0)
(if (<= (pow B_m 2.0) 1e+122)
(*
(sqrt (* (* F t_0) (* 2.0 (- (+ A C) (hypot (- A C) B_m)))))
(/ -1.0 t_0))
(if (<= (pow B_m 2.0) 2e+193)
(/ (sqrt (* (pow B_m 2.0) (/ F (- C)))) (- B_m))
(- (sqrt (* -2.0 (/ F B_m)))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 5e-39) {
tmp = (sqrt((4.0 * (t_0 * (A * F)))) / t_0) / -1.0;
} else if (pow(B_m, 2.0) <= 1e+122) {
tmp = sqrt(((F * t_0) * (2.0 * ((A + C) - hypot((A - C), B_m))))) * (-1.0 / t_0);
} else if (pow(B_m, 2.0) <= 2e+193) {
tmp = sqrt((pow(B_m, 2.0) * (F / -C))) / -B_m;
} else {
tmp = -sqrt((-2.0 * (F / B_m)));
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-39) tmp = Float64(Float64(sqrt(Float64(4.0 * Float64(t_0 * Float64(A * F)))) / t_0) / -1.0); elseif ((B_m ^ 2.0) <= 1e+122) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(Float64(A + C) - hypot(Float64(A - C), B_m))))) * Float64(-1.0 / t_0)); elseif ((B_m ^ 2.0) <= 2e+193) tmp = Float64(sqrt(Float64((B_m ^ 2.0) * Float64(F / Float64(-C)))) / Float64(-B_m)); else tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-39], N[(N[(N[Sqrt[N[(4.0 * N[(t$95$0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / -1.0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+122], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+193], N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] * N[(F / (-C)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\sqrt{4 \cdot \left(t\_0 \cdot \left(A \cdot F\right)\right)}}{t\_0}}{-1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{+122}:\\
\;\;\;\;\sqrt{\left(F \cdot t\_0\right) \cdot \left(2 \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(A - C, B\_m\right)\right)\right)} \cdot \frac{-1}{t\_0}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+193}:\\
\;\;\;\;\frac{\sqrt{{B\_m}^{2} \cdot \frac{F}{-C}}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 4.9999999999999998e-39Initial program 19.8%
Simplified26.4%
add-cbrt-cube20.5%
pow320.5%
Applied egg-rr22.9%
Taylor expanded in A around -inf 14.5%
Applied egg-rr20.0%
associate-*l/20.0%
associate-*r/20.0%
pow-sqr20.0%
metadata-eval20.0%
unpow1/219.9%
associate-*l*19.9%
associate-*r*20.6%
Simplified20.6%
if 4.9999999999999998e-39 < (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e122Initial program 45.8%
Simplified54.1%
div-inv54.1%
Applied egg-rr56.2%
if 1.00000000000000001e122 < (pow.f64 B #s(literal 2 binary64)) < 2.00000000000000013e193Initial program 2.1%
Taylor expanded in A around 0 2.5%
mul-1-neg2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-define10.4%
Simplified10.4%
neg-sub010.4%
associate-*l/10.4%
pow1/210.4%
pow1/210.4%
pow-prod-down10.4%
Applied egg-rr10.4%
neg-sub010.4%
distribute-neg-frac210.4%
unpow1/210.4%
Simplified10.4%
Taylor expanded in C around inf 18.0%
mul-1-neg18.0%
associate-/l*16.4%
Simplified16.4%
if 2.00000000000000013e193 < (pow.f64 B #s(literal 2 binary64)) Initial program 7.9%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.2%
Simplified2.2%
Taylor expanded in F around 0 2.2%
Applied egg-rr29.9%
neg-sub029.9%
Simplified29.9%
Final simplification28.7%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 1.62e-16)
(/ (/ (sqrt (* 4.0 (* t_0 (* A F)))) t_0) -1.0)
(/ (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (- B_m)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 1.62e-16) {
tmp = (sqrt((4.0 * (t_0 * (A * F)))) / t_0) / -1.0;
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 1.62e-16) tmp = Float64(Float64(sqrt(Float64(4.0 * Float64(t_0 * Float64(A * F)))) / t_0) / -1.0); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) / Float64(-B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.62e-16], N[(N[(N[Sqrt[N[(4.0 * N[(t$95$0 * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / -1.0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B\_m \leq 1.62 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{\sqrt{4 \cdot \left(t\_0 \cdot \left(A \cdot F\right)\right)}}{t\_0}}{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if B < 1.61999999999999995e-16Initial program 19.1%
Simplified24.6%
add-cbrt-cube19.1%
pow319.1%
Applied egg-rr21.2%
Taylor expanded in A around -inf 9.8%
Applied egg-rr13.6%
associate-*l/13.6%
associate-*r/13.6%
pow-sqr13.6%
metadata-eval13.6%
unpow1/213.5%
associate-*l*13.4%
associate-*r*13.9%
Simplified13.9%
if 1.61999999999999995e-16 < B Initial program 18.2%
Taylor expanded in A around 0 20.6%
mul-1-neg20.6%
+-commutative20.6%
unpow220.6%
unpow220.6%
hypot-define44.4%
Simplified44.4%
neg-sub044.4%
associate-*l/44.4%
pow1/244.4%
pow1/244.4%
pow-prod-down44.5%
Applied egg-rr44.5%
neg-sub044.5%
distribute-neg-frac244.5%
unpow1/244.5%
Simplified44.5%
Final simplification22.3%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 1.56e-12)
(/ (sqrt (* (* 4.0 A) (* F t_0))) (- t_0))
(/ (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (- B_m)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 1.56e-12) {
tmp = sqrt(((4.0 * A) * (F * t_0))) / -t_0;
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 1.56e-12) tmp = Float64(sqrt(Float64(Float64(4.0 * A) * Float64(F * t_0))) / Float64(-t_0)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) / Float64(-B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.56e-12], N[(N[Sqrt[N[(N[(4.0 * A), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B\_m \leq 1.56 \cdot 10^{-12}:\\
\;\;\;\;\frac{\sqrt{\left(4 \cdot A\right) \cdot \left(F \cdot t\_0\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if B < 1.56000000000000002e-12Initial program 18.9%
Simplified25.3%
Taylor expanded in A around -inf 14.1%
if 1.56000000000000002e-12 < B Initial program 18.9%
Taylor expanded in A around 0 21.4%
mul-1-neg21.4%
+-commutative21.4%
unpow221.4%
unpow221.4%
hypot-define46.3%
Simplified46.3%
neg-sub046.3%
associate-*l/46.3%
pow1/246.3%
pow1/246.3%
pow-prod-down46.5%
Applied egg-rr46.5%
neg-sub046.5%
distribute-neg-frac246.5%
unpow1/246.5%
Simplified46.5%
Final simplification22.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 1.92e-19)
(/
(sqrt (* -8.0 (* A (* C (* F (+ A A))))))
(- (fma B_m B_m (* A (* C -4.0)))))
(/ (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (- B_m))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 1.92e-19) {
tmp = sqrt((-8.0 * (A * (C * (F * (A + A)))))) / -fma(B_m, B_m, (A * (C * -4.0)));
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 1.92e-19) tmp = Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A + A)))))) / Float64(-fma(B_m, B_m, Float64(A * Float64(C * -4.0))))); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) / Float64(-B_m)); end return tmp end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.92e-19], N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.92 \cdot 10^{-19}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if B < 1.91999999999999994e-19Initial program 19.1%
Simplified24.6%
Taylor expanded in B around 0 14.8%
Taylor expanded in C around inf 11.6%
mul-1-neg11.6%
Simplified11.6%
if 1.91999999999999994e-19 < B Initial program 18.2%
Taylor expanded in A around 0 20.6%
mul-1-neg20.6%
+-commutative20.6%
unpow220.6%
unpow220.6%
hypot-define44.4%
Simplified44.4%
neg-sub044.4%
associate-*l/44.4%
pow1/244.4%
pow1/244.4%
pow-prod-down44.5%
Applied egg-rr44.5%
neg-sub044.5%
distribute-neg-frac244.5%
unpow1/244.5%
Simplified44.5%
Final simplification20.6%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= F -9.2e-47)
(- (sqrt (* -2.0 (/ F B_m))))
(if (<= F -5.9e-304)
(/ (sqrt (* -2.0 (* B_m F))) (- B_m))
(/ (sqrt (* (* F (- C (hypot C B_m))) -2.0)) B_m))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -9.2e-47) {
tmp = -sqrt((-2.0 * (F / B_m)));
} else if (F <= -5.9e-304) {
tmp = sqrt((-2.0 * (B_m * F))) / -B_m;
} else {
tmp = sqrt(((F * (C - hypot(C, B_m))) * -2.0)) / B_m;
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -9.2e-47) {
tmp = -Math.sqrt((-2.0 * (F / B_m)));
} else if (F <= -5.9e-304) {
tmp = Math.sqrt((-2.0 * (B_m * F))) / -B_m;
} else {
tmp = Math.sqrt(((F * (C - Math.hypot(C, B_m))) * -2.0)) / B_m;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if F <= -9.2e-47: tmp = -math.sqrt((-2.0 * (F / B_m))) elif F <= -5.9e-304: tmp = math.sqrt((-2.0 * (B_m * F))) / -B_m else: tmp = math.sqrt(((F * (C - math.hypot(C, B_m))) * -2.0)) / B_m return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (F <= -9.2e-47) tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); elseif (F <= -5.9e-304) tmp = Float64(sqrt(Float64(-2.0 * Float64(B_m * F))) / Float64(-B_m)); else tmp = Float64(sqrt(Float64(Float64(F * Float64(C - hypot(C, B_m))) * -2.0)) / B_m); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (F <= -9.2e-47)
tmp = -sqrt((-2.0 * (F / B_m)));
elseif (F <= -5.9e-304)
tmp = sqrt((-2.0 * (B_m * F))) / -B_m;
else
tmp = sqrt(((F * (C - hypot(C, B_m))) * -2.0)) / B_m;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -9.2e-47], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[F, -5.9e-304], N[(N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[N[(N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.2 \cdot 10^{-47}:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\mathbf{elif}\;F \leq -5.9 \cdot 10^{-304}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right) \cdot -2}}{B\_m}\\
\end{array}
\end{array}
if F < -9.19999999999999928e-47Initial program 15.7%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.1%
Simplified1.1%
Taylor expanded in F around 0 1.1%
Applied egg-rr17.2%
neg-sub017.2%
Simplified17.2%
if -9.19999999999999928e-47 < F < -5.9000000000000001e-304Initial program 18.3%
Taylor expanded in A around 0 10.3%
mul-1-neg10.3%
+-commutative10.3%
unpow210.3%
unpow210.3%
hypot-define26.3%
Simplified26.3%
neg-sub026.3%
associate-*l/26.3%
pow1/226.3%
pow1/226.3%
pow-prod-down26.3%
Applied egg-rr26.3%
neg-sub026.3%
distribute-neg-frac226.3%
unpow1/226.3%
Simplified26.3%
Taylor expanded in C around 0 25.4%
if -5.9000000000000001e-304 < F Initial program 27.0%
Taylor expanded in A around 0 15.1%
mul-1-neg15.1%
+-commutative15.1%
unpow215.1%
unpow215.1%
hypot-define26.2%
Simplified26.2%
neg-sub026.2%
associate-*l/26.2%
pow1/226.2%
pow1/226.4%
pow-prod-down26.4%
Applied egg-rr26.4%
neg-sub026.4%
distribute-neg-frac226.4%
unpow1/226.2%
Simplified26.2%
Applied egg-rr28.6%
*-lft-identity28.6%
Simplified28.6%
Final simplification22.2%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= F -1.55e-46)
(- (sqrt (* -2.0 (/ F B_m))))
(if (<= F -5.9e-304)
(/ (sqrt (* -2.0 (* B_m F))) (- B_m))
(/ (sqrt (* (pow B_m 2.0) (/ F (- C)))) (- B_m)))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -1.55e-46) {
tmp = -sqrt((-2.0 * (F / B_m)));
} else if (F <= -5.9e-304) {
tmp = sqrt((-2.0 * (B_m * F))) / -B_m;
} else {
tmp = sqrt((pow(B_m, 2.0) * (F / -C))) / -B_m;
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= (-1.55d-46)) then
tmp = -sqrt(((-2.0d0) * (f / b_m)))
else if (f <= (-5.9d-304)) then
tmp = sqrt(((-2.0d0) * (b_m * f))) / -b_m
else
tmp = sqrt(((b_m ** 2.0d0) * (f / -c))) / -b_m
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -1.55e-46) {
tmp = -Math.sqrt((-2.0 * (F / B_m)));
} else if (F <= -5.9e-304) {
tmp = Math.sqrt((-2.0 * (B_m * F))) / -B_m;
} else {
tmp = Math.sqrt((Math.pow(B_m, 2.0) * (F / -C))) / -B_m;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if F <= -1.55e-46: tmp = -math.sqrt((-2.0 * (F / B_m))) elif F <= -5.9e-304: tmp = math.sqrt((-2.0 * (B_m * F))) / -B_m else: tmp = math.sqrt((math.pow(B_m, 2.0) * (F / -C))) / -B_m return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (F <= -1.55e-46) tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); elseif (F <= -5.9e-304) tmp = Float64(sqrt(Float64(-2.0 * Float64(B_m * F))) / Float64(-B_m)); else tmp = Float64(sqrt(Float64((B_m ^ 2.0) * Float64(F / Float64(-C)))) / Float64(-B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (F <= -1.55e-46)
tmp = -sqrt((-2.0 * (F / B_m)));
elseif (F <= -5.9e-304)
tmp = sqrt((-2.0 * (B_m * F))) / -B_m;
else
tmp = sqrt(((B_m ^ 2.0) * (F / -C))) / -B_m;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -1.55e-46], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[F, -5.9e-304], N[(N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] * N[(F / (-C)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{-46}:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\mathbf{elif}\;F \leq -5.9 \cdot 10^{-304}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{{B\_m}^{2} \cdot \frac{F}{-C}}}{-B\_m}\\
\end{array}
\end{array}
if F < -1.55e-46Initial program 15.7%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.1%
Simplified1.1%
Taylor expanded in F around 0 1.1%
Applied egg-rr17.2%
neg-sub017.2%
Simplified17.2%
if -1.55e-46 < F < -5.9000000000000001e-304Initial program 18.3%
Taylor expanded in A around 0 10.3%
mul-1-neg10.3%
+-commutative10.3%
unpow210.3%
unpow210.3%
hypot-define26.3%
Simplified26.3%
neg-sub026.3%
associate-*l/26.3%
pow1/226.3%
pow1/226.3%
pow-prod-down26.3%
Applied egg-rr26.3%
neg-sub026.3%
distribute-neg-frac226.3%
unpow1/226.3%
Simplified26.3%
Taylor expanded in C around 0 25.4%
if -5.9000000000000001e-304 < F Initial program 27.0%
Taylor expanded in A around 0 15.1%
mul-1-neg15.1%
+-commutative15.1%
unpow215.1%
unpow215.1%
hypot-define26.2%
Simplified26.2%
neg-sub026.2%
associate-*l/26.2%
pow1/226.2%
pow1/226.4%
pow-prod-down26.4%
Applied egg-rr26.4%
neg-sub026.4%
distribute-neg-frac226.4%
unpow1/226.2%
Simplified26.2%
Taylor expanded in C around inf 28.0%
mul-1-neg28.0%
associate-/l*29.7%
Simplified29.7%
Final simplification22.4%
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
:precision binary64
(if (<= F -2.8e-48)
(- (sqrt (* -2.0 (/ F B_m))))
(if (<= F 1.35e-103)
(/ (sqrt (* -2.0 (* B_m F))) (- B_m))
(sqrt (* -2.0 (/ 1.0 (cbrt (/ F B_m))))))))B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -2.8e-48) {
tmp = -sqrt((-2.0 * (F / B_m)));
} else if (F <= 1.35e-103) {
tmp = sqrt((-2.0 * (B_m * F))) / -B_m;
} else {
tmp = sqrt((-2.0 * (1.0 / cbrt((F / B_m)))));
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -2.8e-48) {
tmp = -Math.sqrt((-2.0 * (F / B_m)));
} else if (F <= 1.35e-103) {
tmp = Math.sqrt((-2.0 * (B_m * F))) / -B_m;
} else {
tmp = Math.sqrt((-2.0 * (1.0 / Math.cbrt((F / B_m)))));
}
return tmp;
}
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (F <= -2.8e-48) tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); elseif (F <= 1.35e-103) tmp = Float64(sqrt(Float64(-2.0 * Float64(B_m * F))) / Float64(-B_m)); else tmp = sqrt(Float64(-2.0 * Float64(1.0 / cbrt(Float64(F / B_m))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2.8e-48], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[F, 1.35e-103], N[(N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[Sqrt[N[(-2.0 * N[(1.0 / N[Power[N[(F / B$95$m), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.8 \cdot 10^{-48}:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{-103}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \frac{1}{\sqrt[3]{\frac{F}{B\_m}}}}\\
\end{array}
\end{array}
if F < -2.80000000000000005e-48Initial program 15.7%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.1%
Simplified1.1%
Taylor expanded in F around 0 1.1%
Applied egg-rr17.2%
neg-sub017.2%
Simplified17.2%
if -2.80000000000000005e-48 < F < 1.35000000000000005e-103Initial program 21.4%
Taylor expanded in A around 0 13.8%
mul-1-neg13.8%
+-commutative13.8%
unpow213.8%
unpow213.8%
hypot-define28.0%
Simplified28.0%
neg-sub028.0%
associate-*l/28.0%
pow1/228.0%
pow1/228.0%
pow-prod-down28.0%
Applied egg-rr28.0%
neg-sub028.0%
distribute-neg-frac228.0%
unpow1/228.0%
Simplified28.0%
Taylor expanded in C around 0 24.6%
if 1.35000000000000005e-103 < F Initial program 22.8%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.9%
Simplified2.9%
Taylor expanded in F around 0 2.9%
Applied egg-rr2.5%
+-lft-identity2.5%
Simplified2.5%
Applied egg-rr2.0%
pow-plus13.2%
metadata-eval13.2%
unpow-113.2%
Simplified13.2%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= F -5500000000.0) (- (sqrt (* -2.0 (/ F B_m)))) (* (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (/ -1.0 B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5500000000.0) {
tmp = -sqrt((-2.0 * (F / B_m)));
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) * (-1.0 / B_m);
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5500000000.0) {
tmp = -Math.sqrt((-2.0 * (F / B_m)));
} else {
tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(C, B_m))))) * (-1.0 / B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if F <= -5500000000.0: tmp = -math.sqrt((-2.0 * (F / B_m))) else: tmp = math.sqrt((2.0 * (F * (C - math.hypot(C, B_m))))) * (-1.0 / B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5500000000.0) tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) * Float64(-1.0 / B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (F <= -5500000000.0)
tmp = -sqrt((-2.0 * (F / B_m)));
else
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) * (-1.0 / B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5500000000.0], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5500000000:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)} \cdot \frac{-1}{B\_m}\\
\end{array}
\end{array}
if F < -5.5e9Initial program 16.7%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.0%
Simplified1.0%
Taylor expanded in F around 0 1.0%
Applied egg-rr17.8%
neg-sub017.8%
Simplified17.8%
if -5.5e9 < F Initial program 20.4%
Taylor expanded in A around 0 12.1%
mul-1-neg12.1%
+-commutative12.1%
unpow212.1%
unpow212.1%
hypot-define25.2%
Simplified25.2%
add-sqr-sqrt24.6%
pow224.6%
associate-*l/24.6%
pow1/224.6%
pow1/224.6%
pow-prod-down24.6%
Applied egg-rr24.6%
unpow1/224.6%
Simplified24.6%
unpow224.6%
add-sqr-sqrt25.2%
clear-num25.2%
associate-*r*25.3%
Applied egg-rr25.3%
associate-/r/25.3%
associate-*l*25.2%
Simplified25.2%
Final simplification22.2%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= F -2.5e+20) (- (sqrt (* -2.0 (/ F B_m)))) (/ (sqrt (* 2.0 (* F (- C (hypot C B_m))))) (- B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -2.5e+20) {
tmp = -sqrt((-2.0 * (F / B_m)));
} else {
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -2.5e+20) {
tmp = -Math.sqrt((-2.0 * (F / B_m)));
} else {
tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(C, B_m))))) / -B_m;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if F <= -2.5e+20: tmp = -math.sqrt((-2.0 * (F / B_m))) else: tmp = math.sqrt((2.0 * (F * (C - math.hypot(C, B_m))))) / -B_m return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (F <= -2.5e+20) tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(C, B_m))))) / Float64(-B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (F <= -2.5e+20)
tmp = -sqrt((-2.0 * (F / B_m)));
else
tmp = sqrt((2.0 * (F * (C - hypot(C, B_m))))) / -B_m;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2.5e+20], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{+20}:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if F < -2.5e20Initial program 14.4%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.0%
Simplified1.0%
Taylor expanded in F around 0 1.0%
Applied egg-rr16.7%
neg-sub016.7%
Simplified16.7%
if -2.5e20 < F Initial program 21.7%
Taylor expanded in A around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define25.7%
Simplified25.7%
neg-sub025.7%
associate-*l/25.7%
pow1/225.7%
pow1/225.8%
pow-prod-down25.8%
Applied egg-rr25.8%
neg-sub025.8%
distribute-neg-frac225.8%
unpow1/225.7%
Simplified25.7%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= F -1.55e-46) (- (sqrt (* -2.0 (/ F B_m)))) (/ (sqrt (* -2.0 (* B_m F))) (- B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -1.55e-46) {
tmp = -sqrt((-2.0 * (F / B_m)));
} else {
tmp = sqrt((-2.0 * (B_m * F))) / -B_m;
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= (-1.55d-46)) then
tmp = -sqrt(((-2.0d0) * (f / b_m)))
else
tmp = sqrt(((-2.0d0) * (b_m * f))) / -b_m
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -1.55e-46) {
tmp = -Math.sqrt((-2.0 * (F / B_m)));
} else {
tmp = Math.sqrt((-2.0 * (B_m * F))) / -B_m;
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if F <= -1.55e-46: tmp = -math.sqrt((-2.0 * (F / B_m))) else: tmp = math.sqrt((-2.0 * (B_m * F))) / -B_m return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (F <= -1.55e-46) tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); else tmp = Float64(sqrt(Float64(-2.0 * Float64(B_m * F))) / Float64(-B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (F <= -1.55e-46)
tmp = -sqrt((-2.0 * (F / B_m)));
else
tmp = sqrt((-2.0 * (B_m * F))) / -B_m;
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -1.55e-46], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{-46}:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{-B\_m}\\
\end{array}
\end{array}
if F < -1.55e-46Initial program 15.7%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.1%
Simplified1.1%
Taylor expanded in F around 0 1.1%
Applied egg-rr17.2%
neg-sub017.2%
Simplified17.2%
if -1.55e-46 < F Initial program 21.8%
Taylor expanded in A around 0 12.2%
mul-1-neg12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-define26.2%
Simplified26.2%
neg-sub026.2%
associate-*l/26.2%
pow1/226.2%
pow1/226.3%
pow-prod-down26.4%
Applied egg-rr26.4%
neg-sub026.4%
distribute-neg-frac226.4%
unpow1/226.3%
Simplified26.3%
Taylor expanded in C around 0 18.5%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (if (<= F -6.2e-261) (- (sqrt (* -2.0 (/ F B_m)))) (* -2.0 (/ (sqrt (* A F)) B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -6.2e-261) {
tmp = -sqrt((-2.0 * (F / B_m)));
} else {
tmp = -2.0 * (sqrt((A * F)) / B_m);
}
return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= (-6.2d-261)) then
tmp = -sqrt(((-2.0d0) * (f / b_m)))
else
tmp = (-2.0d0) * (sqrt((a * f)) / b_m)
end if
code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -6.2e-261) {
tmp = -Math.sqrt((-2.0 * (F / B_m)));
} else {
tmp = -2.0 * (Math.sqrt((A * F)) / B_m);
}
return tmp;
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): tmp = 0 if F <= -6.2e-261: tmp = -math.sqrt((-2.0 * (F / B_m))) else: tmp = -2.0 * (math.sqrt((A * F)) / B_m) return tmp
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) tmp = 0.0 if (F <= -6.2e-261) tmp = Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))); else tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) / B_m)); end return tmp end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
tmp = 0.0;
if (F <= -6.2e-261)
tmp = -sqrt((-2.0 * (F / B_m)));
else
tmp = -2.0 * (sqrt((A * F)) / B_m);
end
tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -6.2e-261], (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.2 \cdot 10^{-261}:\\
\;\;\;\;-\sqrt{-2 \cdot \frac{F}{B\_m}}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\sqrt{A \cdot F}}{B\_m}\\
\end{array}
\end{array}
if F < -6.1999999999999997e-261Initial program 16.8%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.5%
Simplified1.5%
Taylor expanded in F around 0 1.5%
Applied egg-rr17.0%
neg-sub017.0%
Simplified17.0%
if -6.1999999999999997e-261 < F Initial program 25.0%
Simplified37.5%
add-cbrt-cube27.7%
pow327.7%
Applied egg-rr38.4%
Taylor expanded in A around -inf 11.1%
Applied egg-rr7.0%
Taylor expanded in B around inf 5.9%
associate-*r/5.9%
*-rgt-identity5.9%
Simplified5.9%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (- (sqrt (* -2.0 (/ F B_m)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return -sqrt((-2.0 * (F / B_m)));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt(((-2.0d0) * (f / b_m)))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return -Math.sqrt((-2.0 * (F / B_m)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return -math.sqrt((-2.0 * (F / B_m)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(-sqrt(Float64(-2.0 * Float64(F / B_m)))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = -sqrt((-2.0 * (F / B_m)));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-\sqrt{-2 \cdot \frac{F}{B\_m}}
\end{array}
Initial program 18.9%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.0%
Simplified2.0%
Taylor expanded in F around 0 2.0%
Applied egg-rr13.1%
neg-sub013.1%
Simplified13.1%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (sqrt (/ (* F -2.0) B_m)))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return sqrt(((F * -2.0) / B_m));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = sqrt(((f * (-2.0d0)) / b_m))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt(((F * -2.0) / B_m));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return math.sqrt(((F * -2.0) / B_m))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return sqrt(Float64(Float64(F * -2.0) / B_m)) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = sqrt(((F * -2.0) / B_m));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[Sqrt[N[(N[(F * -2.0), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{\frac{F \cdot -2}{B\_m}}
\end{array}
Initial program 18.9%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.0%
Simplified2.0%
Taylor expanded in F around 0 2.0%
Applied egg-rr1.7%
+-lft-identity1.7%
Simplified1.7%
associate-*r/1.7%
Applied egg-rr1.7%
Final simplification1.7%
B_m = (fabs.f64 B) NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. (FPCore (A B_m C F) :precision binary64 (sqrt (* -2.0 (/ F B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
return sqrt((-2.0 * (F / B_m)));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = sqrt(((-2.0d0) * (f / b_m)))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt((-2.0 * (F / B_m)));
}
B_m = math.fabs(B) [A, B_m, C, F] = sort([A, B_m, C, F]) def code(A, B_m, C, F): return math.sqrt((-2.0 * (F / B_m)))
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return sqrt(Float64(-2.0 * Float64(F / B_m))) end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
tmp = sqrt((-2.0 * (F / B_m)));
end
B_m = N[Abs[B], $MachinePrecision] NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function. code[A_, B$95$m_, C_, F_] := N[Sqrt[N[(-2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{-2 \cdot \frac{F}{B\_m}}
\end{array}
Initial program 18.9%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt2.0%
Simplified2.0%
Taylor expanded in F around 0 2.0%
Applied egg-rr1.7%
+-lft-identity1.7%
Simplified1.7%
herbie shell --seed 2024177
(FPCore (A B C F)
:name "ABCF->ab-angle b"
:precision binary64
(/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))