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

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

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


\end{array}

Error

Derivation

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

    1. Initial program 30.2

      \[\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. Simplified30.2

      \[\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, 11 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))): 3 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))): 11 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, 11 points decrease in error
      (-.f64 (*.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 x 1)) (tan.f64 B))): 11 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 (/.f64 1 2)))) (Rewrite<= associate-*r/_binary64 (*.f64 x (/.f64 1 (tan.f64 B))))): 0 points increase in error, 11 points decrease in error
      (Rewrite<= unsub-neg_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, 3 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)))))): 11 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 -4.99999999999999992e72 < F < 2e8

    1. Initial program 0.8

      \[\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.7

      \[\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, 11 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))): 3 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))): 11 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, 11 points decrease in error
      (-.f64 (*.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 x 1)) (tan.f64 B))): 11 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 (/.f64 1 2)))) (Rewrite<= associate-*r/_binary64 (*.f64 x (/.f64 1 (tan.f64 B))))): 0 points increase in error, 11 points decrease in error
      (Rewrite<= unsub-neg_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, 3 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)))))): 11 points increase in error, 0 points decrease in error
    3. Applied egg-rr0.3

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

    if 2e8 < 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.0

      \[\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, 11 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))): 3 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))): 11 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, 11 points decrease in error
      (-.f64 (*.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 x 1)) (tan.f64 B))): 11 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 (/.f64 1 2)))) (Rewrite<= associate-*r/_binary64 (*.f64 x (/.f64 1 (tan.f64 B))))): 0 points increase in error, 11 points decrease in error
      (Rewrite<= unsub-neg_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, 3 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)))))): 11 points increase in error, 0 points decrease in error
    3. Taylor expanded in F around -inf 38.6

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    4. Applied egg-rr42.3

      \[\leadsto \color{blue}{\frac{-1 \cdot \frac{\tan B}{x} - \sin B}{\sin B \cdot \frac{\tan B}{x}}} \]
    5. Simplified38.7

      \[\leadsto \color{blue}{\frac{\frac{-\tan B}{x \cdot \sin B} + -1}{\frac{\tan B}{x}}} \]
      Proof
      (/.f64 (+.f64 (/.f64 (neg.f64 (tan.f64 B)) (*.f64 x (sin.f64 B))) -1) (/.f64 (tan.f64 B) x)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (/.f64 (neg.f64 (tan.f64 B)) (Rewrite<= *-commutative_binary64 (*.f64 (sin.f64 B) x))) -1) (/.f64 (tan.f64 B) x)): 0 points increase in error, 9 points decrease in error
      (/.f64 (+.f64 (Rewrite<= associate-/l/_binary64 (/.f64 (/.f64 (neg.f64 (tan.f64 B)) x) (sin.f64 B))) -1) (/.f64 (tan.f64 B) x)): 10 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (/.f64 (/.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (tan.f64 B))) x) (sin.f64 B)) -1) (/.f64 (tan.f64 B) x)): 8 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (/.f64 (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (tan.f64 B) x))) (sin.f64 B)) -1) (/.f64 (tan.f64 B) x)): 0 points increase in error, 10 points decrease in error
      (/.f64 (+.f64 (/.f64 (*.f64 -1 (/.f64 (tan.f64 B) x)) (sin.f64 B)) (Rewrite<= metadata-eval (neg.f64 1))) (/.f64 (tan.f64 B) x)): 10 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 (/.f64 (*.f64 -1 (/.f64 (tan.f64 B) x)) (sin.f64 B)) 1)) (/.f64 (tan.f64 B) x)): 1 points increase in error, 9 points decrease in error
      (/.f64 (-.f64 (/.f64 (*.f64 -1 (/.f64 (tan.f64 B) x)) (sin.f64 B)) (Rewrite<= *-inverses_binary64 (/.f64 (sin.f64 B) (sin.f64 B)))) (/.f64 (tan.f64 B) x)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (*.f64 -1 (/.f64 (tan.f64 B) x)) (sin.f64 B)) (sin.f64 B))) (/.f64 (tan.f64 B) x)): 9 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r*_binary64 (/.f64 (-.f64 (*.f64 -1 (/.f64 (tan.f64 B) x)) (sin.f64 B)) (*.f64 (sin.f64 B) (/.f64 (tan.f64 B) x)))): 9 points increase in error, 1 points decrease in error
    6. Applied egg-rr0.4

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

      \[\leadsto \color{blue}{\frac{\left(-x\right) + \frac{\tan B}{\sin B}}{\tan B}} \]
      Proof
      (/.f64 (+.f64 (neg.f64 x) (/.f64 (tan.f64 B) (sin.f64 B))) (tan.f64 B)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 x)) (/.f64 (tan.f64 B) (sin.f64 B))) (tan.f64 B)): 0 points increase in error, 15 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (tan.f64 B) (sin.f64 B))))) (tan.f64 B)): 15 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (*.f64 (Rewrite<= rgt-mult-inverse_binary64 (*.f64 x (/.f64 1 x))) (/.f64 (tan.f64 B) (sin.f64 B)))) (tan.f64 B)): 0 points increase in error, 15 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (Rewrite<= associate-*r*_binary64 (*.f64 x (*.f64 (/.f64 1 x) (/.f64 (tan.f64 B) (sin.f64 B)))))) (tan.f64 B)): 0 points increase in error, 15 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (*.f64 x (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (/.f64 1 x) (tan.f64 B)) (sin.f64 B))))) (tan.f64 B)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (*.f64 x (/.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 1 (tan.f64 B)) x)) (sin.f64 B)))) (tan.f64 B)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (*.f64 x (/.f64 (Rewrite<= associate-*r/_binary64 (*.f64 1 (/.f64 (tan.f64 B) x))) (sin.f64 B)))) (tan.f64 B)): 15 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (*.f64 x (Rewrite<= associate-*r/_binary64 (*.f64 1 (/.f64 (/.f64 (tan.f64 B) x) (sin.f64 B)))))) (tan.f64 B)): 0 points increase in error, 15 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (*.f64 x (Rewrite=> *-lft-identity_binary64 (/.f64 (/.f64 (tan.f64 B) x) (sin.f64 B))))) (tan.f64 B)): 15 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 -1 x) (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 (/.f64 (tan.f64 B) x) (sin.f64 B)) x))) (tan.f64 B)): 0 points increase in error, 15 points decrease in error
      (/.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 x (+.f64 -1 (/.f64 (/.f64 (tan.f64 B) x) (sin.f64 B))))) (tan.f64 B)): 15 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 x (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (/.f64 (tan.f64 B) x) (sin.f64 B)) -1))) (tan.f64 B)): 0 points increase in error, 15 points decrease in error
      (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 x (tan.f64 B)) (+.f64 (/.f64 (/.f64 (tan.f64 B) x) (sin.f64 B)) -1))): 0 points increase in error, 15 points decrease in error
      (Rewrite=> distribute-lft-in_binary64 (+.f64 (*.f64 (/.f64 x (tan.f64 B)) (/.f64 (/.f64 (tan.f64 B) x) (sin.f64 B))) (*.f64 (/.f64 x (tan.f64 B)) -1))): 15 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification0.2

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

Alternatives

Alternative 1
Error0.5
Cost33160
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -8.5 \cdot 10^{+72}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{+42}:\\ \;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\tan B}{\sin B} - x}{\tan B}\\ \end{array} \]
Alternative 2
Error0.4
Cost27144
\[\begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+58}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+46}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\tan B}{\sin B} - x}{\tan B}\\ \end{array} \]
Alternative 3
Error0.5
Cost20744
\[\begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+57}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+42}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\tan B}{\sin B} - x}{\tan B}\\ \end{array} \]
Alternative 4
Error0.4
Cost20744
\[\begin{array}{l} \mathbf{if}\;F \leq -80000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{+42}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\tan B}{\sin B} - x}{\tan B}\\ \end{array} \]
Alternative 5
Error0.7
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.45:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\tan B}{\sin B} - x}{\tan B}\\ \end{array} \]
Alternative 6
Error0.7
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.65:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.5:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\tan B}{\sin B} - x}{\tan B}\\ \end{array} \]
Alternative 7
Error5.5
Cost20044
\[\begin{array}{l} t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{if}\;F \leq -75000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.4 \cdot 10^{-102}:\\ \;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\ \mathbf{elif}\;F \leq 48:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + t_0 \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\tan B}{\sin B} - x}{\tan B}\\ \end{array} \]
Alternative 8
Error5.5
Cost14476
\[\begin{array}{l} t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -155000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -2.75 \cdot 10^{-102}:\\ \;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\ \mathbf{elif}\;F \leq 58:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + t_0 \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \]
Alternative 9
Error5.5
Cost14476
\[\begin{array}{l} t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -75000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -3.4 \cdot 10^{-102}:\\ \;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\ \mathbf{elif}\;F \leq 58:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + t_0 \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \]
Alternative 10
Error5.6
Cost14284
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -75000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-102}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.18:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 11
Error6.1
Cost14152
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{-17}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.15:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 12
Error10.6
Cost13512
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{-17}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 13
Error20.6
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-17}:\\ \;\;\;\;\frac{-1 + \frac{-1}{x}}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-57}:\\ \;\;\;\;-\frac{\cos B}{\frac{\sin B}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
Alternative 14
Error20.6
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -4.4 \cdot 10^{-17}:\\ \;\;\;\;\frac{-1 + \frac{-1}{x}}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-57}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
Alternative 15
Error15.8
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{-17}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-57}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
Alternative 16
Error25.9
Cost7888
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -4.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1 + \frac{-1}{x}}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq -7.8 \cdot 10^{-174}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-288}:\\ \;\;\;\;t_0 + \frac{F}{B} \cdot \frac{1}{F}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1}{B}\\ \end{array} \]
Alternative 17
Error32.8
Cost7508
\[\begin{array}{l} t_0 := \frac{1}{B} - \frac{x}{B}\\ t_1 := \frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-127}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -3.65 \cdot 10^{-166}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 3.7 \cdot 10^{-264}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;B \leq 0.00047:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error27.2
Cost7108
\[\begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{-17}:\\ \;\;\;\;\frac{-1 + \frac{-1}{x}}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
Alternative 19
Error37.2
Cost6724
\[\begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-44}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]
Alternative 20
Error39.6
Cost712
\[\begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.25 \cdot 10^{-57}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]
Alternative 21
Error44.7
Cost452
\[\begin{array}{l} \mathbf{if}\;F \leq -3.4 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 22
Error47.5
Cost388
\[\begin{array}{l} \mathbf{if}\;F \leq -3.9 \cdot 10^{+28}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 23
Error56.7
Cost192
\[\frac{-1}{B} \]

Error

Reproduce

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