Average Error: 14.0 → 0.3
Time: 1.2min
Precision: binary64
Cost: 45960
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
\[\begin{array}{l} \mathbf{if}\;F \leq -116:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq 1700000:\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{\sin B}{F}\right)}^{-1}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(FPCore (F B x)
 :precision binary64
 (if (<= F -116.0)
   (+ (* x (/ -1.0 (tan B))) (/ (* F (/ -1.0 F)) (sin B)))
   (if (<= F 1700000.0)
     (fma
      (pow (/ (sin B) F) -1.0)
      (pow (fma x 2.0 (fma F F 2.0)) -0.5)
      (/ (- x) (tan B)))
     (- (/ 1.0 (sin B)) (/ x (/ (sin B) (cos B)))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
double code(double F, double B, double x) {
	double tmp;
	if (F <= -116.0) {
		tmp = (x * (-1.0 / tan(B))) + ((F * (-1.0 / F)) / sin(B));
	} else if (F <= 1700000.0) {
		tmp = fma(pow((sin(B) / F), -1.0), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (-x / tan(B)));
	} else {
		tmp = (1.0 / sin(B)) - (x / (sin(B) / cos(B)));
	}
	return tmp;
}
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function code(F, B, x)
	tmp = 0.0
	if (F <= -116.0)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F * Float64(-1.0 / F)) / sin(B)));
	elseif (F <= 1700000.0)
		tmp = fma((Float64(sin(B) / F) ^ -1.0), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(Float64(-x) / tan(B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / Float64(sin(B) / cos(B))));
	end
	return tmp
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[F_, B_, x_] := If[LessEqual[F, -116.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1700000.0], N[(N[Power[N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision], -1.0], $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\begin{array}{l}
\mathbf{if}\;F \leq -116:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{-1}{F}}{\sin B}\\

\mathbf{elif}\;F \leq 1700000:\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{\sin B}{F}\right)}^{-1}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if F < -116

    1. Initial program 25.5

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Applied egg-rr20.3

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-0.5}}{\sin B}} \]
    3. Taylor expanded in F around -inf 0.5

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} \]

    if -116 < F < 1.7e6

    1. Initial program 0.4

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified0.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
      Proof
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (fma.f64 F F 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x 2) (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 x)) (+.f64 (*.f64 F F) 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (Rewrite<= metadata-eval (neg.f64 1/2))) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (Rewrite<= metadata-eval (/.f64 1 2)))) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (neg.f64 x) 1)) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= associate-*r/_binary64 (*.f64 (neg.f64 x) (/.f64 1 (tan.f64 B))))): 25 points increase in error, 3 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))) (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr0.3

      \[\leadsto \mathsf{fma}\left(\color{blue}{{\left(\frac{\sin B}{F}\right)}^{-1}}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right) \]

    if 1.7e6 < F

    1. Initial program 25.1

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified25.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
      Proof
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (fma.f64 F F 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x 2) (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 x)) (+.f64 (*.f64 F F) 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (Rewrite<= metadata-eval (neg.f64 1/2))) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (Rewrite<= metadata-eval (/.f64 1 2)))) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (neg.f64 x) 1)) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= associate-*r/_binary64 (*.f64 (neg.f64 x) (/.f64 1 (tan.f64 B))))): 25 points increase in error, 3 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))) (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in F around inf 0.2

      \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{\cos B \cdot x}{\sin B}} \]
    4. Simplified0.2

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}} \]
      Proof
      (-.f64 (/.f64 1 (sin.f64 B)) (/.f64 x (/.f64 (sin.f64 B) (cos.f64 B)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (/.f64 1 (sin.f64 B)) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 x (cos.f64 B)) (sin.f64 B)))): 13 points increase in error, 12 points decrease in error
      (-.f64 (/.f64 1 (sin.f64 B)) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (cos.f64 B) x)) (sin.f64 B))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 (/.f64 1 (sin.f64 B)) (neg.f64 (/.f64 (*.f64 (cos.f64 B) x) (sin.f64 B))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 1 (sin.f64 B)) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 (cos.f64 B) x) (sin.f64 B))))): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -116:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq 1700000:\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{\sin B}{F}\right)}^{-1}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]

Alternatives

Alternative 1
Error0.5
Cost20616
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -116:\\ \;\;\;\;t_0 + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq 0.0064:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B}\\ \end{array} \]
Alternative 2
Error0.8
Cost20552
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -0.175:\\ \;\;\;\;t_0 + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq 0.0064:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B}\\ \end{array} \]
Alternative 3
Error0.8
Cost20552
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -0.175:\\ \;\;\;\;t_0 + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq 0.0064:\\ \;\;\;\;t_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B}\\ \end{array} \]
Alternative 4
Error0.8
Cost20424
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -0.175:\\ \;\;\;\;t_0 + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq 0.0064:\\ \;\;\;\;t_0 + \frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B}\\ \end{array} \]
Alternative 5
Error8.6
Cost20304
\[\begin{array}{l} t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{if}\;F \leq -116:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-168}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.52 \cdot 10^{-279}:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
Alternative 6
Error8.6
Cost14480
\[\begin{array}{l} t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{if}\;F \leq -116:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-168}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.52 \cdot 10^{-279}:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \end{array} \]
Alternative 7
Error8.7
Cost14288
\[\begin{array}{l} t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{if}\;F \leq -0.175:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-168}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.52 \cdot 10^{-279}:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \end{array} \]
Alternative 8
Error10.8
Cost13764
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{-1}{F}}{\sin B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-43}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \end{array} \]
Alternative 9
Error10.8
Cost13700
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{F \cdot \left(-\sin B\right)}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-43}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \end{array} \]
Alternative 10
Error17.7
Cost13640
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-43}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{\tan B}\\ \end{array} \]
Alternative 11
Error17.7
Cost13640
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-43}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \end{array} \]
Alternative 12
Error23.0
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{+16}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 13
Error23.1
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{+16}:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 14
Error31.1
Cost7900
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ t_1 := \frac{-1}{\sin B}\\ t_2 := \frac{1}{\sin B}\\ \mathbf{if}\;x \leq -700000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.604620279337553 \cdot 10^{-59}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{elif}\;x \leq -2.0027948920069394 \cdot 10^{-72}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -3.615603786464327 \cdot 10^{-179}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.016800464078727 \cdot 10^{-237}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 6.339880513555972 \cdot 10^{-218}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.1719326708126377 \cdot 10^{-29}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 15
Error27.5
Cost7888
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ t_1 := \frac{F \cdot \sqrt{0.5}}{B} - x \cdot \left(\frac{1}{B} + B \cdot -0.3333333333333333\right)\\ \mathbf{if}\;F \leq -115:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-168}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.52 \cdot 10^{-279}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 9.760671630475331 \cdot 10^{+37}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.256841981161278 \cdot 10^{+184}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 16
Error27.5
Cost7888
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{if}\;F \leq -0.175:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-168}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.52 \cdot 10^{-279}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-25}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - x \cdot \left(\frac{1}{B} + B \cdot -0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 9.760671630475331 \cdot 10^{+37}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.256841981161278 \cdot 10^{+184}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error27.5
Cost7888
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{if}\;F \leq -0.175:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-168}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.52 \cdot 10^{-279}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-25}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right) + F \cdot \frac{\sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 9.760671630475331 \cdot 10^{+37}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.256841981161278 \cdot 10^{+184}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error31.4
Cost7240
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-43}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 19
Error33.6
Cost6920
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-42}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 20
Error34.4
Cost6856
\[\begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-35}:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 21
Error42.6
Cost6724
\[\begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \end{array} \]
Alternative 22
Error47.5
Cost708
\[\begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-24}:\\ \;\;\;\;B \cdot -0.16666666666666666 + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \end{array} \]
Alternative 23
Error47.5
Cost580
\[\begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-21}:\\ \;\;\;\;B \cdot -0.16666666666666666 + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 24
Error47.5
Cost388
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 25
Error56.8
Cost192
\[\frac{-1}{B} \]

Error

Reproduce

herbie shell --seed 2022290 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  :precision binary64
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))