Average Error: 13.5 → 0.2
Time: 32.3s
Precision: binary64
Cost: 33160
\[\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} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 340000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \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
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1e+15)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 340000000.0)
       (- (* (/ F (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
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 t_0 = x / tan(B);
	double tmp;
	if (F <= -1e+15) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 340000000.0) {
		tmp = ((F / sin(B)) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	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)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1e+15)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 340000000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	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_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 340000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $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}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

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

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


\end{array}

Error

Derivation

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

    1. Initial program 25.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. Simplified25.3

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{\tan B}} \]
      Proof
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (fma.f64 F F 2)) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 F F) 2))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x 2) (+.f64 (*.f64 F F) 2))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 x)) (+.f64 (*.f64 F F) 2)) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.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 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.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 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))))) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 x 1)) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))) (Rewrite<= associate-*r/_binary64 (*.f64 x (/.f64 1 (tan.f64 B))))): 31 points increase in error, 10 points decrease in error
      (Rewrite=> fma-neg_binary64 (fma.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (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)))))): 1 points increase in error, 2 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (Rewrite=> remove-double-neg_binary64 (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<= 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)))))): 2 points increase in error, 1 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.1

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]

    if -1e15 < F < 3.4e8

    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}{\frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{\tan B}} \]
      Proof
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (fma.f64 F F 2)) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 F F) 2))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x 2) (+.f64 (*.f64 F F) 2))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 x)) (+.f64 (*.f64 F F) 2)) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.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 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.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 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))))) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 x 1)) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))) (Rewrite<= associate-*r/_binary64 (*.f64 x (/.f64 1 (tan.f64 B))))): 31 points increase in error, 10 points decrease in error
      (Rewrite=> fma-neg_binary64 (fma.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (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)))))): 1 points increase in error, 2 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (Rewrite=> remove-double-neg_binary64 (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<= 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)))))): 2 points increase in error, 1 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

    if 3.4e8 < F

    1. Initial program 24.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. Simplified24.5

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{\tan B}} \]
      Proof
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (fma.f64 F F 2)) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 F F) 2))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x 2) (+.f64 (*.f64 F F) 2))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 x)) (+.f64 (*.f64 F F) 2)) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x))) -1/2)) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.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 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.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 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))))) (/.f64 x (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 x 1)) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))) (Rewrite<= associate-*r/_binary64 (*.f64 x (/.f64 1 (tan.f64 B))))): 31 points increase in error, 10 points decrease in error
      (Rewrite=> fma-neg_binary64 (fma.f64 (/.f64 F (sin.f64 B)) (neg.f64 (neg.f64 (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)))))): 1 points increase in error, 2 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (Rewrite=> remove-double-neg_binary64 (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<= 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)))))): 2 points increase in error, 1 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}} - \frac{x}{\tan B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.2

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

Alternatives

Alternative 1
Error0.2
Cost26760
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -100000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 50000000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{F}}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 2
Error0.3
Cost20744
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 95000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 3
Error0.3
Cost20488
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5000000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 95000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\frac{\sin B}{{\left(2 + F \cdot F\right)}^{-0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 4
Error0.6
Cost20360
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -240:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.45:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(2 + x \cdot 2\right)}^{-0.5} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 5
Error0.6
Cost20104
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -240:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.45:\\ \;\;\;\;F \cdot \frac{{2}^{-0.5}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 6
Error0.6
Cost20040
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -240:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.45:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 7
Error0.6
Cost20040
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -240:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.45:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 8
Error5.9
Cost14480
\[\begin{array}{l} t_0 := F \cdot {\left(2 + x \cdot 2\right)}^{-0.5}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -4.3 \cdot 10^{-116}:\\ \;\;\;\;\frac{t_0}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-163}:\\ \;\;\;\;\frac{t_0}{B} - t_1\\ \mathbf{elif}\;F \leq 280:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \]
Alternative 9
Error5.9
Cost14224
\[\begin{array}{l} t_0 := \frac{F}{\sin B} \cdot {\left(2 + F \cdot F\right)}^{-0.5} - \frac{x}{B}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -4.1 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-162}:\\ \;\;\;\;\frac{F \cdot {\left(2 + x \cdot 2\right)}^{-0.5}}{B} - t_1\\ \mathbf{elif}\;F \leq 280:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \]
Alternative 10
Error5.9
Cost14224
\[\begin{array}{l} t_0 := F \cdot {\left(2 + x \cdot 2\right)}^{-0.5}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -4.7 \cdot 10^{-116}:\\ \;\;\;\;\frac{t_0}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-162}:\\ \;\;\;\;\frac{t_0}{B} - t_1\\ \mathbf{elif}\;F \leq 280:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(2 + F \cdot F\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \]
Alternative 11
Error5.7
Cost13960
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;\frac{F \cdot {\left(2 + x \cdot 2\right)}^{-0.5}}{B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 12
Error10.3
Cost13896
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 4.1 \cdot 10^{-128}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\frac{-1}{F} - F} - t_0\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \left(0.16666666666666666 \cdot \left(F \cdot B\right) + \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 13
Error10.5
Cost13644
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-128}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \left(0.16666666666666666 \cdot \left(F \cdot B\right) + \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 14
Error20.0
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-127}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{elif}\;F \leq 47000000:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \left(0.16666666666666666 \cdot \left(F \cdot B\right) + \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 15
Error20.0
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -5.9 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-126}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 47000000:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \left(0.16666666666666666 \cdot \left(F \cdot B\right) + \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 16
Error14.9
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.55 \cdot 10^{-126}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 47000000:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \left(0.16666666666666666 \cdot \left(F \cdot B\right) + \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 17
Error25.7
Cost8464
\[\begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.35 \cdot 10^{-131}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-245}:\\ \;\;\;\;\frac{F \cdot {\left(2 + x \cdot 2\right)}^{-0.5} - x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{-161}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 47000000:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \left(0.16666666666666666 \cdot \left(F \cdot B\right) + \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 18
Error25.7
Cost8080
\[\begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.7 \cdot 10^{-131}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-245}:\\ \;\;\;\;\frac{F \cdot {\left(2 + x \cdot 2\right)}^{-0.5} - x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-158}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 47000000:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 19
Error25.9
Cost7696
\[\begin{array}{l} t_0 := \frac{F \cdot {\left(2 + x \cdot 2\right)}^{-0.5} - x}{B}\\ t_1 := \frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.1 \cdot 10^{-131}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-246}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-161}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 20
Error31.1
Cost7640
\[\begin{array}{l} t_0 := \frac{1}{\sin B}\\ t_1 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_2 := \frac{-1}{\sin B}\\ \mathbf{if}\;x \leq -3.7 \cdot 10^{-171}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-213}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-233}:\\ \;\;\;\;-1 + \left(t_2 + 1\right)\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-308}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-116}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{-12}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 21
Error27.3
Cost7244
\[\begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.35 \cdot 10^{-174}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-247}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 14500:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 22
Error35.4
Cost7048
\[\begin{array}{l} \mathbf{if}\;F \leq -13000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-50}:\\ \;\;\;\;-\frac{\cos B}{\frac{B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 23
Error35.3
Cost6856
\[\begin{array}{l} \mathbf{if}\;F \leq -13000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 8.6 \cdot 10^{-40}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 24
Error42.2
Cost6724
\[\begin{array}{l} \mathbf{if}\;F \leq -13000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 25
Error46.8
Cost452
\[\begin{array}{l} \mathbf{if}\;F \leq -13000000:\\ \;\;\;\;-1 + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 26
Error44.7
Cost452
\[\begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 27
Error47.2
Cost388
\[\begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 28
Error57.0
Cost192
\[\frac{-1}{B} \]

Error

Reproduce

herbie shell --seed 2022325 
(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))))))