
(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}
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+101)
(/
(* (sqrt (+ A (+ C (hypot B_m (- A C))))) (- (sqrt (* t_0 (* 2.0 F)))))
t_0)
(* (* (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 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 2e+101) {
tmp = (sqrt((A + (C + hypot(B_m, (A - C))))) * -sqrt((t_0 * (2.0 * F)))) / t_0;
} 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 2e+101) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(B_m, Float64(A - C))))) * Float64(-sqrt(Float64(t_0 * Float64(2.0 * F))))) / t_0); 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[(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+101], N[(N[(N[Sqrt[N[(A + N[(C + N[Sqrt[B$95$m ^ 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[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{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+101}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)} \cdot \left(-\sqrt{t\_0 \cdot \left(2 \cdot F\right)}\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2e101Initial program 32.5%
Simplified42.2%
pow1/242.2%
*-commutative42.2%
unpow-prod-down49.4%
pow1/249.4%
pow1/249.4%
*-commutative49.4%
Applied egg-rr49.4%
if 2e101 < (pow.f64 B 2) Initial program 12.2%
Simplified14.2%
Taylor expanded in C around 0 10.2%
mul-1-neg10.2%
distribute-rgt-neg-in10.2%
+-commutative10.2%
unpow210.2%
unpow210.2%
hypot-def19.6%
Simplified19.6%
sqrt-prod29.9%
Applied egg-rr29.9%
*-commutative29.9%
Simplified29.9%
Final simplification41.7%
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+101)
(/ (- (sqrt (* (+ A (+ C (hypot B_m (- A C)))) (* t_0 (* 2.0 F))))) t_0)
(* (* (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 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 2e+101) {
tmp = -sqrt(((A + (C + hypot(B_m, (A - C)))) * (t_0 * (2.0 * F)))) / t_0;
} 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 2e+101) tmp = Float64(Float64(-sqrt(Float64(Float64(A + Float64(C + hypot(B_m, Float64(A - C)))) * Float64(t_0 * Float64(2.0 * F))))) / t_0); 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[(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+101], N[((-N[Sqrt[N[(N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $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{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+101}:\\
\;\;\;\;\frac{-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(t\_0 \cdot \left(2 \cdot F\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2e101Initial program 32.5%
Simplified42.2%
if 2e101 < (pow.f64 B 2) Initial program 12.2%
Simplified14.2%
Taylor expanded in C around 0 10.2%
mul-1-neg10.2%
distribute-rgt-neg-in10.2%
+-commutative10.2%
unpow210.2%
unpow210.2%
hypot-def19.6%
Simplified19.6%
sqrt-prod29.9%
Applied egg-rr29.9%
*-commutative29.9%
Simplified29.9%
Final simplification37.3%
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-186)
(/ 1.0 (/ t_0 (- (sqrt (* 2.0 (* (+ A A) (* t_0 F)))))))
(* (* (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 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 2e-186) {
tmp = 1.0 / (t_0 / -sqrt((2.0 * ((A + A) * (t_0 * F)))));
} 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 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 2e-186) tmp = Float64(1.0 / Float64(t_0 / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(t_0 * F))))))); 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[(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-186], N[(1.0 / N[(t$95$0 / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * N[(t$95$0 * F), $MachinePrecision]), $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] * 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{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-186}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(t\_0 \cdot F\right)\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.9999999999999998e-186Initial program 27.7%
clear-num27.7%
inv-pow27.7%
Applied egg-rr39.8%
Simplified39.8%
Taylor expanded in C around -inf 33.6%
if 1.9999999999999998e-186 < (pow.f64 B 2) Initial program 22.6%
Simplified25.9%
Taylor expanded in C around 0 12.1%
mul-1-neg12.1%
distribute-rgt-neg-in12.1%
+-commutative12.1%
unpow212.1%
unpow212.1%
hypot-def18.1%
Simplified18.1%
sqrt-prod24.7%
Applied egg-rr24.7%
*-commutative24.7%
Simplified24.7%
Final simplification28.0%
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-186)
(/ 1.0 (/ t_0 (- (sqrt (* 2.0 (* (+ A A) (* t_0 F)))))))
(* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt B_m)))))))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-186) {
tmp = 1.0 / (t_0 / -sqrt((2.0 * ((A + A) * (t_0 * F)))));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(B_m));
}
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-186) tmp = Float64(1.0 / Float64(t_0 / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(t_0 * F))))))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(B_m)))); 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-186], N[(1.0 / N[(t$95$0 / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B$95$m], $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^{-186}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(t\_0 \cdot F\right)\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.9999999999999998e-186Initial program 27.7%
clear-num27.7%
inv-pow27.7%
Applied egg-rr39.8%
Simplified39.8%
Taylor expanded in C around -inf 33.6%
if 1.9999999999999998e-186 < (pow.f64 B 2) Initial program 22.6%
Simplified25.9%
Taylor expanded in C around 0 12.1%
mul-1-neg12.1%
distribute-rgt-neg-in12.1%
+-commutative12.1%
unpow212.1%
unpow212.1%
hypot-def18.1%
Simplified18.1%
sqrt-prod24.7%
Applied egg-rr24.7%
*-commutative24.7%
Simplified24.7%
Taylor expanded in A around 0 21.1%
Final simplification25.8%
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 (<= B_m 3.1e-93)
(/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt B_m)))))))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 (B_m <= 3.1e-93) {
tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(B_m));
}
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 <= 3.1e-93) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(B_m)))); 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[B$95$m, 3.1e-93], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $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[B$95$m], $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 \leq 3.1 \cdot 10^{-93}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m}\right)\right)\\
\end{array}
\end{array}
if B < 3.1e-93Initial program 25.7%
Simplified33.0%
Taylor expanded in C around -inf 19.2%
if 3.1e-93 < B Initial program 20.8%
Simplified25.5%
Taylor expanded in C around 0 28.0%
mul-1-neg28.0%
distribute-rgt-neg-in28.0%
+-commutative28.0%
unpow228.0%
unpow228.0%
hypot-def42.0%
Simplified42.0%
sqrt-prod58.0%
Applied egg-rr58.0%
*-commutative58.0%
Simplified58.0%
Taylor expanded in A around 0 52.6%
Final simplification27.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 4.5e+49) (/ 1.0 (* (sqrt (/ 1.0 (* F (+ C (hypot C B_m))))) (- (/ B_m (sqrt 2.0))))) (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 4.5e+49) {
tmp = 1.0 / (sqrt((1.0 / (F * (C + hypot(C, B_m))))) * -(B_m / sqrt(2.0)));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(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.5e+49) {
tmp = 1.0 / (Math.sqrt((1.0 / (F * (C + Math.hypot(C, B_m))))) * -(B_m / Math.sqrt(2.0)));
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * -Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 4.5e+49: tmp = 1.0 / (math.sqrt((1.0 / (F * (C + math.hypot(C, B_m))))) * -(B_m / math.sqrt(2.0))) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(F) * -math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 4.5e+49) tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 / Float64(F * Float64(C + hypot(C, B_m))))) * Float64(-Float64(B_m / sqrt(2.0))))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(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+49) tmp = 1.0 / (sqrt((1.0 / (F * (C + hypot(C, B_m))))) * -(B_m / sqrt(2.0))); else tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(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+49], N[(1.0 / N[(N[Sqrt[N[(1.0 / N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{1}{F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)}} \cdot \left(-\frac{B\_m}{\sqrt{2}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m}\right)\right)\\
\end{array}
\end{array}
if F < 4.49999999999999982e49Initial program 27.7%
clear-num27.7%
inv-pow27.7%
Applied egg-rr36.8%
Simplified36.8%
Taylor expanded in A around 0 8.5%
mul-1-neg8.5%
+-commutative8.5%
unpow28.5%
unpow28.5%
hypot-def13.9%
Simplified13.9%
if 4.49999999999999982e49 < F Initial program 19.7%
Simplified22.7%
Taylor expanded in C around 0 8.5%
mul-1-neg8.5%
distribute-rgt-neg-in8.5%
+-commutative8.5%
unpow28.5%
unpow28.5%
hypot-def9.6%
Simplified9.6%
sqrt-prod19.7%
Applied egg-rr19.7%
*-commutative19.7%
Simplified19.7%
Taylor expanded in A around 0 16.8%
Final simplification15.1%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 2.25e+39) (* (sqrt (* F (+ C (hypot B_m C)))) (/ (- (sqrt 2.0)) B_m)) (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 2.25e+39) {
tmp = sqrt((F * (C + hypot(B_m, C)))) * (-sqrt(2.0) / B_m);
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(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 <= 2.25e+39) {
tmp = Math.sqrt((F * (C + Math.hypot(B_m, C)))) * (-Math.sqrt(2.0) / B_m);
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * -Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 2.25e+39: tmp = math.sqrt((F * (C + math.hypot(B_m, C)))) * (-math.sqrt(2.0) / B_m) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(F) * -math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 2.25e+39) tmp = Float64(sqrt(Float64(F * Float64(C + hypot(B_m, C)))) * Float64(Float64(-sqrt(2.0)) / B_m)); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 2.25e+39) tmp = sqrt((F * (C + hypot(B_m, C)))) * (-sqrt(2.0) / B_m); else tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 2.25e+39], N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.25 \cdot 10^{+39}:\\
\;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \frac{-\sqrt{2}}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m}\right)\right)\\
\end{array}
\end{array}
if F < 2.24999999999999998e39Initial program 27.2%
Simplified36.4%
Taylor expanded in A around 0 7.8%
mul-1-neg7.8%
distribute-rgt-neg-in7.8%
unpow27.8%
unpow27.8%
hypot-def13.4%
Simplified13.4%
if 2.24999999999999998e39 < F Initial program 20.5%
Simplified23.5%
Taylor expanded in C around 0 9.4%
mul-1-neg9.4%
distribute-rgt-neg-in9.4%
+-commutative9.4%
unpow29.4%
unpow29.4%
hypot-def10.5%
Simplified10.5%
sqrt-prod20.5%
Applied egg-rr20.5%
*-commutative20.5%
Simplified20.5%
Taylor expanded in A around 0 17.6%
Final simplification15.1%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= A 1.2e+233) (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt B_m)))) (* (/ 2.0 B_m) (* (sqrt F) (- (sqrt A))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (A <= 1.2e+233) {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(B_m));
} else {
tmp = (2.0 / B_m) * (sqrt(F) * -sqrt(A));
}
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 (a <= 1.2d+233) then
tmp = (sqrt(2.0d0) / b_m) * (sqrt(f) * -sqrt(b_m))
else
tmp = (2.0d0 / b_m) * (sqrt(f) * -sqrt(a))
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 (A <= 1.2e+233) {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * -Math.sqrt(B_m));
} else {
tmp = (2.0 / B_m) * (Math.sqrt(F) * -Math.sqrt(A));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if A <= 1.2e+233: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(F) * -math.sqrt(B_m)) else: tmp = (2.0 / B_m) * (math.sqrt(F) * -math.sqrt(A)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (A <= 1.2e+233) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(B_m)))); else tmp = Float64(Float64(2.0 / B_m) * Float64(sqrt(F) * Float64(-sqrt(A)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (A <= 1.2e+233) tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt(B_m)); else tmp = (2.0 / B_m) * (sqrt(F) * -sqrt(A)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[A, 1.2e+233], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[A], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;A \leq 1.2 \cdot 10^{+233}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A}\right)\right)\\
\end{array}
\end{array}
if A < 1.20000000000000001e233Initial program 26.0%
Simplified32.3%
Taylor expanded in C around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
+-commutative9.7%
unpow29.7%
unpow29.7%
hypot-def13.4%
Simplified13.4%
sqrt-prod17.7%
Applied egg-rr17.7%
*-commutative17.7%
Simplified17.7%
Taylor expanded in A around 0 15.3%
if 1.20000000000000001e233 < A Initial program 1.5%
Simplified13.6%
Taylor expanded in C around 0 1.2%
mul-1-neg1.2%
distribute-rgt-neg-in1.2%
+-commutative1.2%
unpow21.2%
unpow21.2%
hypot-def8.0%
Simplified8.0%
Taylor expanded in B around 0 8.0%
mul-1-neg8.0%
*-commutative8.0%
unpow28.0%
rem-square-sqrt7.9%
Simplified7.9%
sqrt-prod11.9%
Applied egg-rr11.9%
Final simplification15.1%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= A 9.4e+232) (* (sqrt (/ F B_m)) (- (sqrt 2.0))) (* (/ 2.0 B_m) (* (sqrt F) (- (sqrt A))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (A <= 9.4e+232) {
tmp = sqrt((F / B_m)) * -sqrt(2.0);
} else {
tmp = (2.0 / B_m) * (sqrt(F) * -sqrt(A));
}
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 (a <= 9.4d+232) then
tmp = sqrt((f / b_m)) * -sqrt(2.0d0)
else
tmp = (2.0d0 / b_m) * (sqrt(f) * -sqrt(a))
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 (A <= 9.4e+232) {
tmp = Math.sqrt((F / B_m)) * -Math.sqrt(2.0);
} else {
tmp = (2.0 / B_m) * (Math.sqrt(F) * -Math.sqrt(A));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if A <= 9.4e+232: tmp = math.sqrt((F / B_m)) * -math.sqrt(2.0) else: tmp = (2.0 / B_m) * (math.sqrt(F) * -math.sqrt(A)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (A <= 9.4e+232) tmp = Float64(sqrt(Float64(F / B_m)) * Float64(-sqrt(2.0))); else tmp = Float64(Float64(2.0 / B_m) * Float64(sqrt(F) * Float64(-sqrt(A)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (A <= 9.4e+232) tmp = sqrt((F / B_m)) * -sqrt(2.0); else tmp = (2.0 / B_m) * (sqrt(F) * -sqrt(A)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[A, 9.4e+232], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[(N[(2.0 / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[A], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;A \leq 9.4 \cdot 10^{+232}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(-\sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A}\right)\right)\\
\end{array}
\end{array}
if A < 9.39999999999999984e232Initial program 26.0%
Simplified32.3%
Taylor expanded in C around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
+-commutative9.7%
unpow29.7%
unpow29.7%
hypot-def13.4%
Simplified13.4%
Taylor expanded in A around 0 12.1%
mul-1-neg12.1%
*-commutative12.1%
Simplified12.1%
if 9.39999999999999984e232 < A Initial program 1.5%
Simplified13.6%
Taylor expanded in C around 0 1.2%
mul-1-neg1.2%
distribute-rgt-neg-in1.2%
+-commutative1.2%
unpow21.2%
unpow21.2%
hypot-def8.0%
Simplified8.0%
Taylor expanded in B around 0 8.0%
mul-1-neg8.0%
*-commutative8.0%
unpow28.0%
rem-square-sqrt7.9%
Simplified7.9%
sqrt-prod11.9%
Applied egg-rr11.9%
Final simplification12.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (sqrt 2.0))))
(if (<= F 1.9e-77)
(* (sqrt (* B_m F)) (/ t_0 B_m))
(* (sqrt (/ F B_m)) t_0))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -sqrt(2.0);
double tmp;
if (F <= 1.9e-77) {
tmp = sqrt((B_m * F)) * (t_0 / B_m);
} else {
tmp = sqrt((F / B_m)) * t_0;
}
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)
if (f <= 1.9d-77) then
tmp = sqrt((b_m * f)) * (t_0 / b_m)
else
tmp = sqrt((f / b_m)) * t_0
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);
double tmp;
if (F <= 1.9e-77) {
tmp = Math.sqrt((B_m * F)) * (t_0 / B_m);
} else {
tmp = Math.sqrt((F / B_m)) * t_0;
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = -math.sqrt(2.0) tmp = 0 if F <= 1.9e-77: tmp = math.sqrt((B_m * F)) * (t_0 / B_m) else: tmp = math.sqrt((F / B_m)) * t_0 return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(-sqrt(2.0)) tmp = 0.0 if (F <= 1.9e-77) tmp = Float64(sqrt(Float64(B_m * F)) * Float64(t_0 / B_m)); else tmp = Float64(sqrt(Float64(F / B_m)) * t_0); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = -sqrt(2.0); tmp = 0.0; if (F <= 1.9e-77) tmp = sqrt((B_m * F)) * (t_0 / B_m); else tmp = sqrt((F / B_m)) * 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[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[F, 1.9e-77], N[(N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := -\sqrt{2}\\
\mathbf{if}\;F \leq 1.9 \cdot 10^{-77}:\\
\;\;\;\;\sqrt{B\_m \cdot F} \cdot \frac{t\_0}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot t\_0\\
\end{array}
\end{array}
if F < 1.8999999999999999e-77Initial program 26.2%
Simplified38.1%
Taylor expanded in C around 0 8.1%
mul-1-neg8.1%
distribute-rgt-neg-in8.1%
+-commutative8.1%
unpow28.1%
unpow28.1%
hypot-def14.1%
Simplified14.1%
Taylor expanded in A around 0 12.8%
if 1.8999999999999999e-77 < F Initial program 23.2%
Simplified25.9%
Taylor expanded in C around 0 9.9%
mul-1-neg9.9%
distribute-rgt-neg-in9.9%
+-commutative9.9%
unpow29.9%
unpow29.9%
hypot-def12.2%
Simplified12.2%
Taylor expanded in A around 0 15.6%
mul-1-neg15.6%
*-commutative15.6%
Simplified15.6%
Final simplification14.4%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 1.45e-41) (* (sqrt (* B_m F)) (/ (- (sqrt 2.0)) B_m)) (/ 1.0 (/ (- (sqrt (/ B_m F))) (sqrt 2.0)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.45e-41) {
tmp = sqrt((B_m * F)) * (-sqrt(2.0) / B_m);
} else {
tmp = 1.0 / (-sqrt((B_m / F)) / sqrt(2.0));
}
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 <= 1.45d-41) then
tmp = sqrt((b_m * f)) * (-sqrt(2.0d0) / b_m)
else
tmp = 1.0d0 / (-sqrt((b_m / f)) / sqrt(2.0d0))
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 <= 1.45e-41) {
tmp = Math.sqrt((B_m * F)) * (-Math.sqrt(2.0) / B_m);
} else {
tmp = 1.0 / (-Math.sqrt((B_m / F)) / Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 1.45e-41: tmp = math.sqrt((B_m * F)) * (-math.sqrt(2.0) / B_m) else: tmp = 1.0 / (-math.sqrt((B_m / F)) / math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 1.45e-41) tmp = Float64(sqrt(Float64(B_m * F)) * Float64(Float64(-sqrt(2.0)) / B_m)); else tmp = Float64(1.0 / Float64(Float64(-sqrt(Float64(B_m / F))) / 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 <= 1.45e-41) tmp = sqrt((B_m * F)) * (-sqrt(2.0) / B_m); else tmp = 1.0 / (-sqrt((B_m / F)) / sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1.45e-41], N[(N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[((-N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision]) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.45 \cdot 10^{-41}:\\
\;\;\;\;\sqrt{B\_m \cdot F} \cdot \frac{-\sqrt{2}}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{-\sqrt{\frac{B\_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < 1.44999999999999989e-41Initial program 27.5%
Simplified38.5%
Taylor expanded in C around 0 7.7%
mul-1-neg7.7%
distribute-rgt-neg-in7.7%
+-commutative7.7%
unpow27.7%
unpow27.7%
hypot-def13.2%
Simplified13.2%
Taylor expanded in A around 0 12.0%
if 1.44999999999999989e-41 < F Initial program 21.8%
clear-num21.8%
inv-pow21.8%
Applied egg-rr24.6%
Simplified24.6%
Taylor expanded in C around 0 9.9%
*-commutative9.9%
distribute-rgt-in9.8%
+-commutative9.8%
unpow29.8%
unpow29.8%
hypot-def10.2%
distribute-rgt-in10.5%
Simplified10.5%
Taylor expanded in A around 0 16.7%
mul-1-neg16.7%
associate-*r/16.7%
*-rgt-identity16.7%
Simplified16.7%
Final simplification14.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (* (sqrt (/ F B_m)) (- (sqrt 2.0))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return sqrt((F / B_m)) * -sqrt(2.0);
}
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((f / b_m)) * -sqrt(2.0d0)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt((F / B_m)) * -Math.sqrt(2.0);
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.sqrt((F / B_m)) * -math.sqrt(2.0)
B_m = abs(B) function code(A, B_m, C, F) return Float64(sqrt(Float64(F / B_m)) * Float64(-sqrt(2.0))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = sqrt((F / B_m)) * -sqrt(2.0); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\sqrt{\frac{F}{B\_m}} \cdot \left(-\sqrt{2}\right)
\end{array}
Initial program 24.5%
Simplified31.1%
Taylor expanded in C around 0 9.2%
mul-1-neg9.2%
distribute-rgt-neg-in9.2%
+-commutative9.2%
unpow29.2%
unpow29.2%
hypot-def13.0%
Simplified13.0%
Taylor expanded in A around 0 11.5%
mul-1-neg11.5%
*-commutative11.5%
Simplified11.5%
Final simplification11.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (* (pow (* A F) 0.5) (/ (- 2.0) B_m)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return pow((A * F), 0.5) * (-2.0 / 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 = ((a * f) ** 0.5d0) * (-2.0d0 / b_m)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return Math.pow((A * F), 0.5) * (-2.0 / B_m);
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.pow((A * F), 0.5) * (-2.0 / B_m)
B_m = abs(B) function code(A, B_m, C, F) return Float64((Float64(A * F) ^ 0.5) * Float64(Float64(-2.0) / B_m)) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = ((A * F) ^ 0.5) * (-2.0 / B_m); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] * N[((-2.0) / B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B\_m}
\end{array}
Initial program 24.5%
Simplified31.1%
Taylor expanded in C around 0 9.2%
mul-1-neg9.2%
distribute-rgt-neg-in9.2%
+-commutative9.2%
unpow29.2%
unpow29.2%
hypot-def13.0%
Simplified13.0%
Taylor expanded in B around 0 3.2%
mul-1-neg3.2%
*-commutative3.2%
unpow23.2%
rem-square-sqrt3.2%
Simplified3.2%
pow1/23.4%
*-commutative3.4%
Applied egg-rr3.4%
Final simplification3.4%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (* (/ (sqrt (* A F)) B_m) (- 2.0)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return (sqrt((A * F)) / B_m) * -2.0;
}
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((a * f)) / b_m) * -2.0d0
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return (Math.sqrt((A * F)) / B_m) * -2.0;
}
B_m = math.fabs(B) def code(A, B_m, C, F): return (math.sqrt((A * F)) / B_m) * -2.0
B_m = abs(B) function code(A, B_m, C, F) return Float64(Float64(sqrt(Float64(A * F)) / B_m) * Float64(-2.0)) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = (sqrt((A * F)) / B_m) * -2.0; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] / B$95$m), $MachinePrecision] * (-2.0)), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\frac{\sqrt{A \cdot F}}{B\_m} \cdot \left(-2\right)
\end{array}
Initial program 24.5%
Simplified31.1%
Taylor expanded in C around 0 9.2%
mul-1-neg9.2%
distribute-rgt-neg-in9.2%
+-commutative9.2%
unpow29.2%
unpow29.2%
hypot-def13.0%
Simplified13.0%
Taylor expanded in B around 0 3.2%
mul-1-neg3.2%
*-commutative3.2%
unpow23.2%
rem-square-sqrt3.2%
Simplified3.2%
Taylor expanded in B around 0 3.2%
associate-*r/3.2%
*-rgt-identity3.2%
Simplified3.2%
Final simplification3.2%
herbie shell --seed 2024040
(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))))