
(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)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (hypot (- A C) B_m))
(t_1 (fma B_m B_m (* A (* C -4.0))))
(t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_3 (* 2.0 (* t_2 F)))
(t_4
(/
(-
(sqrt
(* t_3 (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0)))))))
t_2)))
(if (<= t_4 -2e-167)
(/ (* (sqrt (+ A (+ C t_0))) (- (sqrt (* 2.0 (* F t_1))))) t_2)
(if (<= t_4 0.0)
(/ (- (sqrt (* t_3 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C))))) t_2)
(if (<= t_4 INFINITY)
(* (sqrt (* (+ (+ A C) t_0) (* t_1 (* 2.0 F)))) (/ -1.0 t_1))
(*
(* (sqrt (+ A (hypot B_m A))) (sqrt F))
(- (/ (sqrt 2.0) B_m))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = hypot((A - C), B_m);
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_3 = 2.0 * (t_2 * F);
double t_4 = -sqrt((t_3 * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
double tmp;
if (t_4 <= -2e-167) {
tmp = (sqrt((A + (C + t_0))) * -sqrt((2.0 * (F * t_1)))) / t_2;
} else if (t_4 <= 0.0) {
tmp = -sqrt((t_3 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((((A + C) + t_0) * (t_1 * (2.0 * F)))) * (-1.0 / t_1);
} else {
tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * -(sqrt(2.0) / B_m);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = hypot(Float64(A - C), B_m) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_3 = Float64(2.0 * Float64(t_2 * F)) t_4 = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2) tmp = 0.0 if (t_4 <= -2e-167) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + t_0))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_1))))) / t_2); elseif (t_4 <= 0.0) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))))) / t_2); elseif (t_4 <= Inf) tmp = Float64(sqrt(Float64(Float64(Float64(A + C) + t_0) * Float64(t_1 * Float64(2.0 * F)))) * Float64(-1.0 / t_1)); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * Float64(-Float64(sqrt(2.0) / B_m))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[N[(t$95$3 * 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]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, -2e-167], N[(N[(N[Sqrt[N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, 0.0], N[((-N[Sqrt[N[(t$95$3 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision] * N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * (-N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision])), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(A - C, B_m\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := 2 \cdot \left(t_2 \cdot F\right)\\
t_4 := \frac{-\sqrt{t_3 \cdot \left(\left(A + C\right) + \sqrt{{B_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{-167}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + t_0\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_1\right)}\right)}{t_2}\\
\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\frac{-\sqrt{t_3 \cdot \left(-0.5 \cdot \frac{{B_m}^{2}}{A} + 2 \cdot C\right)}}{t_2}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{\left(\left(A + C\right) + t_0\right) \cdot \left(t_1 \cdot \left(2 \cdot F\right)\right)} \cdot \frac{-1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B_m, A\right)} \cdot \sqrt{F}\right) \cdot \left(-\frac{\sqrt{2}}{B_m}\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-167Initial program 41.1%
sqrt-prod45.0%
associate-*r*45.0%
associate-*l*45.0%
associate-+l+45.0%
unpow245.0%
unpow245.0%
hypot-def65.3%
Applied egg-rr65.3%
*-commutative65.3%
associate-*l*65.3%
*-commutative65.3%
unpow265.3%
fma-neg65.3%
distribute-lft-neg-in65.3%
metadata-eval65.3%
*-commutative65.3%
associate-*l*65.3%
Simplified65.3%
if -2e-167 < (/.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.5%
Taylor expanded in A around -inf 42.7%
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 52.2%
Simplified60.8%
pow1/260.8%
pow-to-exp57.3%
Applied egg-rr57.3%
Applied egg-rr60.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 C around 0 1.9%
mul-1-neg1.9%
*-commutative1.9%
distribute-rgt-neg-in1.9%
+-commutative1.9%
unpow21.9%
unpow21.9%
hypot-def23.2%
Simplified23.2%
pow1/223.3%
*-commutative23.3%
unpow-prod-down32.0%
pow1/232.0%
pow1/232.0%
Applied egg-rr32.0%
Final simplification48.6%
B_m = (fabs.f64 B)
(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) 2e+93)
(/
(* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (- (sqrt (* t_0 (* 2.0 F)))))
t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ C (hypot B_m C)))))))))B_m = fabs(B);
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) <= 2e+93) {
tmp = (sqrt(((A + C) + hypot((A - C), B_m))) * -sqrt((t_0 * (2.0 * F)))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
}
return tmp;
}
B_m = abs(B) 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) <= 2e+93) tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) * Float64(-sqrt(Float64(t_0 * Float64(2.0 * F))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C)))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
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], 2e+93], N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $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$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\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 2 \cdot 10^{+93}:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B_m\right)} \cdot \left(-\sqrt{t_0 \cdot \left(2 \cdot F\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.00000000000000009e93Initial program 27.5%
Simplified34.7%
flip-+14.8%
hypot-udef14.8%
unpow214.8%
unpow214.8%
hypot-udef14.8%
unpow214.8%
unpow214.8%
add-sqr-sqrt14.8%
+-commutative14.8%
div-sub14.8%
Applied egg-rr14.8%
div-sub14.8%
Simplified14.8%
pow1/214.9%
*-commutative14.9%
unpow214.9%
unpow214.9%
flip-+34.7%
unpow-prod-down39.8%
pow1/239.8%
associate-+r+39.0%
pow1/239.0%
Applied egg-rr39.0%
if 2.00000000000000009e93 < (pow.f64 B 2) Initial program 11.0%
Taylor expanded in A around 0 10.9%
mul-1-neg10.9%
*-commutative10.9%
distribute-rgt-neg-in10.9%
unpow210.9%
unpow210.9%
hypot-def32.1%
Simplified32.1%
pow1/232.1%
*-commutative32.1%
unpow-prod-down40.3%
pow1/240.3%
pow1/240.3%
Applied egg-rr40.3%
Final simplification39.5%
B_m = (fabs.f64 B)
(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) 40.0)
(/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A (+ C (hypot B_m (- A C))))))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ C (hypot B_m C)))))))))B_m = fabs(B);
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) <= 40.0) {
tmp = -sqrt(((t_0 * (2.0 * F)) * (A + (C + hypot(B_m, (A - C)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
}
return tmp;
}
B_m = abs(B) 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) <= 40.0) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C)))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
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], 40.0], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\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 40:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 40Initial program 25.7%
Simplified34.1%
if 40 < (pow.f64 B 2) Initial program 15.7%
Taylor expanded in A around 0 11.9%
mul-1-neg11.9%
*-commutative11.9%
distribute-rgt-neg-in11.9%
unpow211.9%
unpow211.9%
hypot-def29.5%
Simplified29.5%
pow1/229.5%
*-commutative29.5%
unpow-prod-down37.0%
pow1/237.0%
pow1/237.0%
Applied egg-rr37.0%
Final simplification35.6%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (pow B_m 2.0) (* (* 4.0 A) C))))
(if (<= (pow B_m 2.0) 1e-12)
(/ (- (sqrt (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ C (hypot B_m C)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = pow(B_m, 2.0) - ((4.0 * A) * C);
double tmp;
if (pow(B_m, 2.0) <= 1e-12) {
tmp = -sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.pow(B_m, 2.0) - ((4.0 * A) * C);
double tmp;
if (Math.pow(B_m, 2.0) <= 1e-12) {
tmp = -Math.sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * -Math.sqrt((C + Math.hypot(B_m, C))));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.pow(B_m, 2.0) - ((4.0 * A) * C) tmp = 0 if math.pow(B_m, 2.0) <= 1e-12: tmp = -math.sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0 else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(F) * -math.sqrt((C + math.hypot(B_m, C)))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-12) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C)))))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (B_m ^ 2.0) - ((4.0 * A) * C); tmp = 0.0; if ((B_m ^ 2.0) <= 1e-12) tmp = -sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0; else tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C)))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-12], 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], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B_m}^{2} \leq 10^{-12}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 9.9999999999999998e-13Initial program 25.2%
Taylor expanded in A around -inf 32.2%
if 9.9999999999999998e-13 < (pow.f64 B 2) Initial program 16.5%
Taylor expanded in A around 0 12.1%
mul-1-neg12.1%
*-commutative12.1%
distribute-rgt-neg-in12.1%
unpow212.1%
unpow212.1%
hypot-def28.9%
Simplified28.9%
pow1/229.0%
*-commutative29.0%
unpow-prod-down36.1%
pow1/236.1%
pow1/236.1%
Applied egg-rr36.1%
Final simplification34.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (/ (sqrt 2.0) B_m))) (t_1 (- (pow B_m 2.0) (* (* 4.0 A) C))))
(if (<= B_m 1.2e-6)
(/ (- (sqrt (* (* 2.0 (* t_1 F)) (* 2.0 C)))) t_1)
(if (<= B_m 1.26e+174)
(* t_0 (sqrt (* F (+ C (hypot B_m C)))))
(* (* (sqrt (+ A (hypot B_m A))) (sqrt F)) t_0)))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -(sqrt(2.0) / B_m);
double t_1 = pow(B_m, 2.0) - ((4.0 * A) * C);
double tmp;
if (B_m <= 1.2e-6) {
tmp = -sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1;
} else if (B_m <= 1.26e+174) {
tmp = t_0 * sqrt((F * (C + hypot(B_m, C))));
} else {
tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * t_0;
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = -(Math.sqrt(2.0) / B_m);
double t_1 = Math.pow(B_m, 2.0) - ((4.0 * A) * C);
double tmp;
if (B_m <= 1.2e-6) {
tmp = -Math.sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1;
} else if (B_m <= 1.26e+174) {
tmp = t_0 * Math.sqrt((F * (C + Math.hypot(B_m, C))));
} else {
tmp = (Math.sqrt((A + Math.hypot(B_m, A))) * Math.sqrt(F)) * t_0;
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = -(math.sqrt(2.0) / B_m) t_1 = math.pow(B_m, 2.0) - ((4.0 * A) * C) tmp = 0 if B_m <= 1.2e-6: tmp = -math.sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1 elif B_m <= 1.26e+174: tmp = t_0 * math.sqrt((F * (C + math.hypot(B_m, C)))) else: tmp = (math.sqrt((A + math.hypot(B_m, A))) * math.sqrt(F)) * t_0 return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(-Float64(sqrt(2.0) / B_m)) t_1 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) tmp = 0.0 if (B_m <= 1.2e-6) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(2.0 * C)))) / t_1); elseif (B_m <= 1.26e+174) tmp = Float64(t_0 * sqrt(Float64(F * Float64(C + hypot(B_m, C))))); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * t_0); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = -(sqrt(2.0) / B_m); t_1 = (B_m ^ 2.0) - ((4.0 * A) * C); tmp = 0.0; if (B_m <= 1.2e-6) tmp = -sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1; elseif (B_m <= 1.26e+174) tmp = t_0 * sqrt((F * (C + hypot(B_m, C)))); else tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * t_0; end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = (-N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision])}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.2e-6], 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$95$m, 1.26e+174], N[(t$95$0 * N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := -\frac{\sqrt{2}}{B_m}\\
t_1 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B_m \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\
\mathbf{elif}\;B_m \leq 1.26 \cdot 10^{+174}:\\
\;\;\;\;t_0 \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B_m, A\right)} \cdot \sqrt{F}\right) \cdot t_0\\
\end{array}
\end{array}
if B < 1.1999999999999999e-6Initial program 22.0%
Taylor expanded in A around -inf 22.4%
if 1.1999999999999999e-6 < B < 1.26000000000000006e174Initial program 32.2%
Taylor expanded in A around 0 40.7%
mul-1-neg40.7%
*-commutative40.7%
distribute-rgt-neg-in40.7%
unpow240.7%
unpow240.7%
hypot-def49.1%
Simplified49.1%
if 1.26000000000000006e174 < B Initial program 0.0%
Taylor expanded in C around 0 2.3%
mul-1-neg2.3%
*-commutative2.3%
distribute-rgt-neg-in2.3%
+-commutative2.3%
unpow22.3%
unpow22.3%
hypot-def63.3%
Simplified63.3%
pow1/263.3%
*-commutative63.3%
unpow-prod-down89.6%
pow1/289.6%
pow1/289.6%
Applied egg-rr89.6%
Final simplification34.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m)) (t_1 (- (pow B_m 2.0) (* (* 4.0 A) C))))
(if (<= B_m 8.9e-7)
(/ (- (sqrt (* (* 2.0 (* t_1 F)) (* 2.0 C)))) t_1)
(if (<= B_m 1.25e+174)
(* (- t_0) (sqrt (* F (+ C (hypot B_m C)))))
(- (* t_0 (* (sqrt F) (sqrt (+ B_m C)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double t_1 = pow(B_m, 2.0) - ((4.0 * A) * C);
double tmp;
if (B_m <= 8.9e-7) {
tmp = -sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1;
} else if (B_m <= 1.25e+174) {
tmp = -t_0 * sqrt((F * (C + hypot(B_m, C))));
} else {
tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C))));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(2.0) / B_m;
double t_1 = Math.pow(B_m, 2.0) - ((4.0 * A) * C);
double tmp;
if (B_m <= 8.9e-7) {
tmp = -Math.sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1;
} else if (B_m <= 1.25e+174) {
tmp = -t_0 * Math.sqrt((F * (C + Math.hypot(B_m, C))));
} else {
tmp = -(t_0 * (Math.sqrt(F) * Math.sqrt((B_m + C))));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(2.0) / B_m t_1 = math.pow(B_m, 2.0) - ((4.0 * A) * C) tmp = 0 if B_m <= 8.9e-7: tmp = -math.sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1 elif B_m <= 1.25e+174: tmp = -t_0 * math.sqrt((F * (C + math.hypot(B_m, C)))) else: tmp = -(t_0 * (math.sqrt(F) * math.sqrt((B_m + C)))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) t_1 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) tmp = 0.0 if (B_m <= 8.9e-7) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(2.0 * C)))) / t_1); elseif (B_m <= 1.25e+174) tmp = Float64(Float64(-t_0) * sqrt(Float64(F * Float64(C + hypot(B_m, C))))); else tmp = Float64(-Float64(t_0 * Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(2.0) / B_m; t_1 = (B_m ^ 2.0) - ((4.0 * A) * C); tmp = 0.0; if (B_m <= 8.9e-7) tmp = -sqrt(((2.0 * (t_1 * F)) * (2.0 * C))) / t_1; elseif (B_m <= 1.25e+174) tmp = -t_0 * sqrt((F * (C + hypot(B_m, C)))); else tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C)))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 8.9e-7], 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$95$m, 1.25e+174], N[((-t$95$0) * N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
t_1 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B_m \leq 8.9 \cdot 10^{-7}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\
\mathbf{elif}\;B_m \leq 1.25 \cdot 10^{+174}:\\
\;\;\;\;\left(-t_0\right) \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;-t_0 \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 8.899999999999999e-7Initial program 22.0%
Taylor expanded in A around -inf 22.4%
if 8.899999999999999e-7 < B < 1.2499999999999999e174Initial program 32.2%
Taylor expanded in A around 0 40.7%
mul-1-neg40.7%
*-commutative40.7%
distribute-rgt-neg-in40.7%
unpow240.7%
unpow240.7%
hypot-def49.1%
Simplified49.1%
if 1.2499999999999999e174 < B Initial program 0.0%
Taylor expanded in A around 0 2.3%
mul-1-neg2.3%
*-commutative2.3%
distribute-rgt-neg-in2.3%
unpow22.3%
unpow22.3%
hypot-def59.8%
Simplified59.8%
pow1/259.8%
*-commutative59.8%
unpow-prod-down83.1%
pow1/283.1%
pow1/283.1%
Applied egg-rr83.1%
Taylor expanded in C around 0 82.8%
Final simplification34.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m)) (t_1 (+ C (hypot B_m C))))
(if (<= B_m 9e-61)
(/
(- (sqrt (* t_1 (* 2.0 (* -4.0 (* A (* C F)))))))
(- (pow B_m 2.0) (* (* 4.0 A) C)))
(if (<= B_m 1.3e+174)
(* (- t_0) (sqrt (* F t_1)))
(- (* t_0 (* (sqrt F) (sqrt (+ B_m C)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double t_1 = C + hypot(B_m, C);
double tmp;
if (B_m <= 9e-61) {
tmp = -sqrt((t_1 * (2.0 * (-4.0 * (A * (C * F)))))) / (pow(B_m, 2.0) - ((4.0 * A) * C));
} else if (B_m <= 1.3e+174) {
tmp = -t_0 * sqrt((F * t_1));
} else {
tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C))));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(2.0) / B_m;
double t_1 = C + Math.hypot(B_m, C);
double tmp;
if (B_m <= 9e-61) {
tmp = -Math.sqrt((t_1 * (2.0 * (-4.0 * (A * (C * F)))))) / (Math.pow(B_m, 2.0) - ((4.0 * A) * C));
} else if (B_m <= 1.3e+174) {
tmp = -t_0 * Math.sqrt((F * t_1));
} else {
tmp = -(t_0 * (Math.sqrt(F) * Math.sqrt((B_m + C))));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(2.0) / B_m t_1 = C + math.hypot(B_m, C) tmp = 0 if B_m <= 9e-61: tmp = -math.sqrt((t_1 * (2.0 * (-4.0 * (A * (C * F)))))) / (math.pow(B_m, 2.0) - ((4.0 * A) * C)) elif B_m <= 1.3e+174: tmp = -t_0 * math.sqrt((F * t_1)) else: tmp = -(t_0 * (math.sqrt(F) * math.sqrt((B_m + C)))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) t_1 = Float64(C + hypot(B_m, C)) tmp = 0.0 if (B_m <= 9e-61) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * Float64(-4.0 * Float64(A * Float64(C * F))))))) / Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))); elseif (B_m <= 1.3e+174) tmp = Float64(Float64(-t_0) * sqrt(Float64(F * t_1))); else tmp = Float64(-Float64(t_0 * Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(2.0) / B_m; t_1 = C + hypot(B_m, C); tmp = 0.0; if (B_m <= 9e-61) tmp = -sqrt((t_1 * (2.0 * (-4.0 * (A * (C * F)))))) / ((B_m ^ 2.0) - ((4.0 * A) * C)); elseif (B_m <= 1.3e+174) tmp = -t_0 * sqrt((F * t_1)); else tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C)))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 9e-61], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.3e+174], N[((-t$95$0) * N[Sqrt[N[(F * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
t_1 := C + \mathsf{hypot}\left(B_m, C\right)\\
\mathbf{if}\;B_m \leq 9 \cdot 10^{-61}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{{B_m}^{2} - \left(4 \cdot A\right) \cdot C}\\
\mathbf{elif}\;B_m \leq 1.3 \cdot 10^{+174}:\\
\;\;\;\;\left(-t_0\right) \cdot \sqrt{F \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;-t_0 \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 9e-61Initial program 22.3%
Taylor expanded in A around 0 21.2%
unpow221.2%
unpow221.2%
hypot-def23.6%
Simplified23.6%
Taylor expanded in B around 0 14.5%
if 9e-61 < B < 1.2999999999999999e174Initial program 29.6%
Taylor expanded in A around 0 39.1%
mul-1-neg39.1%
*-commutative39.1%
distribute-rgt-neg-in39.1%
unpow239.1%
unpow239.1%
hypot-def46.3%
Simplified46.3%
if 1.2999999999999999e174 < B Initial program 0.0%
Taylor expanded in A around 0 2.3%
mul-1-neg2.3%
*-commutative2.3%
distribute-rgt-neg-in2.3%
unpow22.3%
unpow22.3%
hypot-def59.8%
Simplified59.8%
pow1/259.8%
*-commutative59.8%
unpow-prod-down83.1%
pow1/283.1%
pow1/283.1%
Applied egg-rr83.1%
Taylor expanded in C around 0 82.8%
Final simplification28.6%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m)))
(if (<= A -1.52e+98)
(* (- t_0) (sqrt (* -0.5 (/ (* (pow B_m 2.0) F) A))))
(if (<= A 2.85e+153)
(- (* t_0 (* (sqrt F) (sqrt (+ B_m C)))))
(- (/ (sqrt (* (* 2.0 F) (+ A (hypot B_m A)))) B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double tmp;
if (A <= -1.52e+98) {
tmp = -t_0 * sqrt((-0.5 * ((pow(B_m, 2.0) * F) / A)));
} else if (A <= 2.85e+153) {
tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C))));
} else {
tmp = -(sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / B_m);
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(2.0) / B_m;
double tmp;
if (A <= -1.52e+98) {
tmp = -t_0 * Math.sqrt((-0.5 * ((Math.pow(B_m, 2.0) * F) / A)));
} else if (A <= 2.85e+153) {
tmp = -(t_0 * (Math.sqrt(F) * Math.sqrt((B_m + C))));
} else {
tmp = -(Math.sqrt(((2.0 * F) * (A + Math.hypot(B_m, A)))) / B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(2.0) / B_m tmp = 0 if A <= -1.52e+98: tmp = -t_0 * math.sqrt((-0.5 * ((math.pow(B_m, 2.0) * F) / A))) elif A <= 2.85e+153: tmp = -(t_0 * (math.sqrt(F) * math.sqrt((B_m + C)))) else: tmp = -(math.sqrt(((2.0 * F) * (A + math.hypot(B_m, A)))) / B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) tmp = 0.0 if (A <= -1.52e+98) tmp = Float64(Float64(-t_0) * sqrt(Float64(-0.5 * Float64(Float64((B_m ^ 2.0) * F) / A)))); elseif (A <= 2.85e+153) tmp = Float64(-Float64(t_0 * Float64(sqrt(F) * sqrt(Float64(B_m + C))))); else tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A + hypot(B_m, A)))) / B_m)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(2.0) / B_m; tmp = 0.0; if (A <= -1.52e+98) tmp = -t_0 * sqrt((-0.5 * (((B_m ^ 2.0) * F) / A))); elseif (A <= 2.85e+153) tmp = -(t_0 * (sqrt(F) * sqrt((B_m + 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]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[A, -1.52e+98], N[((-t$95$0) * N[Sqrt[N[(-0.5 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] * F), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.85e+153], (-N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), (-N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision])]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
\mathbf{if}\;A \leq -1.52 \cdot 10^{+98}:\\
\;\;\;\;\left(-t_0\right) \cdot \sqrt{-0.5 \cdot \frac{{B_m}^{2} \cdot F}{A}}\\
\mathbf{elif}\;A \leq 2.85 \cdot 10^{+153}:\\
\;\;\;\;-t_0 \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}}{B_m}\\
\end{array}
\end{array}
if A < -1.52000000000000014e98Initial program 1.6%
Taylor expanded in C around 0 2.2%
mul-1-neg2.2%
*-commutative2.2%
distribute-rgt-neg-in2.2%
+-commutative2.2%
unpow22.2%
unpow22.2%
hypot-def6.8%
Simplified6.8%
Taylor expanded in A around -inf 20.5%
if -1.52000000000000014e98 < A < 2.84999999999999993e153Initial program 28.6%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
*-commutative11.8%
distribute-rgt-neg-in11.8%
unpow211.8%
unpow211.8%
hypot-def23.2%
Simplified23.2%
pow1/223.3%
*-commutative23.3%
unpow-prod-down28.2%
pow1/228.2%
pow1/228.2%
Applied egg-rr28.2%
Taylor expanded in C around 0 23.2%
if 2.84999999999999993e153 < A Initial program 4.5%
Taylor expanded in C around 0 1.0%
mul-1-neg1.0%
*-commutative1.0%
distribute-rgt-neg-in1.0%
+-commutative1.0%
unpow21.0%
unpow21.0%
hypot-def13.2%
Simplified13.2%
distribute-lft-in13.1%
Applied egg-rr13.1%
distribute-rgt-neg-out13.1%
add-sqr-sqrt12.3%
sqrt-unprod8.3%
sqr-neg8.3%
sqrt-unprod13.2%
add-sqr-sqrt13.7%
distribute-lft-in13.7%
*-commutative13.7%
distribute-frac-neg13.7%
associate-*l/13.8%
Applied egg-rr13.2%
*-commutative13.2%
*-commutative13.2%
associate-*l*13.2%
Simplified13.2%
Final simplification21.4%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m)))
(if (<= A -2.85e+99)
(* t_0 (- (sqrt (* F (* -0.5 (/ (pow B_m 2.0) A))))))
(if (<= A 8e+150)
(- (* t_0 (* (sqrt F) (sqrt (+ B_m C)))))
(- (/ (sqrt (* (* 2.0 F) (+ A (hypot B_m A)))) B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double tmp;
if (A <= -2.85e+99) {
tmp = t_0 * -sqrt((F * (-0.5 * (pow(B_m, 2.0) / A))));
} else if (A <= 8e+150) {
tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C))));
} else {
tmp = -(sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / B_m);
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(2.0) / B_m;
double tmp;
if (A <= -2.85e+99) {
tmp = t_0 * -Math.sqrt((F * (-0.5 * (Math.pow(B_m, 2.0) / A))));
} else if (A <= 8e+150) {
tmp = -(t_0 * (Math.sqrt(F) * Math.sqrt((B_m + C))));
} else {
tmp = -(Math.sqrt(((2.0 * F) * (A + Math.hypot(B_m, A)))) / B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(2.0) / B_m tmp = 0 if A <= -2.85e+99: tmp = t_0 * -math.sqrt((F * (-0.5 * (math.pow(B_m, 2.0) / A)))) elif A <= 8e+150: tmp = -(t_0 * (math.sqrt(F) * math.sqrt((B_m + C)))) else: tmp = -(math.sqrt(((2.0 * F) * (A + math.hypot(B_m, A)))) / B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) tmp = 0.0 if (A <= -2.85e+99) tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / A)))))); elseif (A <= 8e+150) tmp = Float64(-Float64(t_0 * Float64(sqrt(F) * sqrt(Float64(B_m + C))))); else tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A + hypot(B_m, A)))) / B_m)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(2.0) / B_m; tmp = 0.0; if (A <= -2.85e+99) tmp = t_0 * -sqrt((F * (-0.5 * ((B_m ^ 2.0) / A)))); elseif (A <= 8e+150) tmp = -(t_0 * (sqrt(F) * sqrt((B_m + 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]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[A, -2.85e+99], N[(t$95$0 * (-N[Sqrt[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[A, 8e+150], (-N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), (-N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision])]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
\mathbf{if}\;A \leq -2.85 \cdot 10^{+99}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{{B_m}^{2}}{A}\right)}\right)\\
\mathbf{elif}\;A \leq 8 \cdot 10^{+150}:\\
\;\;\;\;-t_0 \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}}{B_m}\\
\end{array}
\end{array}
if A < -2.85000000000000002e99Initial program 1.6%
Taylor expanded in C around 0 2.2%
mul-1-neg2.2%
*-commutative2.2%
distribute-rgt-neg-in2.2%
+-commutative2.2%
unpow22.2%
unpow22.2%
hypot-def6.8%
Simplified6.8%
Taylor expanded in A around -inf 22.6%
if -2.85000000000000002e99 < A < 7.99999999999999985e150Initial program 28.6%
Taylor expanded in A around 0 11.8%
mul-1-neg11.8%
*-commutative11.8%
distribute-rgt-neg-in11.8%
unpow211.8%
unpow211.8%
hypot-def23.2%
Simplified23.2%
pow1/223.3%
*-commutative23.3%
unpow-prod-down28.2%
pow1/228.2%
pow1/228.2%
Applied egg-rr28.2%
Taylor expanded in C around 0 23.2%
if 7.99999999999999985e150 < A Initial program 4.5%
Taylor expanded in C around 0 1.0%
mul-1-neg1.0%
*-commutative1.0%
distribute-rgt-neg-in1.0%
+-commutative1.0%
unpow21.0%
unpow21.0%
hypot-def13.2%
Simplified13.2%
distribute-lft-in13.1%
Applied egg-rr13.1%
distribute-rgt-neg-out13.1%
add-sqr-sqrt12.3%
sqrt-unprod8.3%
sqr-neg8.3%
sqrt-unprod13.2%
add-sqr-sqrt13.7%
distribute-lft-in13.7%
*-commutative13.7%
distribute-frac-neg13.7%
associate-*l/13.8%
Applied egg-rr13.2%
*-commutative13.2%
*-commutative13.2%
associate-*l*13.2%
Simplified13.2%
Final simplification21.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m)))
(if (<= F 3.4e+116)
(* (- t_0) (sqrt (* F (+ C (hypot B_m C)))))
(- (* t_0 (* (sqrt F) (sqrt (+ B_m C))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double tmp;
if (F <= 3.4e+116) {
tmp = -t_0 * sqrt((F * (C + hypot(B_m, C))));
} else {
tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C))));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(2.0) / B_m;
double tmp;
if (F <= 3.4e+116) {
tmp = -t_0 * Math.sqrt((F * (C + Math.hypot(B_m, C))));
} else {
tmp = -(t_0 * (Math.sqrt(F) * Math.sqrt((B_m + C))));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(2.0) / B_m tmp = 0 if F <= 3.4e+116: tmp = -t_0 * math.sqrt((F * (C + math.hypot(B_m, C)))) else: tmp = -(t_0 * (math.sqrt(F) * math.sqrt((B_m + C)))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) tmp = 0.0 if (F <= 3.4e+116) tmp = Float64(Float64(-t_0) * sqrt(Float64(F * Float64(C + hypot(B_m, C))))); else tmp = Float64(-Float64(t_0 * Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(2.0) / B_m; tmp = 0.0; if (F <= 3.4e+116) tmp = -t_0 * sqrt((F * (C + hypot(B_m, C)))); else tmp = -(t_0 * (sqrt(F) * sqrt((B_m + C)))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[F, 3.4e+116], N[((-t$95$0) * N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
\mathbf{if}\;F \leq 3.4 \cdot 10^{+116}:\\
\;\;\;\;\left(-t_0\right) \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;-t_0 \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if F < 3.40000000000000023e116Initial program 22.7%
Taylor expanded in A around 0 9.5%
mul-1-neg9.5%
*-commutative9.5%
distribute-rgt-neg-in9.5%
unpow29.5%
unpow29.5%
hypot-def22.0%
Simplified22.0%
if 3.40000000000000023e116 < F Initial program 15.2%
Taylor expanded in A around 0 7.4%
mul-1-neg7.4%
*-commutative7.4%
distribute-rgt-neg-in7.4%
unpow27.4%
unpow27.4%
hypot-def7.6%
Simplified7.6%
pow1/27.6%
*-commutative7.6%
unpow-prod-down21.3%
pow1/221.3%
pow1/221.3%
Applied egg-rr21.3%
Taylor expanded in C around 0 17.5%
Final simplification20.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m)))
(if (<= C 3000000000.0)
(* t_0 (* (sqrt F) (- (sqrt B_m))))
(* t_0 (* (sqrt F) (- (sqrt (* 2.0 C))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double tmp;
if (C <= 3000000000.0) {
tmp = t_0 * (sqrt(F) * -sqrt(B_m));
} else {
tmp = t_0 * (sqrt(F) * -sqrt((2.0 * C)));
}
return tmp;
}
B_m = abs(B)
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) :: t_0
real(8) :: tmp
t_0 = sqrt(2.0d0) / b_m
if (c <= 3000000000.0d0) then
tmp = t_0 * (sqrt(f) * -sqrt(b_m))
else
tmp = t_0 * (sqrt(f) * -sqrt((2.0d0 * c)))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(2.0) / B_m;
double tmp;
if (C <= 3000000000.0) {
tmp = t_0 * (Math.sqrt(F) * -Math.sqrt(B_m));
} else {
tmp = t_0 * (Math.sqrt(F) * -Math.sqrt((2.0 * C)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(2.0) / B_m tmp = 0 if C <= 3000000000.0: tmp = t_0 * (math.sqrt(F) * -math.sqrt(B_m)) else: tmp = t_0 * (math.sqrt(F) * -math.sqrt((2.0 * C))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) tmp = 0.0 if (C <= 3000000000.0) tmp = Float64(t_0 * Float64(sqrt(F) * Float64(-sqrt(B_m)))); else tmp = Float64(t_0 * Float64(sqrt(F) * Float64(-sqrt(Float64(2.0 * C))))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(2.0) / B_m; tmp = 0.0; if (C <= 3000000000.0) tmp = t_0 * (sqrt(F) * -sqrt(B_m)); else tmp = t_0 * (sqrt(F) * -sqrt((2.0 * C))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[C, 3000000000.0], N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
\mathbf{if}\;C \leq 3000000000:\\
\;\;\;\;t_0 \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\sqrt{F} \cdot \left(-\sqrt{2 \cdot C}\right)\right)\\
\end{array}
\end{array}
if C < 3e9Initial program 18.6%
Taylor expanded in A around 0 9.7%
mul-1-neg9.7%
*-commutative9.7%
distribute-rgt-neg-in9.7%
unpow29.7%
unpow29.7%
hypot-def18.7%
Simplified18.7%
pow1/218.7%
*-commutative18.7%
unpow-prod-down21.9%
pow1/221.9%
pow1/221.9%
Applied egg-rr21.9%
Taylor expanded in C around 0 20.2%
if 3e9 < C Initial program 25.7%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
*-commutative7.0%
distribute-rgt-neg-in7.0%
unpow27.0%
unpow27.0%
hypot-def16.4%
Simplified16.4%
pow1/216.8%
*-commutative16.8%
unpow-prod-down21.6%
pow1/221.6%
pow1/221.6%
Applied egg-rr21.6%
Taylor expanded in C around inf 13.3%
Final simplification18.2%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 3e+110) (- (/ (sqrt (* (* 2.0 F) (+ A (hypot B_m A)))) B_m)) (* (/ (sqrt F) (sqrt B_m)) (- (sqrt 2.0)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 3e+110) {
tmp = -(sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / B_m);
} else {
tmp = (sqrt(F) / sqrt(B_m)) * -sqrt(2.0);
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 3e+110) {
tmp = -(Math.sqrt(((2.0 * F) * (A + Math.hypot(B_m, A)))) / B_m);
} else {
tmp = (Math.sqrt(F) / Math.sqrt(B_m)) * -Math.sqrt(2.0);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 3e+110: tmp = -(math.sqrt(((2.0 * F) * (A + math.hypot(B_m, A)))) / B_m) else: tmp = (math.sqrt(F) / math.sqrt(B_m)) * -math.sqrt(2.0) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 3e+110) tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A + hypot(B_m, A)))) / B_m)); else tmp = Float64(Float64(sqrt(F) / sqrt(B_m)) * Float64(-sqrt(2.0))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 3e+110) tmp = -(sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / B_m); else tmp = (sqrt(F) / sqrt(B_m)) * -sqrt(2.0); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 3e+110], (-N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision]), N[(N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3 \cdot 10^{+110}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F}}{\sqrt{B_m}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if F < 3.00000000000000007e110Initial program 22.5%
Taylor expanded in C around 0 8.0%
mul-1-neg8.0%
*-commutative8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def20.7%
Simplified20.7%
distribute-lft-in20.6%
Applied egg-rr20.6%
distribute-rgt-neg-out20.6%
add-sqr-sqrt19.3%
sqrt-unprod16.8%
sqr-neg16.8%
sqrt-unprod13.6%
add-sqr-sqrt15.2%
distribute-lft-in15.3%
*-commutative15.3%
distribute-frac-neg15.3%
associate-*l/15.3%
Applied egg-rr20.7%
*-commutative20.7%
*-commutative20.7%
associate-*l*20.7%
Simplified20.7%
if 3.00000000000000007e110 < F Initial program 16.0%
Taylor expanded in A around 0 7.2%
mul-1-neg7.2%
*-commutative7.2%
distribute-rgt-neg-in7.2%
unpow27.2%
unpow27.2%
hypot-def7.5%
Simplified7.5%
Taylor expanded in C around 0 16.5%
mul-1-neg16.5%
Simplified16.5%
sqrt-div16.6%
Applied egg-rr16.6%
Final simplification19.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 4.6e+111) (- (/ (sqrt (* (* 2.0 F) (+ A (hypot B_m A)))) B_m)) (- (sqrt (/ (* 2.0 F) B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 4.6e+111) {
tmp = -(sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / B_m);
} else {
tmp = -sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 4.6e+111) {
tmp = -(Math.sqrt(((2.0 * F) * (A + Math.hypot(B_m, A)))) / B_m);
} else {
tmp = -Math.sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 4.6e+111: tmp = -(math.sqrt(((2.0 * F) * (A + math.hypot(B_m, A)))) / B_m) else: tmp = -math.sqrt(((2.0 * F) / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 4.6e+111) tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A + hypot(B_m, A)))) / B_m)); else tmp = Float64(-sqrt(Float64(Float64(2.0 * F) / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 4.6e+111) tmp = -(sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / B_m); else tmp = -sqrt(((2.0 * F) / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 4.6e+111], (-N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision]), (-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.6 \cdot 10^{+111}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}}{B_m}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{2 \cdot F}{B_m}}\\
\end{array}
\end{array}
if F < 4.60000000000000004e111Initial program 22.5%
Taylor expanded in C around 0 8.0%
mul-1-neg8.0%
*-commutative8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def20.7%
Simplified20.7%
distribute-lft-in20.6%
Applied egg-rr20.6%
distribute-rgt-neg-out20.6%
add-sqr-sqrt19.3%
sqrt-unprod16.8%
sqr-neg16.8%
sqrt-unprod13.6%
add-sqr-sqrt15.2%
distribute-lft-in15.3%
*-commutative15.3%
distribute-frac-neg15.3%
associate-*l/15.3%
Applied egg-rr20.7%
*-commutative20.7%
*-commutative20.7%
associate-*l*20.7%
Simplified20.7%
if 4.60000000000000004e111 < F Initial program 16.0%
Taylor expanded in A around 0 7.2%
mul-1-neg7.2%
*-commutative7.2%
distribute-rgt-neg-in7.2%
unpow27.2%
unpow27.2%
hypot-def7.5%
Simplified7.5%
Taylor expanded in C around 0 16.5%
mul-1-neg16.5%
Simplified16.5%
expm1-log1p-u16.2%
expm1-udef9.6%
sqrt-unprod9.6%
Applied egg-rr9.6%
expm1-def16.3%
expm1-log1p16.7%
*-commutative16.7%
associate-*r/16.7%
Simplified16.7%
Final simplification19.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 4.5e-38) (* (- (/ (sqrt 2.0) B_m)) (sqrt (* B_m F))) (- (sqrt (/ (* 2.0 F) B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 4.5e-38) {
tmp = -(sqrt(2.0) / B_m) * sqrt((B_m * F));
} else {
tmp = -sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 4.5d-38) then
tmp = -(sqrt(2.0d0) / b_m) * sqrt((b_m * f))
else
tmp = -sqrt(((2.0d0 * f) / b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 4.5e-38) {
tmp = -(Math.sqrt(2.0) / B_m) * Math.sqrt((B_m * F));
} else {
tmp = -Math.sqrt(((2.0 * F) / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 4.5e-38: tmp = -(math.sqrt(2.0) / B_m) * math.sqrt((B_m * F)) else: tmp = -math.sqrt(((2.0 * F) / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 4.5e-38) tmp = Float64(Float64(-Float64(sqrt(2.0) / B_m)) * sqrt(Float64(B_m * F))); else tmp = Float64(-sqrt(Float64(Float64(2.0 * F) / B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 4.5e-38) tmp = -(sqrt(2.0) / B_m) * sqrt((B_m * F)); else tmp = -sqrt(((2.0 * F) / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 4.5e-38], N[((-N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]) * N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.5 \cdot 10^{-38}:\\
\;\;\;\;\left(-\frac{\sqrt{2}}{B_m}\right) \cdot \sqrt{B_m \cdot F}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{2 \cdot F}{B_m}}\\
\end{array}
\end{array}
if F < 4.50000000000000009e-38Initial program 22.4%
Taylor expanded in A around 0 9.5%
mul-1-neg9.5%
*-commutative9.5%
distribute-rgt-neg-in9.5%
unpow29.5%
unpow29.5%
hypot-def22.3%
Simplified22.3%
Taylor expanded in C around 0 19.9%
if 4.50000000000000009e-38 < F Initial program 18.8%
Taylor expanded in A around 0 8.3%
mul-1-neg8.3%
*-commutative8.3%
distribute-rgt-neg-in8.3%
unpow28.3%
unpow28.3%
hypot-def13.5%
Simplified13.5%
Taylor expanded in C around 0 16.3%
mul-1-neg16.3%
Simplified16.3%
expm1-log1p-u16.1%
expm1-udef7.3%
sqrt-unprod7.3%
Applied egg-rr7.3%
expm1-def16.2%
expm1-log1p16.4%
*-commutative16.4%
associate-*r/16.4%
Simplified16.4%
Final simplification18.2%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= C 150000.0) (- (sqrt (/ (* 2.0 F) B_m))) (* (/ 2.0 B_m) (- (sqrt (* C F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 150000.0) {
tmp = -sqrt(((2.0 * F) / B_m));
} else {
tmp = (2.0 / B_m) * -sqrt((C * F));
}
return tmp;
}
B_m = abs(B)
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 (c <= 150000.0d0) then
tmp = -sqrt(((2.0d0 * f) / b_m))
else
tmp = (2.0d0 / b_m) * -sqrt((c * f))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 150000.0) {
tmp = -Math.sqrt(((2.0 * F) / B_m));
} else {
tmp = (2.0 / B_m) * -Math.sqrt((C * F));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= 150000.0: tmp = -math.sqrt(((2.0 * F) / B_m)) else: tmp = (2.0 / B_m) * -math.sqrt((C * F)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= 150000.0) tmp = Float64(-sqrt(Float64(Float64(2.0 * F) / B_m))); else tmp = Float64(Float64(2.0 / B_m) * Float64(-sqrt(Float64(C * F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= 150000.0) tmp = -sqrt(((2.0 * F) / B_m)); else tmp = (2.0 / B_m) * -sqrt((C * F)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 150000.0], (-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), N[(N[(2.0 / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq 150000:\\
\;\;\;\;-\sqrt{\frac{2 \cdot F}{B_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{B_m} \cdot \left(-\sqrt{C \cdot F}\right)\\
\end{array}
\end{array}
if C < 1.5e5Initial program 18.7%
Taylor expanded in A around 0 9.7%
mul-1-neg9.7%
*-commutative9.7%
distribute-rgt-neg-in9.7%
unpow29.7%
unpow29.7%
hypot-def18.8%
Simplified18.8%
Taylor expanded in C around 0 14.4%
mul-1-neg14.4%
Simplified14.4%
expm1-log1p-u14.2%
expm1-udef6.4%
sqrt-unprod6.4%
Applied egg-rr6.4%
expm1-def14.2%
expm1-log1p14.4%
*-commutative14.4%
associate-*r/14.4%
Simplified14.4%
if 1.5e5 < C Initial program 25.3%
Taylor expanded in A around 0 6.9%
mul-1-neg6.9%
*-commutative6.9%
distribute-rgt-neg-in6.9%
unpow26.9%
unpow26.9%
hypot-def16.3%
Simplified16.3%
pow1/216.6%
*-commutative16.6%
unpow-prod-down21.4%
pow1/221.4%
pow1/221.4%
Applied egg-rr21.4%
Taylor expanded in B around 0 10.4%
mul-1-neg10.4%
distribute-rgt-neg-in10.4%
unpow210.4%
rem-square-sqrt10.5%
Simplified10.5%
Final simplification13.3%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (- (sqrt (/ (* 2.0 F) B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return -sqrt(((2.0 * F) / B_m));
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt(((2.0d0 * f) / b_m))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return -Math.sqrt(((2.0 * F) / B_m));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return -math.sqrt(((2.0 * F) / B_m))
B_m = abs(B) function code(A, B_m, C, F) return Float64(-sqrt(Float64(Float64(2.0 * F) / B_m))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = -sqrt(((2.0 * F) / B_m)); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
-\sqrt{\frac{2 \cdot F}{B_m}}
\end{array}
Initial program 20.6%
Taylor expanded in A around 0 8.9%
mul-1-neg8.9%
*-commutative8.9%
distribute-rgt-neg-in8.9%
unpow28.9%
unpow28.9%
hypot-def18.0%
Simplified18.0%
Taylor expanded in C around 0 12.5%
mul-1-neg12.5%
Simplified12.5%
expm1-log1p-u12.4%
expm1-udef5.5%
sqrt-unprod5.5%
Applied egg-rr5.5%
expm1-def12.4%
expm1-log1p12.5%
*-commutative12.5%
associate-*r/12.5%
Simplified12.5%
Final simplification12.5%
herbie shell --seed 2023322
(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))))