
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: t_0
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(if (<=
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
t_0)
INFINITY)
(/
(*
(sqrt (* 2.0 (* F (fma B B (* (* A C) -4.0)))))
(- (sqrt (+ A (+ C (hypot (- A C) B))))))
(fma B B (* A (* C -4.0))))
(*
(* (sqrt (+ A (hypot B A))) (sqrt F))
(* (pow 2.0 0.25) (- (/ (pow 2.0 0.25) B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
double tmp;
if ((-sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_0) <= ((double) INFINITY)) {
tmp = (sqrt((2.0 * (F * fma(B, B, ((A * C) * -4.0))))) * -sqrt((A + (C + hypot((A - C), B))))) / fma(B, B, (A * (C * -4.0)));
} else {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (pow(2.0, 0.25) * -(pow(2.0, 0.25) / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) tmp = 0.0 if (Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_0) <= Inf) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * fma(B, B, Float64(Float64(A * C) * -4.0))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B)))))) / fma(B, B, Float64(A * Float64(C * -4.0)))); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64((2.0 ^ 0.25) * Float64(-Float64((2.0 ^ 0.25) / B)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], Infinity], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(B * B + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * (-N[(N[Power[2.0, 0.25], $MachinePrecision] / B), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_0} \leq \infty:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \left({2}^{0.25} \cdot \left(-\frac{{2}^{0.25}}{B}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 32.4%
Simplified39.4%
associate-*r*39.4%
associate-+r+38.6%
hypot-udef32.4%
unpow232.4%
unpow232.4%
+-commutative32.4%
sqrt-prod38.1%
*-commutative38.1%
associate-*r*38.1%
associate-+l+38.4%
Applied egg-rr59.1%
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 2.0%
mul-1-neg2.0%
distribute-rgt-neg-in2.0%
+-commutative2.0%
unpow22.0%
unpow22.0%
hypot-def20.3%
Simplified20.3%
pow1/220.3%
*-commutative20.3%
unpow-prod-down35.6%
pow1/235.6%
pow1/235.6%
Applied egg-rr35.6%
add-sqr-sqrt35.7%
*-un-lft-identity35.7%
times-frac35.7%
pow1/235.7%
sqrt-pow135.7%
metadata-eval35.7%
pow1/235.7%
sqrt-pow135.7%
metadata-eval35.7%
Applied egg-rr35.7%
/-rgt-identity35.7%
Simplified35.7%
Final simplification48.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= (pow B 2.0) 5e-167)
(/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
(if (<= (pow B 2.0) 1e+64)
(/ (- (sqrt (* F (* t_0 (* 2.0 (+ (+ A C) (hypot (- A C) B))))))) t_0)
(* (* (sqrt (+ A (hypot B A))) (sqrt F)) (/ (- (sqrt 2.0)) B))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (pow(B, 2.0) <= 5e-167) {
tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
} else if (pow(B, 2.0) <= 1e+64) {
tmp = -sqrt((F * (t_0 * (2.0 * ((A + C) + hypot((A - C), B)))))) / t_0;
} else {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (-sqrt(2.0) / B);
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B ^ 2.0) <= 5e-167) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0); elseif ((B ^ 2.0) <= 1e+64) tmp = Float64(Float64(-sqrt(Float64(F * Float64(t_0 * Float64(2.0 * Float64(Float64(A + C) + hypot(Float64(A - C), B))))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B)); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-167], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+64], N[((-N[Sqrt[N[(F * N[(t$95$0 * N[(2.0 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-167}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\
\mathbf{elif}\;{B}^{2} \leq 10^{+64}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(t_0 \cdot \left(2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 5.0000000000000002e-167Initial program 20.4%
Simplified28.5%
Taylor expanded in A around inf 27.2%
distribute-rgt1-in27.2%
metadata-eval27.2%
mul0-lft27.2%
Simplified27.2%
if 5.0000000000000002e-167 < (pow.f64 B 2) < 1.00000000000000002e64Initial program 42.5%
neg-sub042.5%
div-sub42.5%
associate-*l*42.5%
Applied egg-rr46.9%
Simplified42.7%
if 1.00000000000000002e64 < (pow.f64 B 2) Initial program 7.1%
Taylor expanded in C around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-def26.5%
Simplified26.5%
pow1/226.5%
*-commutative26.5%
unpow-prod-down39.6%
pow1/239.6%
pow1/239.6%
Applied egg-rr39.6%
Final simplification36.7%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= (pow B 2.0) 1e+64)
(/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
(*
(* (sqrt (+ A (hypot B A))) (sqrt F))
(* (sqrt (/ 2.0 B)) (/ -1.0 (sqrt B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (pow(B, 2.0) <= 1e+64) {
tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
} else {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (sqrt((2.0 / B)) * (-1.0 / sqrt(B)));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B ^ 2.0) <= 1e+64) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64(sqrt(Float64(2.0 / B)) * Float64(-1.0 / sqrt(B)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+64], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(2.0 / B), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[Sqrt[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 10^{+64}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \left(\sqrt{\frac{2}{B}} \cdot \frac{-1}{\sqrt{B}}\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.00000000000000002e64Initial program 29.7%
Simplified36.2%
if 1.00000000000000002e64 < (pow.f64 B 2) Initial program 7.1%
Taylor expanded in C around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-def26.5%
Simplified26.5%
pow1/226.5%
*-commutative26.5%
unpow-prod-down39.6%
pow1/239.6%
pow1/239.6%
Applied egg-rr39.6%
*-un-lft-identity39.6%
add-sqr-sqrt38.6%
times-frac38.6%
sqrt-div38.7%
Applied egg-rr38.7%
Final simplification37.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= (pow B 2.0) 1e+64)
(/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
(* (* (sqrt (+ A (hypot B A))) (sqrt F)) (/ (- (sqrt 2.0)) B)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (pow(B, 2.0) <= 1e+64) {
tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
} else {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (-sqrt(2.0) / B);
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B ^ 2.0) <= 1e+64) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B)); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+64], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 10^{+64}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.00000000000000002e64Initial program 29.7%
Simplified36.2%
if 1.00000000000000002e64 < (pow.f64 B 2) Initial program 7.1%
Taylor expanded in C around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
+-commutative8.7%
unpow28.7%
unpow28.7%
hypot-def26.5%
Simplified26.5%
pow1/226.5%
*-commutative26.5%
unpow-prod-down39.6%
pow1/239.6%
pow1/239.6%
Applied egg-rr39.6%
Final simplification38.0%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= B 8.5e+32)
(/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
(*
(* (sqrt (+ A (hypot B A))) (sqrt F))
(* (pow 2.0 0.25) (- (/ (pow 2.0 0.25) B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (B <= 8.5e+32) {
tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
} else {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (pow(2.0, 0.25) * -(pow(2.0, 0.25) / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B <= 8.5e+32) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64((2.0 ^ 0.25) * Float64(-Float64((2.0 ^ 0.25) / B)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 8.5e+32], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * (-N[(N[Power[2.0, 0.25], $MachinePrecision] / B), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq 8.5 \cdot 10^{+32}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \left({2}^{0.25} \cdot \left(-\frac{{2}^{0.25}}{B}\right)\right)\\
\end{array}
\end{array}
if B < 8.4999999999999998e32Initial program 22.9%
Simplified28.6%
if 8.4999999999999998e32 < B Initial program 6.4%
Taylor expanded in C around 0 14.7%
mul-1-neg14.7%
distribute-rgt-neg-in14.7%
+-commutative14.7%
unpow214.7%
unpow214.7%
hypot-def46.1%
Simplified46.1%
pow1/246.1%
*-commutative46.1%
unpow-prod-down69.6%
pow1/269.6%
pow1/269.6%
Applied egg-rr69.6%
add-sqr-sqrt69.8%
*-un-lft-identity69.8%
times-frac69.9%
pow1/269.9%
sqrt-pow169.9%
metadata-eval69.9%
pow1/269.9%
sqrt-pow169.9%
metadata-eval69.9%
Applied egg-rr69.9%
/-rgt-identity69.9%
Simplified69.9%
Final simplification40.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= (pow B 2.0) 5e-143)
(/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
(* (* (sqrt (+ A (hypot B A))) (sqrt F)) (/ (- (sqrt 2.0)) B)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (pow(B, 2.0) <= 5e-143) {
tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
} else {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (-sqrt(2.0) / B);
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B ^ 2.0) <= 5e-143) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0); else tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B)); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-143], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-143}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 5.0000000000000002e-143Initial program 23.4%
Simplified30.6%
Taylor expanded in A around inf 27.2%
distribute-rgt1-in27.2%
metadata-eval27.2%
mul0-lft27.2%
Simplified27.2%
if 5.0000000000000002e-143 < (pow.f64 B 2) Initial program 15.9%
Taylor expanded in C around 0 10.4%
mul-1-neg10.4%
distribute-rgt-neg-in10.4%
+-commutative10.4%
unpow210.4%
unpow210.4%
hypot-def23.7%
Simplified23.7%
pow1/223.8%
*-commutative23.8%
unpow-prod-down33.5%
pow1/233.5%
pow1/233.5%
Applied egg-rr33.5%
Final simplification31.5%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (/ (- (sqrt 2.0)) B)))
(if (<= C -4.5e+207)
(* (sqrt (* -0.5 (/ (* (pow B 2.0) F) C))) t_0)
(if (<= C 4.8e-100)
(* (* (sqrt (+ A (hypot B A))) (sqrt F)) t_0)
(* (/ (sqrt 2.0) B) (* (sqrt (+ C (hypot B C))) (- (sqrt F))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = -sqrt(2.0) / B;
double tmp;
if (C <= -4.5e+207) {
tmp = sqrt((-0.5 * ((pow(B, 2.0) * F) / C))) * t_0;
} else if (C <= 4.8e-100) {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * t_0;
} else {
tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = -Math.sqrt(2.0) / B;
double tmp;
if (C <= -4.5e+207) {
tmp = Math.sqrt((-0.5 * ((Math.pow(B, 2.0) * F) / C))) * t_0;
} else if (C <= 4.8e-100) {
tmp = (Math.sqrt((A + Math.hypot(B, A))) * Math.sqrt(F)) * t_0;
} else {
tmp = (Math.sqrt(2.0) / B) * (Math.sqrt((C + Math.hypot(B, C))) * -Math.sqrt(F));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = -math.sqrt(2.0) / B tmp = 0 if C <= -4.5e+207: tmp = math.sqrt((-0.5 * ((math.pow(B, 2.0) * F) / C))) * t_0 elif C <= 4.8e-100: tmp = (math.sqrt((A + math.hypot(B, A))) * math.sqrt(F)) * t_0 else: tmp = (math.sqrt(2.0) / B) * (math.sqrt((C + math.hypot(B, C))) * -math.sqrt(F)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(-sqrt(2.0)) / B) tmp = 0.0 if (C <= -4.5e+207) tmp = Float64(sqrt(Float64(-0.5 * Float64(Float64((B ^ 2.0) * F) / C))) * t_0); elseif (C <= 4.8e-100) tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * t_0); else tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = -sqrt(2.0) / B; tmp = 0.0; if (C <= -4.5e+207) tmp = sqrt((-0.5 * (((B ^ 2.0) * F) / C))) * t_0; elseif (C <= 4.8e-100) tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * t_0; else tmp = (sqrt(2.0) / B) * (sqrt((C + hypot(B, C))) * -sqrt(F)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]}, If[LessEqual[C, -4.5e+207], N[(N[Sqrt[N[(-0.5 * N[(N[(N[Power[B, 2.0], $MachinePrecision] * F), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[C, 4.8e-100], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \frac{-\sqrt{2}}{B}\\
\mathbf{if}\;C \leq -4.5 \cdot 10^{+207}:\\
\;\;\;\;\sqrt{-0.5 \cdot \frac{{B}^{2} \cdot F}{C}} \cdot t_0\\
\mathbf{elif}\;C \leq 4.8 \cdot 10^{-100}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if C < -4.50000000000000003e207Initial program 0.7%
Taylor expanded in A around 0 1.7%
mul-1-neg1.7%
distribute-rgt-neg-in1.7%
unpow21.7%
unpow21.7%
hypot-def4.6%
Simplified4.6%
Taylor expanded in C around -inf 25.5%
if -4.50000000000000003e207 < C < 4.8000000000000005e-100Initial program 19.3%
Taylor expanded in C around 0 9.9%
mul-1-neg9.9%
distribute-rgt-neg-in9.9%
+-commutative9.9%
unpow29.9%
unpow29.9%
hypot-def23.9%
Simplified23.9%
pow1/223.9%
*-commutative23.9%
unpow-prod-down31.7%
pow1/231.7%
pow1/231.7%
Applied egg-rr31.7%
if 4.8000000000000005e-100 < C Initial program 22.7%
Taylor expanded in A around 0 9.0%
mul-1-neg9.0%
distribute-rgt-neg-in9.0%
unpow29.0%
unpow29.0%
hypot-def17.9%
Simplified17.9%
pow1/217.9%
*-commutative17.9%
unpow-prod-down23.9%
pow1/223.9%
pow1/223.9%
Applied egg-rr23.9%
Final simplification28.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (/ (- (sqrt 2.0)) B)))
(if (<= C -3.5e+207)
(* (sqrt (* -0.5 (/ (* (pow B 2.0) F) C))) t_0)
(if (<= C 6.8e-100)
(* (* (sqrt (+ A (hypot B A))) (sqrt F)) t_0)
(/ (* (sqrt 2.0) (* (sqrt (+ C (hypot B C))) (- (sqrt F)))) B)))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = -sqrt(2.0) / B;
double tmp;
if (C <= -3.5e+207) {
tmp = sqrt((-0.5 * ((pow(B, 2.0) * F) / C))) * t_0;
} else if (C <= 6.8e-100) {
tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * t_0;
} else {
tmp = (sqrt(2.0) * (sqrt((C + hypot(B, C))) * -sqrt(F))) / B;
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = -Math.sqrt(2.0) / B;
double tmp;
if (C <= -3.5e+207) {
tmp = Math.sqrt((-0.5 * ((Math.pow(B, 2.0) * F) / C))) * t_0;
} else if (C <= 6.8e-100) {
tmp = (Math.sqrt((A + Math.hypot(B, A))) * Math.sqrt(F)) * t_0;
} else {
tmp = (Math.sqrt(2.0) * (Math.sqrt((C + Math.hypot(B, C))) * -Math.sqrt(F))) / B;
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = -math.sqrt(2.0) / B tmp = 0 if C <= -3.5e+207: tmp = math.sqrt((-0.5 * ((math.pow(B, 2.0) * F) / C))) * t_0 elif C <= 6.8e-100: tmp = (math.sqrt((A + math.hypot(B, A))) * math.sqrt(F)) * t_0 else: tmp = (math.sqrt(2.0) * (math.sqrt((C + math.hypot(B, C))) * -math.sqrt(F))) / B return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(Float64(-sqrt(2.0)) / B) tmp = 0.0 if (C <= -3.5e+207) tmp = Float64(sqrt(Float64(-0.5 * Float64(Float64((B ^ 2.0) * F) / C))) * t_0); elseif (C <= 6.8e-100) tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * t_0); else tmp = Float64(Float64(sqrt(2.0) * Float64(sqrt(Float64(C + hypot(B, C))) * Float64(-sqrt(F)))) / B); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = -sqrt(2.0) / B; tmp = 0.0; if (C <= -3.5e+207) tmp = sqrt((-0.5 * (((B ^ 2.0) * F) / C))) * t_0; elseif (C <= 6.8e-100) tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * t_0; else tmp = (sqrt(2.0) * (sqrt((C + hypot(B, C))) * -sqrt(F))) / B; end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]}, If[LessEqual[C, -3.5e+207], N[(N[Sqrt[N[(-0.5 * N[(N[(N[Power[B, 2.0], $MachinePrecision] * F), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[C, 6.8e-100], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \frac{-\sqrt{2}}{B}\\
\mathbf{if}\;C \leq -3.5 \cdot 10^{+207}:\\
\;\;\;\;\sqrt{-0.5 \cdot \frac{{B}^{2} \cdot F}{C}} \cdot t_0\\
\mathbf{elif}\;C \leq 6.8 \cdot 10^{-100}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(-\sqrt{F}\right)\right)}{B}\\
\end{array}
\end{array}
if C < -3.50000000000000028e207Initial program 0.7%
Taylor expanded in A around 0 1.7%
mul-1-neg1.7%
distribute-rgt-neg-in1.7%
unpow21.7%
unpow21.7%
hypot-def4.6%
Simplified4.6%
Taylor expanded in C around -inf 25.5%
if -3.50000000000000028e207 < C < 6.79999999999999953e-100Initial program 19.3%
Taylor expanded in C around 0 9.9%
mul-1-neg9.9%
distribute-rgt-neg-in9.9%
+-commutative9.9%
unpow29.9%
unpow29.9%
hypot-def23.9%
Simplified23.9%
pow1/223.9%
*-commutative23.9%
unpow-prod-down31.7%
pow1/231.7%
pow1/231.7%
Applied egg-rr31.7%
if 6.79999999999999953e-100 < C Initial program 22.7%
Taylor expanded in A around 0 9.0%
mul-1-neg9.0%
distribute-rgt-neg-in9.0%
unpow29.0%
unpow29.0%
hypot-def17.9%
Simplified17.9%
associate-*l/17.8%
Applied egg-rr17.8%
pow1/217.9%
*-commutative17.9%
unpow-prod-down23.9%
pow1/223.9%
pow1/223.9%
Applied egg-rr24.0%
Final simplification28.2%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(if (<= F 2.9e-275)
(- (/ (sqrt (* (* 2.0 (* t_0 F)) (* 2.0 C))) t_0))
(if (<= F 1.5e+105)
(/ (sqrt (* F (* 2.0 (+ C (hypot B C))))) (- B))
(* (sqrt 2.0) (- (sqrt (/ F B))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
double tmp;
if (F <= 2.9e-275) {
tmp = -(sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0);
} else if (F <= 1.5e+105) {
tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
double tmp;
if (F <= 2.9e-275) {
tmp = -(Math.sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0);
} else if (F <= 1.5e+105) {
tmp = Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / -B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) tmp = 0 if F <= 2.9e-275: tmp = -(math.sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0) elif F <= 1.5e+105: tmp = math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / -B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) tmp = 0.0 if (F <= 2.9e-275) tmp = Float64(-Float64(sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(2.0 * C))) / t_0)); elseif (F <= 1.5e+105) tmp = Float64(sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C))))) / Float64(-B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = 0.0; if (F <= 2.9e-275) tmp = -(sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0); elseif (F <= 1.5e+105) tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 2.9e-275], (-N[(N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[F, 1.5e+105], N[(N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;F \leq 2.9 \cdot 10^{-275}:\\
\;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+105}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{-B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 2.9e-275Initial program 22.1%
Taylor expanded in A around -inf 21.0%
if 2.9e-275 < F < 1.5e105Initial program 20.6%
Taylor expanded in A around 0 10.1%
mul-1-neg10.1%
distribute-rgt-neg-in10.1%
unpow210.1%
unpow210.1%
hypot-def24.0%
Simplified24.0%
associate-*l/24.0%
Applied egg-rr24.0%
frac-2neg24.0%
div-inv24.0%
distribute-rgt-neg-out24.0%
remove-double-neg24.0%
sqrt-unprod24.1%
Applied egg-rr24.1%
associate-*r/24.1%
*-rgt-identity24.1%
*-commutative24.1%
associate-*l*24.1%
Simplified24.1%
if 1.5e105 < F Initial program 12.1%
Taylor expanded in C around 0 8.0%
mul-1-neg8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def10.6%
Simplified10.6%
Taylor expanded in A around 0 27.8%
mul-1-neg27.8%
Simplified27.8%
Final simplification24.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (+ C (hypot B C))))
(if (<= F -1.05e-296)
(-
(/
(sqrt (* t_0 (* 2.0 (* (* A -4.0) (* C F)))))
(- (pow B 2.0) (* (* 4.0 A) C))))
(if (<= F 9.4e-94)
(/ (sqrt 2.0) (/ (- B) (sqrt (* F (+ A (hypot B A))))))
(if (<= F 5.2e+106)
(/ (* (sqrt (* F t_0)) (- (sqrt 2.0))) B)
(* (sqrt 2.0) (- (sqrt (/ F B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = C + hypot(B, C);
double tmp;
if (F <= -1.05e-296) {
tmp = -(sqrt((t_0 * (2.0 * ((A * -4.0) * (C * F))))) / (pow(B, 2.0) - ((4.0 * A) * C)));
} else if (F <= 9.4e-94) {
tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A)))));
} else if (F <= 5.2e+106) {
tmp = (sqrt((F * t_0)) * -sqrt(2.0)) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double t_0 = C + Math.hypot(B, C);
double tmp;
if (F <= -1.05e-296) {
tmp = -(Math.sqrt((t_0 * (2.0 * ((A * -4.0) * (C * F))))) / (Math.pow(B, 2.0) - ((4.0 * A) * C)));
} else if (F <= 9.4e-94) {
tmp = Math.sqrt(2.0) / (-B / Math.sqrt((F * (A + Math.hypot(B, A)))));
} else if (F <= 5.2e+106) {
tmp = (Math.sqrt((F * t_0)) * -Math.sqrt(2.0)) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): t_0 = C + math.hypot(B, C) tmp = 0 if F <= -1.05e-296: tmp = -(math.sqrt((t_0 * (2.0 * ((A * -4.0) * (C * F))))) / (math.pow(B, 2.0) - ((4.0 * A) * C))) elif F <= 9.4e-94: tmp = math.sqrt(2.0) / (-B / math.sqrt((F * (A + math.hypot(B, A))))) elif F <= 5.2e+106: tmp = (math.sqrt((F * t_0)) * -math.sqrt(2.0)) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) t_0 = Float64(C + hypot(B, C)) tmp = 0.0 if (F <= -1.05e-296) tmp = Float64(-Float64(sqrt(Float64(t_0 * Float64(2.0 * Float64(Float64(A * -4.0) * Float64(C * F))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)))); elseif (F <= 9.4e-94) tmp = Float64(sqrt(2.0) / Float64(Float64(-B) / sqrt(Float64(F * Float64(A + hypot(B, A)))))); elseif (F <= 5.2e+106) tmp = Float64(Float64(sqrt(Float64(F * t_0)) * Float64(-sqrt(2.0))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) t_0 = C + hypot(B, C); tmp = 0.0; if (F <= -1.05e-296) tmp = -(sqrt((t_0 * (2.0 * ((A * -4.0) * (C * F))))) / ((B ^ 2.0) - ((4.0 * A) * C))); elseif (F <= 9.4e-94) tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A))))); elseif (F <= 5.2e+106) tmp = (sqrt((F * t_0)) * -sqrt(2.0)) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05e-296], (-N[(N[Sqrt[N[(t$95$0 * N[(2.0 * N[(N[(A * -4.0), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 9.4e-94], N[(N[Sqrt[2.0], $MachinePrecision] / N[((-B) / N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e+106], N[(N[(N[Sqrt[N[(F * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := C + \mathsf{hypot}\left(B, C\right)\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-296}:\\
\;\;\;\;-\frac{\sqrt{t_0 \cdot \left(2 \cdot \left(\left(A \cdot -4\right) \cdot \left(C \cdot F\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\
\mathbf{elif}\;F \leq 9.4 \cdot 10^{-94}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{-B}{\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}}}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+106}:\\
\;\;\;\;\frac{\sqrt{F \cdot t_0} \cdot \left(-\sqrt{2}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < -1.05e-296Initial program 28.3%
Taylor expanded in A around 0 13.9%
unpow213.9%
unpow213.9%
hypot-def19.0%
Simplified19.0%
Taylor expanded in B around 0 17.1%
associate-*r*17.1%
*-commutative17.1%
*-commutative17.1%
Simplified17.1%
if -1.05e-296 < F < 9.40000000000000007e-94Initial program 18.2%
Taylor expanded in C around 0 10.1%
mul-1-neg10.1%
distribute-rgt-neg-in10.1%
+-commutative10.1%
unpow210.1%
unpow210.1%
hypot-def33.9%
Simplified33.9%
pow1/233.9%
*-commutative33.9%
unpow-prod-down33.6%
pow1/233.6%
pow1/233.6%
Applied egg-rr33.6%
associate-*l/33.8%
frac-2neg33.8%
Applied egg-rr33.9%
associate-/l*33.9%
*-commutative33.9%
Simplified33.9%
if 9.40000000000000007e-94 < F < 5.20000000000000039e106Initial program 19.4%
Taylor expanded in A around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
unpow211.0%
unpow211.0%
hypot-def23.3%
Simplified23.3%
associate-*l/23.4%
Applied egg-rr23.4%
if 5.20000000000000039e106 < F Initial program 12.2%
Taylor expanded in C around 0 8.1%
mul-1-neg8.1%
distribute-rgt-neg-in8.1%
+-commutative8.1%
unpow28.1%
unpow28.1%
hypot-def9.5%
Simplified9.5%
Taylor expanded in A around 0 26.9%
mul-1-neg26.9%
Simplified26.9%
Final simplification26.1%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (fma B B (* A (* C -4.0)))))
(if (<= F 7.5e-301)
(/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
(if (<= F 1e-93)
(/ (sqrt 2.0) (/ (- B) (sqrt (* F (+ A (hypot B A))))))
(if (<= F 4.9e+106)
(/ (* (sqrt (* F (+ C (hypot B C)))) (- (sqrt 2.0))) B)
(* (sqrt 2.0) (- (sqrt (/ F B)))))))))B = abs(B);
double code(double A, double B, double C, double F) {
double t_0 = fma(B, B, (A * (C * -4.0)));
double tmp;
if (F <= 7.5e-301) {
tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
} else if (F <= 1e-93) {
tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A)))));
} else if (F <= 4.9e+106) {
tmp = (sqrt((F * (C + hypot(B, C)))) * -sqrt(2.0)) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = abs(B) function code(A, B, C, F) t_0 = fma(B, B, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (F <= 7.5e-301) tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0); elseif (F <= 1e-93) tmp = Float64(sqrt(2.0) / Float64(Float64(-B) / sqrt(Float64(F * Float64(A + hypot(B, A)))))); elseif (F <= 4.9e+106) tmp = Float64(Float64(sqrt(Float64(F * Float64(C + hypot(B, C)))) * Float64(-sqrt(2.0))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 7.5e-301], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 1e-93], N[(N[Sqrt[2.0], $MachinePrecision] / N[((-B) / N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.9e+106], N[(N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;F \leq 7.5 \cdot 10^{-301}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\
\mathbf{elif}\;F \leq 10^{-93}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{-B}{\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}}}\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{+106}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\sqrt{2}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 7.5000000000000006e-301Initial program 27.0%
Simplified39.5%
Taylor expanded in A around inf 27.6%
distribute-rgt1-in27.6%
metadata-eval27.6%
mul0-lft27.6%
Simplified27.6%
if 7.5000000000000006e-301 < F < 9.999999999999999e-94Initial program 18.7%
Taylor expanded in C around 0 10.3%
mul-1-neg10.3%
distribute-rgt-neg-in10.3%
+-commutative10.3%
unpow210.3%
unpow210.3%
hypot-def34.9%
Simplified34.9%
pow1/234.9%
*-commutative34.9%
unpow-prod-down34.6%
pow1/234.6%
pow1/234.6%
Applied egg-rr34.6%
associate-*l/34.8%
frac-2neg34.8%
Applied egg-rr34.8%
associate-/l*34.9%
*-commutative34.9%
Simplified34.9%
if 9.999999999999999e-94 < F < 4.89999999999999998e106Initial program 19.4%
Taylor expanded in A around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
unpow211.0%
unpow211.0%
hypot-def23.3%
Simplified23.3%
associate-*l/23.4%
Applied egg-rr23.4%
if 4.89999999999999998e106 < F Initial program 12.2%
Taylor expanded in C around 0 8.1%
mul-1-neg8.1%
distribute-rgt-neg-in8.1%
+-commutative8.1%
unpow28.1%
unpow28.1%
hypot-def9.5%
Simplified9.5%
Taylor expanded in A around 0 26.9%
mul-1-neg26.9%
Simplified26.9%
Final simplification27.9%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 8.5e-94)
(/ (sqrt 2.0) (/ (- B) (sqrt (* F (+ A (hypot B A))))))
(if (<= F 4.9e+106)
(/ (* (sqrt (* F (+ C (hypot B C)))) (- (sqrt 2.0))) B)
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 8.5e-94) {
tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A)))));
} else if (F <= 4.9e+106) {
tmp = (sqrt((F * (C + hypot(B, C)))) * -sqrt(2.0)) / B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 8.5e-94) {
tmp = Math.sqrt(2.0) / (-B / Math.sqrt((F * (A + Math.hypot(B, A)))));
} else if (F <= 4.9e+106) {
tmp = (Math.sqrt((F * (C + Math.hypot(B, C)))) * -Math.sqrt(2.0)) / B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 8.5e-94: tmp = math.sqrt(2.0) / (-B / math.sqrt((F * (A + math.hypot(B, A))))) elif F <= 4.9e+106: tmp = (math.sqrt((F * (C + math.hypot(B, C)))) * -math.sqrt(2.0)) / B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 8.5e-94) tmp = Float64(sqrt(2.0) / Float64(Float64(-B) / sqrt(Float64(F * Float64(A + hypot(B, A)))))); elseif (F <= 4.9e+106) tmp = Float64(Float64(sqrt(Float64(F * Float64(C + hypot(B, C)))) * Float64(-sqrt(2.0))) / B); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 8.5e-94) tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A))))); elseif (F <= 4.9e+106) tmp = (sqrt((F * (C + hypot(B, C)))) * -sqrt(2.0)) / B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 8.5e-94], N[(N[Sqrt[2.0], $MachinePrecision] / N[((-B) / N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.9e+106], N[(N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 8.5 \cdot 10^{-94}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{-B}{\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}}}\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{+106}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\sqrt{2}\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 8.50000000000000003e-94Initial program 22.0%
Taylor expanded in C around 0 6.4%
mul-1-neg6.4%
distribute-rgt-neg-in6.4%
+-commutative6.4%
unpow26.4%
unpow26.4%
hypot-def21.3%
Simplified21.3%
pow1/221.4%
*-commutative21.4%
unpow-prod-down21.1%
pow1/221.1%
pow1/221.1%
Applied egg-rr21.1%
associate-*l/21.2%
frac-2neg21.2%
Applied egg-rr21.3%
associate-/l*21.3%
*-commutative21.3%
Simplified21.3%
if 8.50000000000000003e-94 < F < 4.89999999999999998e106Initial program 19.4%
Taylor expanded in A around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
unpow211.0%
unpow211.0%
hypot-def23.3%
Simplified23.3%
associate-*l/23.4%
Applied egg-rr23.4%
if 4.89999999999999998e106 < F Initial program 12.2%
Taylor expanded in C around 0 8.1%
mul-1-neg8.1%
distribute-rgt-neg-in8.1%
+-commutative8.1%
unpow28.1%
unpow28.1%
hypot-def9.5%
Simplified9.5%
Taylor expanded in A around 0 26.9%
mul-1-neg26.9%
Simplified26.9%
Final simplification23.6%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 2.1e-117)
(* (sqrt (* F (+ A (hypot B A)))) (/ (- (sqrt 2.0)) B))
(if (<= F 4e+98)
(/ (sqrt (* F (* 2.0 (+ C (hypot B C))))) (- B))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 2.1e-117) {
tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B);
} else if (F <= 4e+98) {
tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 2.1e-117) {
tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (-Math.sqrt(2.0) / B);
} else if (F <= 4e+98) {
tmp = Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / -B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 2.1e-117: tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (-math.sqrt(2.0) / B) elif F <= 4e+98: tmp = math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / -B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 2.1e-117) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(Float64(-sqrt(2.0)) / B)); elseif (F <= 4e+98) tmp = Float64(sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C))))) / Float64(-B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 2.1e-117) tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B); elseif (F <= 4e+98) tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 2.1e-117], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e+98], N[(N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.1 \cdot 10^{-117}:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+98}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{-B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 2.0999999999999999e-117Initial program 21.2%
Taylor expanded in C around 0 4.6%
mul-1-neg4.6%
distribute-rgt-neg-in4.6%
+-commutative4.6%
unpow24.6%
unpow24.6%
hypot-def19.2%
Simplified19.2%
if 2.0999999999999999e-117 < F < 3.99999999999999999e98Initial program 20.8%
Taylor expanded in A around 0 11.2%
mul-1-neg11.2%
distribute-rgt-neg-in11.2%
unpow211.2%
unpow211.2%
hypot-def23.3%
Simplified23.3%
associate-*l/23.4%
Applied egg-rr23.4%
frac-2neg23.4%
div-inv23.4%
distribute-rgt-neg-out23.4%
remove-double-neg23.4%
sqrt-unprod23.4%
Applied egg-rr23.4%
associate-*r/23.4%
*-rgt-identity23.4%
*-commutative23.4%
associate-*l*23.4%
Simplified23.4%
if 3.99999999999999999e98 < F Initial program 12.1%
Taylor expanded in C around 0 8.0%
mul-1-neg8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def10.6%
Simplified10.6%
Taylor expanded in A around 0 27.8%
mul-1-neg27.8%
Simplified27.8%
Final simplification23.3%
NOTE: B should be positive before calling this function
(FPCore (A B C F)
:precision binary64
(if (<= F 3.2e-119)
(/ (sqrt 2.0) (/ (- B) (sqrt (* F (+ A (hypot B A))))))
(if (<= F 3.8e+98)
(/ (sqrt (* F (* 2.0 (+ C (hypot B C))))) (- B))
(* (sqrt 2.0) (- (sqrt (/ F B)))))))B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.2e-119) {
tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A)))));
} else if (F <= 3.8e+98) {
tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 3.2e-119) {
tmp = Math.sqrt(2.0) / (-B / Math.sqrt((F * (A + Math.hypot(B, A)))));
} else if (F <= 3.8e+98) {
tmp = Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / -B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 3.2e-119: tmp = math.sqrt(2.0) / (-B / math.sqrt((F * (A + math.hypot(B, A))))) elif F <= 3.8e+98: tmp = math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / -B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 3.2e-119) tmp = Float64(sqrt(2.0) / Float64(Float64(-B) / sqrt(Float64(F * Float64(A + hypot(B, A)))))); elseif (F <= 3.8e+98) tmp = Float64(sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C))))) / Float64(-B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 3.2e-119) tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A))))); elseif (F <= 3.8e+98) tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 3.2e-119], N[(N[Sqrt[2.0], $MachinePrecision] / N[((-B) / N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e+98], N[(N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.2 \cdot 10^{-119}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{-B}{\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}}}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{+98}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{-B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 3.19999999999999993e-119Initial program 21.2%
Taylor expanded in C around 0 4.6%
mul-1-neg4.6%
distribute-rgt-neg-in4.6%
+-commutative4.6%
unpow24.6%
unpow24.6%
hypot-def19.2%
Simplified19.2%
pow1/219.3%
*-commutative19.3%
unpow-prod-down19.0%
pow1/219.0%
pow1/219.0%
Applied egg-rr19.0%
associate-*l/19.1%
frac-2neg19.1%
Applied egg-rr19.2%
associate-/l*19.2%
*-commutative19.2%
Simplified19.2%
if 3.19999999999999993e-119 < F < 3.7999999999999999e98Initial program 20.8%
Taylor expanded in A around 0 11.2%
mul-1-neg11.2%
distribute-rgt-neg-in11.2%
unpow211.2%
unpow211.2%
hypot-def23.3%
Simplified23.3%
associate-*l/23.4%
Applied egg-rr23.4%
frac-2neg23.4%
div-inv23.4%
distribute-rgt-neg-out23.4%
remove-double-neg23.4%
sqrt-unprod23.4%
Applied egg-rr23.4%
associate-*r/23.4%
*-rgt-identity23.4%
*-commutative23.4%
associate-*l*23.4%
Simplified23.4%
if 3.7999999999999999e98 < F Initial program 12.1%
Taylor expanded in C around 0 8.0%
mul-1-neg8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def10.6%
Simplified10.6%
Taylor expanded in A around 0 27.8%
mul-1-neg27.8%
Simplified27.8%
Final simplification23.3%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= F 1.2e+99) (/ (sqrt (* F (* 2.0 (+ C (hypot B C))))) (- B)) (* (sqrt 2.0) (- (sqrt (/ F B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1.2e+99) {
tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B;
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1.2e+99) {
tmp = Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / -B;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 1.2e+99: tmp = math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / -B else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 1.2e+99) tmp = Float64(sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C))))) / Float64(-B)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 1.2e+99) tmp = sqrt((F * (2.0 * (C + hypot(B, C))))) / -B; else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 1.2e+99], N[(N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{+99}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{-B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 1.2000000000000001e99Initial program 21.0%
Taylor expanded in A around 0 7.5%
mul-1-neg7.5%
distribute-rgt-neg-in7.5%
unpow27.5%
unpow27.5%
hypot-def18.9%
Simplified18.9%
associate-*l/18.9%
Applied egg-rr18.9%
frac-2neg18.9%
div-inv18.9%
distribute-rgt-neg-out18.9%
remove-double-neg18.9%
sqrt-unprod19.0%
Applied egg-rr19.0%
associate-*r/19.0%
*-rgt-identity19.0%
*-commutative19.0%
associate-*l*19.0%
Simplified19.0%
if 1.2000000000000001e99 < F Initial program 12.1%
Taylor expanded in C around 0 8.0%
mul-1-neg8.0%
distribute-rgt-neg-in8.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def10.6%
Simplified10.6%
Taylor expanded in A around 0 27.8%
mul-1-neg27.8%
Simplified27.8%
Final simplification21.7%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= A 1.45e+169) (* (sqrt 2.0) (- (sqrt (/ F B)))) (* (/ 2.0 B) (* (sqrt F) (- (sqrt A))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (A <= 1.45e+169) {
tmp = sqrt(2.0) * -sqrt((F / B));
} else {
tmp = (2.0 / B) * (sqrt(F) * -sqrt(A));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (a <= 1.45d+169) then
tmp = sqrt(2.0d0) * -sqrt((f / b))
else
tmp = (2.0d0 / b) * (sqrt(f) * -sqrt(a))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (A <= 1.45e+169) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
} else {
tmp = (2.0 / B) * (Math.sqrt(F) * -Math.sqrt(A));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if A <= 1.45e+169: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) else: tmp = (2.0 / B) * (math.sqrt(F) * -math.sqrt(A)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (A <= 1.45e+169) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); else tmp = Float64(Float64(2.0 / B) * Float64(sqrt(F) * Float64(-sqrt(A)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (A <= 1.45e+169) tmp = sqrt(2.0) * -sqrt((F / B)); else tmp = (2.0 / B) * (sqrt(F) * -sqrt(A)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[A, 1.45e+169], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(2.0 / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[A], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq 1.45 \cdot 10^{+169}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A}\right)\right)\\
\end{array}
\end{array}
if A < 1.45e169Initial program 20.9%
Taylor expanded in C around 0 8.9%
mul-1-neg8.9%
distribute-rgt-neg-in8.9%
+-commutative8.9%
unpow28.9%
unpow28.9%
hypot-def17.0%
Simplified17.0%
Taylor expanded in A around 0 15.8%
mul-1-neg15.8%
Simplified15.8%
if 1.45e169 < A Initial program 2.1%
Taylor expanded in C around 0 1.2%
mul-1-neg1.2%
distribute-rgt-neg-in1.2%
+-commutative1.2%
unpow21.2%
unpow21.2%
hypot-def17.6%
Simplified17.6%
Taylor expanded in B around 0 15.1%
mul-1-neg15.1%
*-commutative15.1%
unpow215.1%
rem-square-sqrt15.2%
Simplified15.2%
sqrt-prod15.6%
Applied egg-rr15.6%
Final simplification15.7%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= F 1e-49) (* (/ (sqrt 2.0) B) (- (sqrt (* B F)))) (* (sqrt 2.0) (- (sqrt (/ F B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1e-49) {
tmp = (sqrt(2.0) / B) * -sqrt((B * F));
} else {
tmp = sqrt(2.0) * -sqrt((F / B));
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 1d-49) then
tmp = (sqrt(2.0d0) / b) * -sqrt((b * f))
else
tmp = sqrt(2.0d0) * -sqrt((f / b))
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (F <= 1e-49) {
tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * F));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if F <= 1e-49: tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * F)) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B)) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (F <= 1e-49) tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * F)))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (F <= 1e-49) tmp = (sqrt(2.0) / B) * -sqrt((B * F)); else tmp = sqrt(2.0) * -sqrt((F / B)); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[F, 1e-49], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 10^{-49}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
\end{array}
if F < 9.99999999999999936e-50Initial program 23.3%
Taylor expanded in C around 0 8.3%
mul-1-neg8.3%
distribute-rgt-neg-in8.3%
+-commutative8.3%
unpow28.3%
unpow28.3%
hypot-def22.9%
Simplified22.9%
Taylor expanded in A around 0 18.4%
if 9.99999999999999936e-50 < F Initial program 13.9%
Taylor expanded in C around 0 7.3%
mul-1-neg7.3%
distribute-rgt-neg-in7.3%
+-commutative7.3%
unpow27.3%
unpow27.3%
hypot-def12.1%
Simplified12.1%
Taylor expanded in A around 0 21.4%
mul-1-neg21.4%
Simplified21.4%
Final simplification20.0%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (sqrt 2.0) (- (sqrt (/ F B)))))
B = abs(B);
double code(double A, double B, double C, double F) {
return sqrt(2.0) * -sqrt((F / B));
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = sqrt(2.0d0) * -sqrt((f / b))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return Math.sqrt(2.0) * -Math.sqrt((F / B));
}
B = abs(B) def code(A, B, C, F): return math.sqrt(2.0) * -math.sqrt((F / B))
B = abs(B) function code(A, B, C, F) return Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = sqrt(2.0) * -sqrt((F / B)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)
\end{array}
Initial program 18.2%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
distribute-rgt-neg-in7.8%
+-commutative7.8%
unpow27.8%
unpow27.8%
hypot-def17.1%
Simplified17.1%
Taylor expanded in A around 0 14.6%
mul-1-neg14.6%
Simplified14.6%
Final simplification14.6%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 1.9e-126) (* (pow (* A F) 0.5) (/ (- 2.0) B)) (* (sqrt (* C F)) (/ -2.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.9e-126) {
tmp = pow((A * F), 0.5) * (-2.0 / B);
} else {
tmp = sqrt((C * F)) * (-2.0 / B);
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 1.9d-126) then
tmp = ((a * f) ** 0.5d0) * (-2.0d0 / b)
else
tmp = sqrt((c * f)) * ((-2.0d0) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.9e-126) {
tmp = Math.pow((A * F), 0.5) * (-2.0 / B);
} else {
tmp = Math.sqrt((C * F)) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 1.9e-126: tmp = math.pow((A * F), 0.5) * (-2.0 / B) else: tmp = math.sqrt((C * F)) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 1.9e-126) tmp = Float64((Float64(A * F) ^ 0.5) * Float64(Float64(-2.0) / B)); else tmp = Float64(sqrt(Float64(C * F)) * Float64(-2.0 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 1.9e-126) tmp = ((A * F) ^ 0.5) * (-2.0 / B); else tmp = sqrt((C * F)) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 1.9e-126], N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] * N[((-2.0) / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.9 \cdot 10^{-126}:\\
\;\;\;\;{\left(A \cdot F\right)}^{0.5} \cdot \frac{-2}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if C < 1.8999999999999999e-126Initial program 15.6%
Taylor expanded in C around 0 8.8%
mul-1-neg8.8%
distribute-rgt-neg-in8.8%
+-commutative8.8%
unpow28.8%
unpow28.8%
hypot-def20.7%
Simplified20.7%
Taylor expanded in B around 0 7.4%
mul-1-neg7.4%
*-commutative7.4%
unpow27.4%
rem-square-sqrt7.4%
Simplified7.4%
pow1/27.5%
*-commutative7.5%
Applied egg-rr7.5%
if 1.8999999999999999e-126 < C Initial program 22.9%
Taylor expanded in A around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def17.2%
Simplified17.2%
associate-*l/17.2%
Applied egg-rr17.2%
Taylor expanded in B around 0 9.1%
mul-1-neg9.1%
*-commutative9.1%
distribute-rgt-neg-in9.1%
*-commutative9.1%
mul-1-neg9.1%
unpow29.1%
rem-square-sqrt9.2%
associate-*r/9.2%
metadata-eval9.2%
Simplified9.2%
Final simplification8.1%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 7e-126) (/ (* (sqrt (* A F)) (- 2.0)) B) (* (sqrt (* C F)) (/ -2.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 7e-126) {
tmp = (sqrt((A * F)) * -2.0) / B;
} else {
tmp = sqrt((C * F)) * (-2.0 / B);
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 7d-126) then
tmp = (sqrt((a * f)) * -2.0d0) / b
else
tmp = sqrt((c * f)) * ((-2.0d0) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (C <= 7e-126) {
tmp = (Math.sqrt((A * F)) * -2.0) / B;
} else {
tmp = Math.sqrt((C * F)) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 7e-126: tmp = (math.sqrt((A * F)) * -2.0) / B else: tmp = math.sqrt((C * F)) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 7e-126) tmp = Float64(Float64(sqrt(Float64(A * F)) * Float64(-2.0)) / B); else tmp = Float64(sqrt(Float64(C * F)) * Float64(-2.0 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 7e-126) tmp = (sqrt((A * F)) * -2.0) / B; else tmp = sqrt((C * F)) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 7e-126], N[(N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 7 \cdot 10^{-126}:\\
\;\;\;\;\frac{\sqrt{A \cdot F} \cdot \left(-2\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if C < 7e-126Initial program 15.6%
Taylor expanded in C around 0 8.8%
mul-1-neg8.8%
distribute-rgt-neg-in8.8%
+-commutative8.8%
unpow28.8%
unpow28.8%
hypot-def20.7%
Simplified20.7%
Taylor expanded in B around 0 7.4%
mul-1-neg7.4%
*-commutative7.4%
unpow27.4%
rem-square-sqrt7.4%
Simplified7.4%
associate-*r/7.4%
*-commutative7.4%
Applied egg-rr7.4%
if 7e-126 < C Initial program 22.9%
Taylor expanded in A around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def17.2%
Simplified17.2%
associate-*l/17.2%
Applied egg-rr17.2%
Taylor expanded in B around 0 9.1%
mul-1-neg9.1%
*-commutative9.1%
distribute-rgt-neg-in9.1%
*-commutative9.1%
mul-1-neg9.1%
unpow29.1%
rem-square-sqrt9.2%
associate-*r/9.2%
metadata-eval9.2%
Simplified9.2%
Final simplification8.1%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (if (<= C 1.25e-126) (* (/ -2.0 B) (sqrt (* A F))) (* (sqrt (* C F)) (/ -2.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.25e-126) {
tmp = (-2.0 / B) * sqrt((A * F));
} else {
tmp = sqrt((C * F)) * (-2.0 / B);
}
return tmp;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 1.25d-126) then
tmp = ((-2.0d0) / b) * sqrt((a * f))
else
tmp = sqrt((c * f)) * ((-2.0d0) / b)
end if
code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
double tmp;
if (C <= 1.25e-126) {
tmp = (-2.0 / B) * Math.sqrt((A * F));
} else {
tmp = Math.sqrt((C * F)) * (-2.0 / B);
}
return tmp;
}
B = abs(B) def code(A, B, C, F): tmp = 0 if C <= 1.25e-126: tmp = (-2.0 / B) * math.sqrt((A * F)) else: tmp = math.sqrt((C * F)) * (-2.0 / B) return tmp
B = abs(B) function code(A, B, C, F) tmp = 0.0 if (C <= 1.25e-126) tmp = Float64(Float64(-2.0 / B) * sqrt(Float64(A * F))); else tmp = Float64(sqrt(Float64(C * F)) * Float64(-2.0 / B)); end return tmp end
B = abs(B) function tmp_2 = code(A, B, C, F) tmp = 0.0; if (C <= 1.25e-126) tmp = (-2.0 / B) * sqrt((A * F)); else tmp = sqrt((C * F)) * (-2.0 / B); end tmp_2 = tmp; end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := If[LessEqual[C, 1.25e-126], N[(N[(-2.0 / B), $MachinePrecision] * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq 1.25 \cdot 10^{-126}:\\
\;\;\;\;\frac{-2}{B} \cdot \sqrt{A \cdot F}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B}\\
\end{array}
\end{array}
if C < 1.25000000000000001e-126Initial program 15.6%
Taylor expanded in C around 0 8.8%
mul-1-neg8.8%
distribute-rgt-neg-in8.8%
+-commutative8.8%
unpow28.8%
unpow28.8%
hypot-def20.7%
Simplified20.7%
pow1/220.7%
*-commutative20.7%
unpow-prod-down27.8%
pow1/227.8%
pow1/227.8%
Applied egg-rr27.8%
Taylor expanded in B around 0 7.4%
mul-1-neg7.4%
distribute-rgt-neg-in7.4%
mul-1-neg7.4%
unpow27.4%
rem-square-sqrt7.4%
associate-*r/7.4%
metadata-eval7.4%
Simplified7.4%
if 1.25000000000000001e-126 < C Initial program 22.9%
Taylor expanded in A around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def17.2%
Simplified17.2%
associate-*l/17.2%
Applied egg-rr17.2%
Taylor expanded in B around 0 9.1%
mul-1-neg9.1%
*-commutative9.1%
distribute-rgt-neg-in9.1%
*-commutative9.1%
mul-1-neg9.1%
unpow29.1%
rem-square-sqrt9.2%
associate-*r/9.2%
metadata-eval9.2%
Simplified9.2%
Final simplification8.0%
NOTE: B should be positive before calling this function (FPCore (A B C F) :precision binary64 (* (/ -2.0 B) (sqrt (* A F))))
B = abs(B);
double code(double A, double B, double C, double F) {
return (-2.0 / B) * sqrt((A * F));
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: f
code = ((-2.0d0) / b) * sqrt((a * f))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
return (-2.0 / B) * Math.sqrt((A * F));
}
B = abs(B) def code(A, B, C, F): return (-2.0 / B) * math.sqrt((A * F))
B = abs(B) function code(A, B, C, F) return Float64(Float64(-2.0 / B) * sqrt(Float64(A * F))) end
B = abs(B) function tmp = code(A, B, C, F) tmp = (-2.0 / B) * sqrt((A * F)); end
NOTE: B should be positive before calling this function code[A_, B_, C_, F_] := N[(N[(-2.0 / B), $MachinePrecision] * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{-2}{B} \cdot \sqrt{A \cdot F}
\end{array}
Initial program 18.2%
Taylor expanded in C around 0 7.8%
mul-1-neg7.8%
distribute-rgt-neg-in7.8%
+-commutative7.8%
unpow27.8%
unpow27.8%
hypot-def17.1%
Simplified17.1%
pow1/217.1%
*-commutative17.1%
unpow-prod-down23.7%
pow1/223.7%
pow1/223.7%
Applied egg-rr23.7%
Taylor expanded in B around 0 5.1%
mul-1-neg5.1%
distribute-rgt-neg-in5.1%
mul-1-neg5.1%
unpow25.1%
rem-square-sqrt5.1%
associate-*r/5.1%
metadata-eval5.1%
Simplified5.1%
Final simplification5.1%
herbie shell --seed 2023320
(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))))