
(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 16 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 (fma B_m B_m (* A (* C -4.0))))
(t_1 (* (* 4.0 A) C))
(t_2
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_1) F))
(- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
(- t_1 (pow B_m 2.0))))
(t_3 (fma C (* A -4.0) (pow B_m 2.0))))
(if (<= t_2 -1e-187)
(/
(* (sqrt (* F (+ A (- C (hypot B_m (- A C)))))) (sqrt (* 2.0 t_3)))
(- t_3))
(if (<= t_2 INFINITY)
(/
(pow (* t_0 (* F (* 2.0 (+ A (fma -0.5 (/ (pow B_m 2.0) C) A))))) 0.5)
(- t_0))
(-
(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 t_1 = (4.0 * A) * C;
double t_2 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_1) * F)) * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_1 - pow(B_m, 2.0));
double t_3 = fma(C, (A * -4.0), pow(B_m, 2.0));
double tmp;
if (t_2 <= -1e-187) {
tmp = (sqrt((F * (A + (C - hypot(B_m, (A - C)))))) * sqrt((2.0 * t_3))) / -t_3;
} else if (t_2 <= ((double) INFINITY)) {
tmp = pow((t_0 * (F * (2.0 * (A + fma(-0.5, (pow(B_m, 2.0) / C), A))))), 0.5) / -t_0;
} 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))) t_1 = Float64(Float64(4.0 * A) * C) t_2 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F)) * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_1 - (B_m ^ 2.0))) t_3 = fma(C, Float64(A * -4.0), (B_m ^ 2.0)) tmp = 0.0 if (t_2 <= -1e-187) tmp = Float64(Float64(sqrt(Float64(F * Float64(A + Float64(C - hypot(B_m, Float64(A - C)))))) * sqrt(Float64(2.0 * t_3))) / Float64(-t_3)); elseif (t_2 <= Inf) tmp = Float64((Float64(t_0 * Float64(F * Float64(2.0 * Float64(A + fma(-0.5, Float64((B_m ^ 2.0) / C), A))))) ^ 0.5) / Float64(-t_0)); 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]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$1 - N[Power[B$95$m, 2.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$2, -1e-187], 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[N[(2.0 * t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-t$95$3)), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[Power[N[(t$95$0 * N[(F * N[(2.0 * N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision] + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / (-t$95$0)), $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)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_1 - {B\_m}^{2}}\\
t_3 := \mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-187}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)} \cdot \sqrt{2 \cdot t\_3}}{-t\_3}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{{\left(t\_0 \cdot \left(F \cdot \left(2 \cdot \left(A + \mathsf{fma}\left(-0.5, \frac{{B\_m}^{2}}{C}, A\right)\right)\right)\right)\right)}^{0.5}}{-t\_0}\\
\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 (/.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-187Initial program 47.6%
Simplified43.6%
pow1/243.7%
associate-*r*54.0%
unpow-prod-down65.2%
associate-+r-64.8%
hypot-undefine53.1%
unpow253.1%
unpow253.1%
+-commutative53.1%
unpow253.1%
unpow253.1%
hypot-define64.8%
pow1/264.8%
Applied egg-rr64.8%
unpow1/264.8%
associate-+r-65.2%
hypot-undefine53.1%
unpow253.1%
unpow253.1%
+-commutative53.1%
unpow253.1%
unpow253.1%
hypot-undefine65.2%
Simplified65.2%
if -1e-187 < (/.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 20.8%
Simplified33.2%
Taylor expanded in C around inf 20.2%
mul-1-neg20.2%
Simplified20.2%
pow1/220.4%
associate-*l*22.0%
fma-neg22.0%
Applied egg-rr22.0%
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 C around 0 1.5%
mul-1-neg1.5%
+-commutative1.5%
unpow21.5%
unpow21.5%
hypot-define19.4%
Simplified19.4%
add-sqr-sqrt18.5%
pow218.5%
associate-*l/18.4%
pow1/218.4%
pow1/218.5%
pow-prod-down18.5%
Applied egg-rr18.5%
unpow1/218.5%
Simplified18.5%
Taylor expanded in B around inf 22.9%
Final simplification39.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-50)
(/
(pow (* t_0 (* F (* 2.0 (+ A (fma -0.5 (/ (pow B_m 2.0) C) A))))) 0.5)
(- t_0))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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-50) {
tmp = pow((t_0 * (F * (2.0 * (A + fma(-0.5, (pow(B_m, 2.0) / C), A))))), 0.5) / -t_0;
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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-50) tmp = Float64((Float64(t_0 * Float64(F * Float64(2.0 * Float64(A + fma(-0.5, Float64((B_m ^ 2.0) / C), A))))) ^ 0.5) / Float64(-t_0)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / 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[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-50], N[(N[Power[N[(t$95$0 * N[(F * N[(2.0 * N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision] + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 5 \cdot 10^{-50}:\\
\;\;\;\;\frac{{\left(t\_0 \cdot \left(F \cdot \left(2 \cdot \left(A + \mathsf{fma}\left(-0.5, \frac{{B\_m}^{2}}{C}, A\right)\right)\right)\right)\right)}^{0.5}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 4.99999999999999968e-50Initial program 23.5%
Simplified32.4%
Taylor expanded in C around inf 18.4%
mul-1-neg18.4%
Simplified18.4%
pow1/218.7%
associate-*l*19.5%
fma-neg19.5%
Applied egg-rr19.5%
if 4.99999999999999968e-50 < (pow.f64 B #s(literal 2 binary64)) Initial program 23.9%
Taylor expanded in C around 0 18.0%
mul-1-neg18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-define31.0%
Simplified31.0%
neg-sub031.0%
associate-*l/31.0%
pow1/231.0%
pow1/231.0%
pow-prod-down31.1%
Applied egg-rr31.1%
neg-sub031.1%
distribute-neg-frac231.1%
unpow1/231.1%
Simplified31.1%
Final simplification25.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 (<= B_m 2.4e-25)
(/
(pow (* t_0 (* F (* 2.0 (+ A (fma -0.5 (/ (pow B_m 2.0) C) A))))) 0.5)
(- t_0))
(if (<= B_m 1.95e+146)
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 (B_m <= 2.4e-25) {
tmp = pow((t_0 * (F * (2.0 * (A + fma(-0.5, (pow(B_m, 2.0) / C), A))))), 0.5) / -t_0;
} else if (B_m <= 1.95e+146) {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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.4e-25) tmp = Float64((Float64(t_0 * Float64(F * Float64(2.0 * Float64(A + fma(-0.5, Float64((B_m ^ 2.0) / C), A))))) ^ 0.5) / Float64(-t_0)); elseif (B_m <= 1.95e+146) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / 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[B$95$m, 2.4e-25], N[(N[Power[N[(t$95$0 * N[(F * N[(2.0 * N[(A + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision] + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / (-t$95$0)), $MachinePrecision], If[LessEqual[B$95$m, 1.95e+146], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $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 \leq 2.4 \cdot 10^{-25}:\\
\;\;\;\;\frac{{\left(t\_0 \cdot \left(F \cdot \left(2 \cdot \left(A + \mathsf{fma}\left(-0.5, \frac{{B\_m}^{2}}{C}, A\right)\right)\right)\right)\right)}^{0.5}}{-t\_0}\\
\mathbf{elif}\;B\_m \leq 1.95 \cdot 10^{+146}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-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 B < 2.40000000000000009e-25Initial program 22.2%
Simplified29.1%
Taylor expanded in C around inf 14.2%
mul-1-neg14.2%
Simplified14.2%
pow1/214.7%
associate-*l*15.2%
fma-neg15.2%
Applied egg-rr15.2%
if 2.40000000000000009e-25 < B < 1.95e146Initial program 44.4%
Taylor expanded in C around 0 49.5%
mul-1-neg49.5%
+-commutative49.5%
unpow249.5%
unpow249.5%
hypot-define51.9%
Simplified51.9%
neg-sub051.9%
associate-*l/52.0%
pow1/252.0%
pow1/252.0%
pow-prod-down52.3%
Applied egg-rr52.3%
neg-sub052.3%
distribute-neg-frac252.3%
unpow1/252.3%
Simplified52.3%
if 1.95e146 < B Initial program 3.7%
Taylor expanded in C around 0 5.7%
mul-1-neg5.7%
+-commutative5.7%
unpow25.7%
unpow25.7%
hypot-define57.4%
Simplified57.4%
add-sqr-sqrt57.2%
pow257.2%
associate-*l/57.1%
pow1/257.1%
pow1/257.1%
pow-prod-down57.2%
Applied egg-rr57.2%
unpow1/257.2%
Simplified57.2%
Taylor expanded in B around inf 80.2%
Final simplification29.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-50)
(/
(sqrt (* (* F t_0) (* 2.0 (+ A (+ A (* -0.5 (/ (pow B_m 2.0) C)))))))
(- t_0))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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-50) {
tmp = sqrt(((F * t_0) * (2.0 * (A + (A + (-0.5 * (pow(B_m, 2.0) / C))))))) / -t_0;
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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-50) tmp = Float64(sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(A + Float64(-0.5 * Float64((B_m ^ 2.0) / C))))))) / Float64(-t_0)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / 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[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-50], N[(N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * 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$0)), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 5 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{\left(F \cdot t\_0\right) \cdot \left(2 \cdot \left(A + \left(A + -0.5 \cdot \frac{{B\_m}^{2}}{C}\right)\right)\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 4.99999999999999968e-50Initial program 23.5%
Simplified32.4%
Taylor expanded in C around inf 18.4%
mul-1-neg18.4%
Simplified18.4%
if 4.99999999999999968e-50 < (pow.f64 B #s(literal 2 binary64)) Initial program 23.9%
Taylor expanded in C around 0 18.0%
mul-1-neg18.0%
+-commutative18.0%
unpow218.0%
unpow218.0%
hypot-define31.0%
Simplified31.0%
neg-sub031.0%
associate-*l/31.0%
pow1/231.0%
pow1/231.0%
pow-prod-down31.1%
Applied egg-rr31.1%
neg-sub031.1%
distribute-neg-frac231.1%
unpow1/231.1%
Simplified31.1%
Final simplification25.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
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e-66)
(/ (sqrt (* (* 4.0 A) (* F t_0))) (- t_0))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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) <= 1e-66) {
tmp = sqrt(((4.0 * A) * (F * t_0))) / -t_0;
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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) <= 1e-66) 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(A - hypot(B_m, A))))) / 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[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-66], 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[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 10^{-66}:\\
\;\;\;\;\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(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999998e-67Initial program 23.2%
Simplified32.2%
Taylor expanded in A around -inf 18.7%
if 9.9999999999999998e-67 < (pow.f64 B #s(literal 2 binary64)) Initial program 24.2%
Taylor expanded in C around 0 18.3%
mul-1-neg18.3%
+-commutative18.3%
unpow218.3%
unpow218.3%
hypot-define31.1%
Simplified31.1%
neg-sub031.1%
associate-*l/31.1%
pow1/231.1%
pow1/231.1%
pow-prod-down31.2%
Applied egg-rr31.2%
neg-sub031.2%
distribute-neg-frac231.2%
unpow1/231.2%
Simplified31.2%
Final simplification25.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 (<= (pow B_m 2.0) 2e-92)
(/
(sqrt (* (* A -8.0) (* C (* F (+ A A)))))
(- (fma C (* A -4.0) (pow B_m 2.0))))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 (pow(B_m, 2.0) <= 2e-92) {
tmp = sqrt(((A * -8.0) * (C * (F * (A + A))))) / -fma(C, (A * -4.0), pow(B_m, 2.0));
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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 ^ 2.0) <= 2e-92) tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + A))))) / Float64(-fma(C, Float64(A * -4.0), (B_m ^ 2.0)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / 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[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-92], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 2 \cdot 10^{-92}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{-\mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999998e-92Initial program 21.7%
Simplified25.7%
Taylor expanded in C around inf 16.9%
associate-*r*16.9%
mul-1-neg16.9%
Simplified16.9%
if 1.99999999999999998e-92 < (pow.f64 B #s(literal 2 binary64)) Initial program 25.2%
Taylor expanded in C around 0 17.2%
mul-1-neg17.2%
+-commutative17.2%
unpow217.2%
unpow217.2%
hypot-define29.0%
Simplified29.0%
neg-sub029.0%
associate-*l/29.0%
pow1/229.0%
pow1/229.1%
pow-prod-down29.2%
Applied egg-rr29.2%
neg-sub029.2%
distribute-neg-frac229.2%
unpow1/229.2%
Simplified29.2%
Final simplification24.0%
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 (<= (pow B_m 2.0) 2e-92)
(/
(sqrt (* C (* -8.0 (* (+ A A) (* A F)))))
(- (fma C (* A -4.0) (pow B_m 2.0))))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 (pow(B_m, 2.0) <= 2e-92) {
tmp = sqrt((C * (-8.0 * ((A + A) * (A * F))))) / -fma(C, (A * -4.0), pow(B_m, 2.0));
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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 ^ 2.0) <= 2e-92) tmp = Float64(sqrt(Float64(C * Float64(-8.0 * Float64(Float64(A + A) * Float64(A * F))))) / Float64(-fma(C, Float64(A * -4.0), (B_m ^ 2.0)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / 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[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-92], N[(N[Sqrt[N[(C * N[(-8.0 * N[(N[(A + A), $MachinePrecision] * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 2 \cdot 10^{-92}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(-8 \cdot \left(\left(A + A\right) \cdot \left(A \cdot F\right)\right)\right)}}{-\mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999998e-92Initial program 21.7%
Simplified25.7%
Taylor expanded in C around inf 16.1%
Taylor expanded in B around 0 15.9%
associate-*r*15.9%
neg-mul-115.9%
Simplified15.9%
if 1.99999999999999998e-92 < (pow.f64 B #s(literal 2 binary64)) Initial program 25.2%
Taylor expanded in C around 0 17.2%
mul-1-neg17.2%
+-commutative17.2%
unpow217.2%
unpow217.2%
hypot-define29.0%
Simplified29.0%
neg-sub029.0%
associate-*l/29.0%
pow1/229.0%
pow1/229.1%
pow-prod-down29.2%
Applied egg-rr29.2%
neg-sub029.2%
distribute-neg-frac229.2%
unpow1/229.2%
Simplified29.2%
Final simplification23.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 (<= (pow B_m 2.0) 2e-92)
(/
(sqrt (* -8.0 (* A (* (+ A A) (* C F)))))
(- (fma C (* A -4.0) (pow B_m 2.0))))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 (pow(B_m, 2.0) <= 2e-92) {
tmp = sqrt((-8.0 * (A * ((A + A) * (C * F))))) / -fma(C, (A * -4.0), pow(B_m, 2.0));
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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 ^ 2.0) <= 2e-92) tmp = Float64(sqrt(Float64(-8.0 * Float64(A * Float64(Float64(A + A) * Float64(C * F))))) / Float64(-fma(C, Float64(A * -4.0), (B_m ^ 2.0)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / 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[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-92], N[(N[Sqrt[N[(-8.0 * N[(A * N[(N[(A + A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(C * N[(A * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 2 \cdot 10^{-92}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)\right)}}{-\mathsf{fma}\left(C, A \cdot -4, {B\_m}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999998e-92Initial program 21.7%
Simplified25.7%
Taylor expanded in C around inf 20.3%
Taylor expanded in C around inf 16.9%
associate-*r*16.0%
neg-mul-116.0%
Simplified16.0%
if 1.99999999999999998e-92 < (pow.f64 B #s(literal 2 binary64)) Initial program 25.2%
Taylor expanded in C around 0 17.2%
mul-1-neg17.2%
+-commutative17.2%
unpow217.2%
unpow217.2%
hypot-define29.0%
Simplified29.0%
neg-sub029.0%
associate-*l/29.0%
pow1/229.0%
pow1/229.1%
pow-prod-down29.2%
Applied egg-rr29.2%
neg-sub029.2%
distribute-neg-frac229.2%
unpow1/229.2%
Simplified29.2%
Final simplification23.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 (<= (pow B_m 2.0) 5e-220)
(/
(sqrt (* F (* (+ A (- C (hypot B_m (- A C)))) (* 2.0 (* -4.0 (* A C))))))
(* (* 4.0 A) C))
(/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 (pow(B_m, 2.0) <= 5e-220) {
tmp = sqrt((F * ((A + (C - hypot(B_m, (A - C)))) * (2.0 * (-4.0 * (A * C)))))) / ((4.0 * A) * C);
} else {
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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 (Math.pow(B_m, 2.0) <= 5e-220) {
tmp = Math.sqrt((F * ((A + (C - Math.hypot(B_m, (A - C)))) * (2.0 * (-4.0 * (A * C)))))) / ((4.0 * A) * C);
} else {
tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(B_m, A))))) / -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 math.pow(B_m, 2.0) <= 5e-220: tmp = math.sqrt((F * ((A + (C - math.hypot(B_m, (A - C)))) * (2.0 * (-4.0 * (A * C)))))) / ((4.0 * A) * C) else: tmp = math.sqrt((2.0 * (F * (A - math.hypot(B_m, A))))) / -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 ^ 2.0) <= 5e-220) tmp = Float64(sqrt(Float64(F * Float64(Float64(A + Float64(C - hypot(B_m, Float64(A - C)))) * Float64(2.0 * Float64(-4.0 * Float64(A * C)))))) / Float64(Float64(4.0 * A) * C)); else tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(B_m, A))))) / 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 ((B_m ^ 2.0) <= 5e-220)
tmp = sqrt((F * ((A + (C - hypot(B_m, (A - C)))) * (2.0 * (-4.0 * (A * C)))))) / ((4.0 * A) * C);
else
tmp = sqrt((2.0 * (F * (A - hypot(B_m, A))))) / -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[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-220], N[(N[Sqrt[N[(F * N[(N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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}^{2} \leq 5 \cdot 10^{-220}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000002e-220Initial program 21.3%
Simplified23.3%
Taylor expanded in C around inf 22.1%
Taylor expanded in C around inf 22.1%
associate-*r*22.1%
Simplified22.1%
if 5.0000000000000002e-220 < (pow.f64 B #s(literal 2 binary64)) Initial program 24.9%
Taylor expanded in C around 0 16.2%
mul-1-neg16.2%
+-commutative16.2%
unpow216.2%
unpow216.2%
hypot-define26.5%
Simplified26.5%
neg-sub026.5%
associate-*l/26.5%
pow1/226.5%
pow1/226.6%
pow-prod-down26.7%
Applied egg-rr26.7%
neg-sub026.7%
distribute-neg-frac226.7%
unpow1/226.6%
Simplified26.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 (/ (sqrt (* 2.0 (* F (- A (hypot B_m A))))) (- 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 * (A - hypot(B_m, A))))) / -B_m;
}
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 * (A - Math.hypot(B_m, A))))) / -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 * (A - math.hypot(B_m, A))))) / -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 * Float64(A - hypot(B_m, A))))) / Float64(-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 * (A - hypot(B_m, A))))) / -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[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 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])\\
\\
\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}
\end{array}
Initial program 23.7%
Taylor expanded in C around 0 12.0%
mul-1-neg12.0%
+-commutative12.0%
unpow212.0%
unpow212.0%
hypot-define19.1%
Simplified19.1%
neg-sub019.1%
associate-*l/19.1%
pow1/219.1%
pow1/219.2%
pow-prod-down19.3%
Applied egg-rr19.3%
neg-sub019.3%
distribute-neg-frac219.3%
unpow1/219.2%
Simplified19.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 (<= A -4.7e+185) (/ (sqrt (* (* 4.0 A) F)) (- B_m)) (/ (sqrt (* B_m (+ (* F -2.0) (* 2.0 (/ (* A F) 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 (A <= -4.7e+185) {
tmp = sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = sqrt((B_m * ((F * -2.0) + (2.0 * ((A * F) / B_m))))) / -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 (a <= (-4.7d+185)) then
tmp = sqrt(((4.0d0 * a) * f)) / -b_m
else
tmp = sqrt((b_m * ((f * (-2.0d0)) + (2.0d0 * ((a * f) / b_m))))) / -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 (A <= -4.7e+185) {
tmp = Math.sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = Math.sqrt((B_m * ((F * -2.0) + (2.0 * ((A * F) / 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 A <= -4.7e+185: tmp = math.sqrt(((4.0 * A) * F)) / -B_m else: tmp = math.sqrt((B_m * ((F * -2.0) + (2.0 * ((A * F) / 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 (A <= -4.7e+185) tmp = Float64(sqrt(Float64(Float64(4.0 * A) * F)) / Float64(-B_m)); else tmp = Float64(sqrt(Float64(B_m * Float64(Float64(F * -2.0) + Float64(2.0 * Float64(Float64(A * F) / 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 (A <= -4.7e+185)
tmp = sqrt(((4.0 * A) * F)) / -B_m;
else
tmp = sqrt((B_m * ((F * -2.0) + (2.0 * ((A * F) / 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[A, -4.7e+185], N[(N[Sqrt[N[(N[(4.0 * A), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[N[(B$95$m * N[(N[(F * -2.0), $MachinePrecision] + N[(2.0 * N[(N[(A * F), $MachinePrecision] / B$95$m), $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}\;A \leq -4.7 \cdot 10^{+185}:\\
\;\;\;\;\frac{\sqrt{\left(4 \cdot A\right) \cdot F}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{B\_m \cdot \left(F \cdot -2 + 2 \cdot \frac{A \cdot F}{B\_m}\right)}}{-B\_m}\\
\end{array}
\end{array}
if A < -4.69999999999999972e185Initial program 2.1%
Taylor expanded in C around 0 1.1%
mul-1-neg1.1%
+-commutative1.1%
unpow21.1%
unpow21.1%
hypot-define5.4%
Simplified5.4%
neg-sub05.4%
associate-*l/5.4%
pow1/25.4%
pow1/26.2%
pow-prod-down6.3%
Applied egg-rr6.3%
neg-sub06.3%
distribute-neg-frac26.3%
unpow1/25.5%
Simplified5.5%
Taylor expanded in A around -inf 5.5%
associate-*r*5.5%
Simplified5.5%
if -4.69999999999999972e185 < A Initial program 25.9%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define20.4%
Simplified20.4%
neg-sub020.4%
associate-*l/20.5%
pow1/220.5%
pow1/220.5%
pow-prod-down20.5%
Applied egg-rr20.5%
neg-sub020.5%
distribute-neg-frac220.5%
unpow1/220.5%
Simplified20.5%
Taylor expanded in B around inf 17.4%
Final simplification16.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 (if (<= A -1.2e+186) (/ (sqrt (* (* 4.0 A) F)) (- B_m)) (/ (sqrt (+ (* -2.0 (* B_m F)) (* 2.0 (* 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 (A <= -1.2e+186) {
tmp = sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = sqrt(((-2.0 * (B_m * F)) + (2.0 * (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 (a <= (-1.2d+186)) then
tmp = sqrt(((4.0d0 * a) * f)) / -b_m
else
tmp = sqrt((((-2.0d0) * (b_m * f)) + (2.0d0 * (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 (A <= -1.2e+186) {
tmp = Math.sqrt(((4.0 * A) * F)) / -B_m;
} else {
tmp = Math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (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 A <= -1.2e+186: tmp = math.sqrt(((4.0 * A) * F)) / -B_m else: tmp = math.sqrt(((-2.0 * (B_m * F)) + (2.0 * (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 (A <= -1.2e+186) tmp = Float64(sqrt(Float64(Float64(4.0 * A) * F)) / Float64(-B_m)); else tmp = Float64(sqrt(Float64(Float64(-2.0 * Float64(B_m * F)) + Float64(2.0 * Float64(A * 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 (A <= -1.2e+186)
tmp = sqrt(((4.0 * A) * F)) / -B_m;
else
tmp = sqrt(((-2.0 * (B_m * F)) + (2.0 * (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[A, -1.2e+186], N[(N[Sqrt[N[(N[(4.0 * A), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[N[(N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(A * F), $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}\;A \leq -1.2 \cdot 10^{+186}:\\
\;\;\;\;\frac{\sqrt{\left(4 \cdot A\right) \cdot F}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right) + 2 \cdot \left(A \cdot F\right)}}{-B\_m}\\
\end{array}
\end{array}
if A < -1.19999999999999998e186Initial program 2.1%
Taylor expanded in C around 0 1.1%
mul-1-neg1.1%
+-commutative1.1%
unpow21.1%
unpow21.1%
hypot-define5.4%
Simplified5.4%
neg-sub05.4%
associate-*l/5.4%
pow1/25.4%
pow1/26.2%
pow-prod-down6.3%
Applied egg-rr6.3%
neg-sub06.3%
distribute-neg-frac26.3%
unpow1/25.5%
Simplified5.5%
Taylor expanded in A around -inf 5.5%
associate-*r*5.5%
Simplified5.5%
if -1.19999999999999998e186 < A Initial program 25.9%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define20.4%
Simplified20.4%
neg-sub020.4%
associate-*l/20.5%
pow1/220.5%
pow1/220.5%
pow-prod-down20.5%
Applied egg-rr20.5%
neg-sub020.5%
distribute-neg-frac220.5%
unpow1/220.5%
Simplified20.5%
Taylor expanded in A around 0 17.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 (<= A -8.6e+185) (/ (sqrt (* (* 4.0 A) 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 (A <= -8.6e+185) {
tmp = sqrt(((4.0 * A) * 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 (a <= (-8.6d+185)) then
tmp = sqrt(((4.0d0 * a) * 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 (A <= -8.6e+185) {
tmp = Math.sqrt(((4.0 * A) * 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 A <= -8.6e+185: tmp = math.sqrt(((4.0 * A) * 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 (A <= -8.6e+185) tmp = Float64(sqrt(Float64(Float64(4.0 * A) * F)) / Float64(-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 (A <= -8.6e+185)
tmp = sqrt(((4.0 * A) * 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[A, -8.6e+185], N[(N[Sqrt[N[(N[(4.0 * A), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $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}\;A \leq -8.6 \cdot 10^{+185}:\\
\;\;\;\;\frac{\sqrt{\left(4 \cdot A\right) \cdot F}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{-B\_m}\\
\end{array}
\end{array}
if A < -8.6000000000000002e185Initial program 2.1%
Taylor expanded in C around 0 1.1%
mul-1-neg1.1%
+-commutative1.1%
unpow21.1%
unpow21.1%
hypot-define5.4%
Simplified5.4%
neg-sub05.4%
associate-*l/5.4%
pow1/25.4%
pow1/26.2%
pow-prod-down6.3%
Applied egg-rr6.3%
neg-sub06.3%
distribute-neg-frac26.3%
unpow1/25.5%
Simplified5.5%
Taylor expanded in A around -inf 5.5%
associate-*r*5.5%
Simplified5.5%
if -8.6000000000000002e185 < A Initial program 25.9%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define20.4%
Simplified20.4%
neg-sub020.4%
associate-*l/20.5%
pow1/220.5%
pow1/220.5%
pow-prod-down20.5%
Applied egg-rr20.5%
neg-sub020.5%
distribute-neg-frac220.5%
unpow1/220.5%
Simplified20.5%
Taylor expanded in A around 0 17.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 (/ (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) {
return sqrt((-2.0 * (B_m * 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) * (b_m * 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 * (B_m * 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 * (B_m * 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(B_m * F))) / Float64(-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 * (B_m * 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[(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])\\
\\
\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{-B\_m}
\end{array}
Initial program 23.7%
Taylor expanded in C around 0 12.0%
mul-1-neg12.0%
+-commutative12.0%
unpow212.0%
unpow212.0%
hypot-define19.1%
Simplified19.1%
neg-sub019.1%
associate-*l/19.1%
pow1/219.1%
pow1/219.2%
pow-prod-down19.3%
Applied egg-rr19.3%
neg-sub019.3%
distribute-neg-frac219.3%
unpow1/219.2%
Simplified19.2%
Taylor expanded in A around 0 16.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 (pow (* 2.0 (/ F B_m)) 0.5))
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 pow((2.0 * (F / B_m)), 0.5);
}
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 = (2.0d0 * (f / b_m)) ** 0.5d0
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.pow((2.0 * (F / B_m)), 0.5);
}
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.pow((2.0 * (F / B_m)), 0.5)
B_m = abs(B) A, B_m, C, F = sort([A, B_m, C, F]) function code(A, B_m, C, F) return Float64(2.0 * Float64(F / B_m)) ^ 0.5 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 = (2.0 * (F / B_m)) ^ 0.5;
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[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}
\end{array}
Initial program 23.7%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.9%
Simplified1.9%
Taylor expanded in F around 0 1.9%
sqrt-unprod1.9%
pow1/22.0%
Applied egg-rr2.0%
Final simplification2.0%
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(F * Float64(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[(F * N[(2.0 / 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{F \cdot \frac{2}{B\_m}}
\end{array}
Initial program 23.7%
Taylor expanded in B around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt1.9%
Simplified1.9%
Taylor expanded in F around 0 1.9%
pow11.9%
sqrt-unprod1.9%
Applied egg-rr1.9%
unpow11.9%
associate-*l/1.9%
Simplified1.9%
associate-/l*1.9%
Applied egg-rr1.9%
herbie shell --seed 2024146
(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))))