
(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 14 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}
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0))))
(t_1 (* F t_0))
(t_2 (- (pow B 2.0) (* C (* 4.0 A))))
(t_3
(/
(-
(sqrt
(*
(* 2.0 (* t_2 F))
(+ (sqrt (+ (pow B 2.0) (pow (- A C) 2.0))) (+ A C)))))
t_2)))
(if (<= t_3 -2e-187)
(/
(*
(sqrt (* 2.0 (+ A (+ C (hypot B (- A C))))))
(- (sqrt (* F (fma -4.0 (* A C) (pow B 2.0))))))
t_0)
(if (<= t_3 0.0)
(/
(- (sqrt (* t_1 (* 2.0 (+ A (+ A (* -0.5 (/ (pow B 2.0) C))))))))
t_0)
(if (<= t_3 INFINITY)
(/
(* (sqrt (* 2.0 (+ (hypot (- A C) B) (+ A C)))) (- (sqrt t_1)))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double t_1 = F * t_0;
double t_2 = pow(B, 2.0) - (C * (4.0 * A));
double t_3 = -sqrt(((2.0 * (t_2 * F)) * (sqrt((pow(B, 2.0) + pow((A - C), 2.0))) + (A + C)))) / t_2;
double tmp;
if (t_3 <= -2e-187) {
tmp = (sqrt((2.0 * (A + (C + hypot(B, (A - C)))))) * -sqrt((F * fma(-4.0, (A * C), pow(B, 2.0))))) / t_0;
} else if (t_3 <= 0.0) {
tmp = -sqrt((t_1 * (2.0 * (A + (A + (-0.5 * (pow(B, 2.0) / C))))))) / t_0;
} else if (t_3 <= ((double) INFINITY)) {
tmp = (sqrt((2.0 * (hypot((A - C), B) + (A + C)))) * -sqrt(t_1)) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) t_1 = Float64(F * t_0) t_2 = Float64((B ^ 2.0) - Float64(C * Float64(4.0 * A))) t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))) + Float64(A + C))))) / t_2) tmp = 0.0 if (t_3 <= -2e-187) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))) * Float64(-sqrt(Float64(F * fma(-4.0, Float64(A * C), (B ^ 2.0)))))) / t_0); elseif (t_3 <= 0.0) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * Float64(A + Float64(A + Float64(-0.5 * Float64((B ^ 2.0) / C)))))))) / t_0); elseif (t_3 <= Inf) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(hypot(Float64(A - C), B) + Float64(A + C)))) * Float64(-sqrt(t_1))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-187], N[(N[(N[Sqrt[N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(F * N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * N[(A + N[(A + N[(-0.5 * N[(N[Power[B, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[Sqrt[N[(2.0 * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[t$95$1], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := F \cdot t_0\\
t_2 := {B}^{2} - C \cdot \left(4 \cdot A\right)\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} + \left(A + C\right)\right)}}{t_2}\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{-187}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(-\sqrt{F \cdot \mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}\right)}{t_0}\\
\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(A + \left(A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{hypot}\left(A - C, B\right) + \left(A + C\right)\right)} \cdot \left(-\sqrt{t_1}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -2e-187Initial program 42.3%
Simplified50.7%
add-cube-cbrt50.3%
pow250.3%
hypot-udef41.9%
unpow241.9%
unpow241.9%
+-commutative41.9%
unpow241.9%
unpow241.9%
hypot-def50.3%
hypot-udef41.9%
unpow241.9%
unpow241.9%
+-commutative41.9%
unpow241.9%
unpow241.9%
Applied egg-rr50.3%
sqrt-prod65.2%
unpow265.2%
add-cube-cbrt65.6%
associate-+l+64.8%
+-commutative64.8%
Applied egg-rr64.8%
*-commutative64.8%
fma-udef64.8%
unpow264.8%
associate-*r*64.8%
*-commutative64.8%
+-commutative64.8%
fma-def64.8%
*-commutative64.8%
+-commutative64.8%
hypot-def49.8%
unpow249.8%
unpow249.8%
+-commutative49.8%
associate-+r+49.8%
unpow249.8%
Simplified65.6%
if -2e-187 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -0.0Initial program 3.7%
Simplified7.8%
Taylor expanded in C around -inf 35.5%
if -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 26.3%
Simplified57.4%
sqrt-prod92.8%
*-commutative92.8%
associate-+r+92.8%
hypot-udef28.2%
unpow228.2%
unpow228.2%
+-commutative28.2%
+-commutative28.2%
unpow228.2%
unpow228.2%
hypot-def92.8%
Applied egg-rr92.8%
+-commutative92.8%
Simplified92.8%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Taylor expanded in A around 0 2.1%
mul-1-neg2.1%
distribute-rgt-neg-in2.1%
unpow22.1%
unpow22.1%
hypot-def17.8%
Simplified17.8%
pow1/217.8%
*-commutative17.8%
hypot-udef2.2%
unpow22.2%
unpow22.2%
unpow-prod-down2.1%
pow1/22.1%
unpow22.1%
unpow22.1%
hypot-udef28.7%
pow1/228.7%
Applied egg-rr28.7%
Final simplification50.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* C (* 4.0 A)))))
(if (<= (pow B 2.0) 1e+260)
(/
(* (sqrt (+ A (+ C (hypot B (- A C))))) (- (sqrt (* t_0 (* 2.0 F)))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - (C * (4.0 * A));
double tmp;
if (pow(B, 2.0) <= 1e+260) {
tmp = (sqrt((A + (C + hypot(B, (A - C))))) * -sqrt((t_0 * (2.0 * F)))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - (C * (4.0 * A));
double tmp;
if (Math.pow(B, 2.0) <= 1e+260) {
tmp = (Math.sqrt((A + (C + Math.hypot(B, (A - C))))) * -Math.sqrt((t_0 * (2.0 * F)))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt((C + Math.hypot(B, C))) * -Math.sqrt(F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = math.pow(B, 2.0) - (C * (4.0 * A)) tmp = 0 if math.pow(B, 2.0) <= 1e+260: tmp = (math.sqrt((A + (C + math.hypot(B, (A - C))))) * -math.sqrt((t_0 * (2.0 * F)))) / t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt((C + math.hypot(B, C))) * -math.sqrt(F)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(C * Float64(4.0 * A))) tmp = 0.0 if ((B ^ 2.0) <= 1e+260) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(t_0 * Float64(2.0 * F))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B ^ 2.0) - (C * (4.0 * A)); tmp = 0.0; if ((B ^ 2.0) <= 1e+260) tmp = (sqrt((A + (C + hypot(B, (A - C))))) * -sqrt((t_0 * (2.0 * F)))) / t_0; else tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+260], N[(N[(N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := {B}^{2} - C \cdot \left(4 \cdot A\right)\\
\mathbf{if}\;{B}^{2} \leq 10^{+260}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{t_0 \cdot \left(2 \cdot F\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.00000000000000007e260Initial program 23.2%
+-commutative23.2%
unpow223.2%
unpow223.2%
hypot-udef31.9%
add-exp-log30.3%
hypot-udef22.5%
unpow222.5%
unpow222.5%
+-commutative22.5%
unpow222.5%
unpow222.5%
hypot-def30.3%
Applied egg-rr30.3%
sqrt-prod40.8%
*-commutative40.8%
*-commutative40.8%
*-commutative40.8%
rem-exp-log43.0%
+-commutative43.0%
Applied egg-rr43.0%
*-commutative43.0%
+-commutative43.0%
hypot-def26.2%
unpow226.2%
unpow226.2%
+-commutative26.2%
associate-+r+26.8%
unpow226.8%
unpow226.8%
hypot-def43.9%
associate-*r*43.9%
Simplified43.9%
if 1.00000000000000007e260 < (pow.f64 B 2) Initial program 3.5%
Taylor expanded in A around 0 6.6%
mul-1-neg6.6%
distribute-rgt-neg-in6.6%
unpow26.6%
unpow26.6%
hypot-def32.9%
Simplified32.9%
pow1/232.9%
*-commutative32.9%
hypot-udef6.6%
unpow26.6%
unpow26.6%
unpow-prod-down6.6%
pow1/26.6%
unpow26.6%
unpow26.6%
hypot-udef50.5%
pow1/250.5%
Applied egg-rr50.5%
Final simplification45.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* C (* 4.0 A)))) (t_1 (fma B B (* A (* C -4.0)))))
(if (<= (pow B 2.0) 2e-295)
(/ (- (sqrt (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0)
(if (<= (pow B 2.0) 2e-147)
(/ (- (sqrt (* (* F t_1) (* 2.0 (* 2.0 A))))) t_1)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - (C * (4.0 * A));
double t_1 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (pow(B, 2.0) <= 2e-295) {
tmp = -sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
} else if (pow(B, 2.0) <= 2e-147) {
tmp = -sqrt(((F * t_1) * (2.0 * (2.0 * A)))) / t_1;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(C * Float64(4.0 * A))) t_1 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B ^ 2.0) <= 2e-295) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0); elseif ((B ^ 2.0) <= 2e-147) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_1) * Float64(2.0 * Float64(2.0 * A))))) / t_1); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-295], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-147], N[((-N[Sqrt[N[(N[(F * t$95$1), $MachinePrecision] * N[(2.0 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := {B}^{2} - C \cdot \left(4 \cdot A\right)\\
t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-295}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-147}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_1\right) \cdot \left(2 \cdot \left(2 \cdot A\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.00000000000000012e-295Initial program 18.2%
Taylor expanded in A around -inf 28.7%
if 2.00000000000000012e-295 < (pow.f64 B 2) < 1.9999999999999999e-147Initial program 23.7%
Simplified47.2%
add-cube-cbrt47.0%
pow247.0%
hypot-udef24.4%
unpow224.4%
unpow224.4%
+-commutative24.4%
unpow224.4%
unpow224.4%
hypot-def47.0%
hypot-udef24.4%
unpow224.4%
unpow224.4%
+-commutative24.4%
unpow224.4%
unpow224.4%
Applied egg-rr47.0%
Taylor expanded in A around inf 41.7%
if 1.9999999999999999e-147 < (pow.f64 B 2) Initial program 17.7%
Taylor expanded in A around 0 11.4%
mul-1-neg11.4%
distribute-rgt-neg-in11.4%
unpow211.4%
unpow211.4%
hypot-def22.4%
Simplified22.4%
pow1/222.5%
*-commutative22.5%
hypot-udef11.6%
unpow211.6%
unpow211.6%
unpow-prod-down11.5%
pow1/211.5%
unpow211.5%
unpow211.5%
hypot-udef29.2%
pow1/229.2%
Applied egg-rr29.2%
Final simplification30.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= (pow B 2.0) 2e-20)
(/ (- (sqrt (* 2.0 (* t_0 (* F (+ (hypot (- A C) B) (+ A C))))))) t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (pow(B, 2.0) <= 2e-20) {
tmp = -sqrt((2.0 * (t_0 * (F * (hypot((A - C), B) + (A + C)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B ^ 2.0) <= 2e-20) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(hypot(Float64(A - C), B) + Float64(A + C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-20], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-20}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(\mathsf{hypot}\left(A - C, B\right) + \left(A + C\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.99999999999999989e-20Initial program 20.0%
expm1-log1p-u8.9%
expm1-udef5.5%
Applied egg-rr8.8%
Simplified29.8%
if 1.99999999999999989e-20 < (pow.f64 B 2) Initial program 17.0%
Taylor expanded in A around 0 11.3%
mul-1-neg11.3%
distribute-rgt-neg-in11.3%
unpow211.3%
unpow211.3%
hypot-def24.6%
Simplified24.6%
pow1/224.7%
*-commutative24.7%
hypot-udef11.4%
unpow211.4%
unpow211.4%
unpow-prod-down11.3%
pow1/211.3%
unpow211.3%
unpow211.3%
hypot-udef33.0%
pow1/233.0%
Applied egg-rr33.0%
Final simplification31.4%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= B 8.2e+129)
(/
(* (sqrt (* 2.0 (+ (hypot (- A C) B) (+ A C)))) (- (sqrt (* F t_0))))
t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (B <= 8.2e+129) {
tmp = (sqrt((2.0 * (hypot((A - C), B) + (A + C)))) * -sqrt((F * t_0))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B <= 8.2e+129) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(hypot(Float64(A - C), B) + Float64(A + C)))) * Float64(-sqrt(Float64(F * t_0)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 8.2e+129], N[(N[(N[Sqrt[N[(2.0 * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(F * t$95$0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq 8.2 \cdot 10^{+129}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{hypot}\left(A - C, B\right) + \left(A + C\right)\right)} \cdot \left(-\sqrt{F \cdot t_0}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 8.2000000000000005e129Initial program 20.8%
Simplified29.6%
sqrt-prod39.4%
*-commutative39.4%
associate-+r+38.6%
hypot-udef23.5%
unpow223.5%
unpow223.5%
+-commutative23.5%
+-commutative23.5%
unpow223.5%
unpow223.5%
hypot-def38.6%
Applied egg-rr38.6%
+-commutative38.6%
Simplified38.6%
if 8.2000000000000005e129 < B Initial program 3.0%
Taylor expanded in A around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
unpow211.0%
unpow211.0%
hypot-def57.5%
Simplified57.5%
pow1/257.5%
*-commutative57.5%
hypot-udef11.0%
unpow211.0%
unpow211.0%
unpow-prod-down11.0%
pow1/211.0%
unpow211.0%
unpow211.0%
hypot-udef88.6%
pow1/288.6%
Applied egg-rr88.6%
Final simplification45.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= B 3.4e+44)
(/ (- (sqrt (* (* 2.0 (+ A (+ C (hypot B (- A C))))) (* F t_0)))) t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (B <= 3.4e+44) {
tmp = -sqrt(((2.0 * (A + (C + hypot(B, (A - C))))) * (F * t_0))) / t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B <= 3.4e+44) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C))))) * Float64(F * t_0)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.4e+44], N[((-N[Sqrt[N[(N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq 3.4 \cdot 10^{+44}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right) \cdot \left(F \cdot t_0\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 3.4e44Initial program 20.9%
Simplified29.8%
if 3.4e44 < B Initial program 8.6%
Taylor expanded in A around 0 18.2%
mul-1-neg18.2%
distribute-rgt-neg-in18.2%
unpow218.2%
unpow218.2%
hypot-def51.8%
Simplified51.8%
pow1/251.8%
*-commutative51.8%
hypot-udef18.3%
unpow218.3%
unpow218.3%
unpow-prod-down18.3%
pow1/218.3%
unpow218.3%
unpow218.3%
hypot-udef73.0%
pow1/273.0%
Applied egg-rr73.0%
Final simplification38.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))) (t_1 (- (pow B 2.0) (* C (* 4.0 A)))))
(if (<= B 6.8e-224)
(/ (- (sqrt (* (* 2.0 (* t_1 F)) (* 2.0 C)))) t_1)
(if (<= B 2.65e-73)
(/ (- (sqrt (* (* F t_0) (* 2.0 (* 2.0 A))))) t_0)
(if (<= B 5e+176)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A))))))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double t_1 = pow(B, 2.0) - (C * (4.0 * A));
double tmp;
if (B <= 6.8e-224) {
tmp = -sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1;
} else if (B <= 2.65e-73) {
tmp = -sqrt(((F * t_0) * (2.0 * (2.0 * A)))) / t_0;
} else if (B <= 5e+176) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) t_1 = Float64((B ^ 2.0) - Float64(C * Float64(4.0 * A))) tmp = 0.0 if (B <= 6.8e-224) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(2.0 * C)))) / t_1); elseif (B <= 2.65e-73) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(2.0 * A))))) / t_0); elseif (B <= 5e+176) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 6.8e-224], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 2.65e-73], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 5e+176], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := {B}^{2} - C \cdot \left(4 \cdot A\right)\\
\mathbf{if}\;B \leq 6.8 \cdot 10^{-224}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\
\mathbf{elif}\;B \leq 2.65 \cdot 10^{-73}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 5 \cdot 10^{+176}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 6.79999999999999984e-224Initial program 20.0%
Taylor expanded in A around -inf 16.1%
if 6.79999999999999984e-224 < B < 2.64999999999999986e-73Initial program 18.0%
Simplified35.1%
add-cube-cbrt34.6%
pow234.6%
hypot-udef18.2%
unpow218.2%
unpow218.2%
+-commutative18.2%
unpow218.2%
unpow218.2%
hypot-def34.6%
hypot-udef18.2%
unpow218.2%
unpow218.2%
+-commutative18.2%
unpow218.2%
unpow218.2%
Applied egg-rr34.6%
Taylor expanded in A around inf 21.2%
if 2.64999999999999986e-73 < B < 5e176Initial program 23.9%
Taylor expanded in C around 0 31.8%
mul-1-neg31.8%
distribute-rgt-neg-in31.8%
+-commutative31.8%
unpow231.8%
unpow231.8%
hypot-def42.6%
Simplified42.6%
if 5e176 < B Initial program 0.0%
Taylor expanded in A around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
unpow22.5%
unpow22.5%
hypot-def48.2%
Simplified48.2%
Taylor expanded in C around 0 59.1%
associate-*r*59.1%
mul-1-neg59.1%
Simplified59.1%
Final simplification25.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= B 5.8e-74)
(/ (- (sqrt (* (* F t_0) (* 2.0 (* 2.0 A))))) t_0)
(if (<= B 5.2e+176)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A))))))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (B <= 5.8e-74) {
tmp = -sqrt(((F * t_0) * (2.0 * (2.0 * A)))) / t_0;
} else if (B <= 5.2e+176) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B <= 5.8e-74) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(2.0 * A))))) / t_0); elseif (B <= 5.2e+176) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 5.8e-74], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 5.2e+176], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq 5.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
\mathbf{elif}\;B \leq 5.2 \cdot 10^{+176}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if B < 5.8e-74Initial program 19.7%
Simplified29.7%
add-cube-cbrt29.4%
pow229.4%
hypot-udef20.2%
unpow220.2%
unpow220.2%
+-commutative20.2%
unpow220.2%
unpow220.2%
hypot-def29.4%
hypot-udef20.2%
unpow220.2%
unpow220.2%
+-commutative20.2%
unpow220.2%
unpow220.2%
Applied egg-rr29.4%
Taylor expanded in A around inf 18.4%
if 5.8e-74 < B < 5.19999999999999981e176Initial program 23.9%
Taylor expanded in C around 0 31.8%
mul-1-neg31.8%
distribute-rgt-neg-in31.8%
+-commutative31.8%
unpow231.8%
unpow231.8%
hypot-def42.6%
Simplified42.6%
if 5.19999999999999981e176 < B Initial program 0.0%
Taylor expanded in A around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
unpow22.5%
unpow22.5%
hypot-def48.2%
Simplified48.2%
Taylor expanded in C around 0 59.1%
associate-*r*59.1%
mul-1-neg59.1%
Simplified59.1%
Final simplification27.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 1.75e-278)
(/
(- (sqrt (* 2.0 (* -8.0 (* (pow A 2.0) (* C F))))))
(fma B B (* A (* C -4.0))))
(if (<= F 4e+56)
(* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A))))))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1.75e-278) {
tmp = -sqrt((2.0 * (-8.0 * (pow(A, 2.0) * (C * F))))) / fma(B, B, (A * (C * -4.0)));
} else if (F <= 4e+56) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 1.75e-278) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64((A ^ 2.0) * Float64(C * F)))))) / fma(B, B, Float64(A * Float64(C * -4.0)))); elseif (F <= 4e+56) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 1.75e-278], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(N[Power[A, 2.0], $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e+56], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.75 \cdot 10^{-278}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+56}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 1.74999999999999985e-278Initial program 17.4%
expm1-log1p-u16.6%
expm1-udef11.2%
Applied egg-rr18.2%
Simplified39.7%
Taylor expanded in B around 0 19.1%
*-commutative19.1%
Simplified19.1%
if 1.74999999999999985e-278 < F < 4.00000000000000037e56Initial program 21.0%
Taylor expanded in C around 0 11.1%
mul-1-neg11.1%
distribute-rgt-neg-in11.1%
+-commutative11.1%
unpow211.1%
unpow211.1%
hypot-def26.8%
Simplified26.8%
if 4.00000000000000037e56 < F Initial program 16.9%
Taylor expanded in A around 0 6.8%
mul-1-neg6.8%
distribute-rgt-neg-in6.8%
unpow26.8%
unpow26.8%
hypot-def7.9%
Simplified7.9%
Taylor expanded in C around 0 16.6%
associate-*r*16.6%
mul-1-neg16.6%
Simplified16.6%
Final simplification20.8%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= F 6.6e+53) (* (/ (sqrt 2.0) B) (- (sqrt (* F (+ A (hypot B A)))))) (* (sqrt 2.0) (- (sqrt (/ F B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 6.6e+53) {
tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A))));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 6.6e+53) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A + Math.hypot(B, A))));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 6.6e+53: tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A + math.hypot(B, A)))) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 6.6e+53) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A + hypot(B, A)))))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 6.6e+53) tmp = (sqrt(2.0) / B) * -sqrt((F * (A + hypot(B, A)))); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 6.6e+53], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6.6 \cdot 10^{+53}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 6.6000000000000004e53Initial program 19.7%
Taylor expanded in C around 0 8.1%
mul-1-neg8.1%
distribute-rgt-neg-in8.1%
+-commutative8.1%
unpow28.1%
unpow28.1%
hypot-def19.4%
Simplified19.4%
if 6.6000000000000004e53 < F Initial program 16.9%
Taylor expanded in A around 0 6.8%
mul-1-neg6.8%
distribute-rgt-neg-in6.8%
unpow26.8%
unpow26.8%
hypot-def7.9%
Simplified7.9%
Taylor expanded in C around 0 16.6%
associate-*r*16.6%
mul-1-neg16.6%
Simplified16.6%
Final simplification18.2%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= F 3.8e+63) (/ (- (sqrt (* (* 2.0 F) (+ C (hypot C B))))) B) (* (sqrt 2.0) (- (sqrt (/ F B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.8e+63) {
tmp = -sqrt(((2.0 * F) * (C + hypot(C, B)))) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.8e+63) {
tmp = -Math.sqrt(((2.0 * F) * (C + Math.hypot(C, B)))) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 3.8e+63: tmp = -math.sqrt(((2.0 * F) * (C + math.hypot(C, B)))) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 3.8e+63) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(C, B))))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 3.8e+63) tmp = -sqrt(((2.0 * F) * (C + hypot(C, B)))) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 3.8e+63], N[((-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.8 \cdot 10^{+63}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 3.8000000000000001e63Initial program 20.0%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
distribute-rgt-neg-in8.6%
unpow28.6%
unpow28.6%
hypot-def19.8%
Simplified19.8%
Applied egg-rr3.4%
expm1-def19.1%
expm1-log1p20.1%
distribute-neg-frac20.1%
unpow1/219.8%
associate-*r*19.8%
hypot-def8.6%
unpow28.6%
unpow28.6%
+-commutative8.6%
unpow28.6%
unpow28.6%
hypot-def19.8%
Simplified19.8%
if 3.8000000000000001e63 < F Initial program 16.4%
Taylor expanded in A around 0 6.9%
mul-1-neg6.9%
distribute-rgt-neg-in6.9%
unpow26.9%
unpow26.9%
hypot-def8.0%
Simplified8.0%
Taylor expanded in C around 0 16.9%
associate-*r*16.9%
mul-1-neg16.9%
Simplified16.9%
Final simplification18.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= F 0.0025) (* (/ (sqrt 2.0) B) (- (sqrt (* B F)))) (* (sqrt 2.0) (- (sqrt (/ F B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 0.0025) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
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) :: tmp
if (f <= 0.0025d0) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 0.0025) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 0.0025: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 0.0025) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 0.0025) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 0.0025], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 0.0025:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 0.00250000000000000005Initial program 19.9%
Taylor expanded in A around 0 7.3%
mul-1-neg7.3%
distribute-rgt-neg-in7.3%
unpow27.3%
unpow27.3%
hypot-def17.9%
Simplified17.9%
Taylor expanded in C around 0 16.2%
*-commutative16.2%
Simplified16.2%
if 0.00250000000000000005 < F Initial program 17.1%
Taylor expanded in A around 0 8.4%
mul-1-neg8.4%
distribute-rgt-neg-in8.4%
unpow28.4%
unpow28.4%
hypot-def11.8%
Simplified11.8%
Taylor expanded in C around 0 19.0%
associate-*r*19.0%
mul-1-neg19.0%
Simplified19.0%
Final simplification17.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (sqrt 2.0) (- (sqrt (/ F B)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return sqrt(2.0) * -sqrt((F / B));
}
NOTE: B should be positive before calling this function
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
code = sqrt(2.0d0) * -sqrt((f / b))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return Math.sqrt(2.0) * -Math.sqrt((F / B));
}
B = abs(B) def code(A, B, C, F): return math.sqrt(2.0) * -math.sqrt((F / B))
B = abs(B) function code(A, B, C, F) return Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = sqrt(2.0) * -sqrt((F / B)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)
\end{array}
Initial program 18.5%
Taylor expanded in A around 0 7.9%
mul-1-neg7.9%
distribute-rgt-neg-in7.9%
unpow27.9%
unpow27.9%
hypot-def14.8%
Simplified14.8%
Taylor expanded in C around 0 13.3%
associate-*r*13.3%
mul-1-neg13.3%
Simplified13.3%
Final simplification13.3%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (/ (- 2.0) B) (sqrt (* C F))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (-2.0 / B) * sqrt((C * F));
}
NOTE: B should be positive before calling this function
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
code = (-2.0d0 / b) * sqrt((c * f))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return (-2.0 / B) * Math.sqrt((C * F));
}
B = abs(B) def code(A, B, C, F): return (-2.0 / B) * math.sqrt((C * F))
B = abs(B) function code(A, B, C, F) return Float64(Float64(Float64(-2.0) / B) * sqrt(Float64(C * F))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (-2.0 / B) * sqrt((C * F)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[((-2.0) / B), $MachinePrecision] * N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{-2}{B} \cdot \sqrt{C \cdot F}
\end{array}
Initial program 18.5%
Taylor expanded in A around 0 7.9%
mul-1-neg7.9%
distribute-rgt-neg-in7.9%
unpow27.9%
unpow27.9%
hypot-def14.8%
Simplified14.8%
Taylor expanded in B around 0 2.7%
associate-*r*2.7%
mul-1-neg2.7%
unpow22.7%
rem-square-sqrt2.7%
*-commutative2.7%
Simplified2.7%
Final simplification2.7%
herbie shell --seed 2023308
(FPCore (A B C F)
:name "ABCF->ab-angle a"
: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))))