Average Error: 13.5 → 0.2
Time: 29.9s
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 102000:\\ \;\;\;\;\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 + \frac{-1 - x}{F \cdot F}}{\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 102000.0)
       (- (* (/ F (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) t_0)
       (- (/ (+ 1.0 (/ (- -1.0 x) (* F F))) (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 <= 102000.0) {
		tmp = ((F / sin(B)) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - t_0;
	} else {
		tmp = ((1.0 + ((-1.0 - x) / (F * F))) / 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 <= 102000.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(Float64(1.0 + Float64(Float64(-1.0 - x) / Float64(F * F))) / 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, 102000.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[(N[(1.0 + N[(N[(-1.0 - x), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 102000:\\
\;\;\;\;\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 + \frac{-1 - x}{F \cdot F}}{\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 < 102000

    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 102000 < F

    1. Initial program 24.3

      \[\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.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. Applied egg-rr18.1

      \[\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} \]
    4. Taylor expanded in F around inf 0.2

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

      \[\leadsto \frac{\color{blue}{1 + \frac{-1 + \left(-x\right)}{F \cdot F}}}{\sin B} - \frac{x}{\tan B} \]
      Proof
      (+.f64 1 (/.f64 (+.f64 -1 (neg.f64 x)) (*.f64 F F))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (/.f64 (+.f64 -1 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 x))) (*.f64 F F))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (/.f64 (+.f64 -1 (*.f64 (Rewrite<= metadata-eval (*.f64 -1/2 2)) x)) (*.f64 F F))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (/.f64 (+.f64 -1 (Rewrite<= associate-*r*_binary64 (*.f64 -1/2 (*.f64 2 x)))) (*.f64 F F))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (/.f64 (+.f64 (Rewrite<= metadata-eval (*.f64 -1/2 2)) (*.f64 -1/2 (*.f64 2 x))) (*.f64 F F))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (/.f64 (Rewrite<= distribute-lft-in_binary64 (*.f64 -1/2 (+.f64 2 (*.f64 2 x)))) (*.f64 F F))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (/.f64 (*.f64 -1/2 (+.f64 2 (*.f64 2 x))) (Rewrite<= unpow2_binary64 (pow.f64 F 2)))): 0 points increase in error, 0 points decrease in error
      (+.f64 1 (Rewrite<= associate-*r/_binary64 (*.f64 -1/2 (/.f64 (+.f64 2 (*.f64 2 x)) (pow.f64 F 2))))): 0 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 -1 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 102000:\\ \;\;\;\;\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 + \frac{-1 - x}{F \cdot F}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternatives

Alternative 1
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 260000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B} - t_0\\ \end{array} \]
Alternative 2
Error0.6
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -240:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 300:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B} - t_0\\ \end{array} \]
Alternative 3
Error0.6
Cost20296
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -240:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 300:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B} - t_0\\ \end{array} \]
Alternative 4
Error7.7
Cost14288
\[\begin{array}{l} t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \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 -1.05 \cdot 10^{-116}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 2.65 \cdot 10^{-163}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.064:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \]
Alternative 5
Error7.7
Cost14288
\[\begin{array}{l} t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\ 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 -1.22 \cdot 10^{-116}:\\ \;\;\;\;\frac{F \cdot t_0}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-163}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.108:\\ \;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \]
Alternative 6
Error10.6
Cost13644
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -3.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-128}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-13}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 7
Error20.3
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -240:\\ \;\;\;\;\frac{F \cdot \frac{1}{\frac{-1 - x}{F} - F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-128}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 10^{+69}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F + \frac{x + 1}{F}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{+181}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 8
Error20.2
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -250:\\ \;\;\;\;\frac{F \cdot \frac{1}{\frac{-1 - x}{F} - F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.4 \cdot 10^{-128}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+69}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F + \frac{x + 1}{F}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{+181}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 9
Error20.2
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -250:\\ \;\;\;\;\frac{F \cdot \frac{1}{\frac{-1 - x}{F} - F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-126}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{+69}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F + \frac{x + 1}{F}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{+181}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 10
Error15.6
Cost13448
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -6 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+68}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F + \frac{x + 1}{F}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.02 \cdot 10^{+183}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 11
Error26.6
Cost8148
\[\begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ t_1 := \frac{x}{\tan B}\\ t_2 := \frac{F}{B \cdot \left(-F\right)} - t_1\\ \mathbf{if}\;F \leq -1.02 \cdot 10^{-131}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-246}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-161}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.06 \cdot 10^{+69}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F + \frac{x + 1}{F}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+182}:\\ \;\;\;\;\frac{1}{B} - t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 12
Error27.6
Cost7896
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{B} - t_0\\ \mathbf{if}\;F \leq -7 \cdot 10^{-176}:\\ \;\;\;\;\frac{F}{B \cdot \left(-F\right)} - t_0\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-244}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-12}:\\ \;\;\;\;\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 390:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{+68}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error26.6
Cost7896
\[\begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ t_1 := \frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\ t_2 := \frac{x}{\tan B}\\ t_3 := \frac{F}{B \cdot \left(-F\right)} - t_2\\ \mathbf{if}\;F \leq -1.02 \cdot 10^{-131}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-245}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-159}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.08 \cdot 10^{+182}:\\ \;\;\;\;\frac{1}{B} - t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error31.1
Cost7772
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ t_1 := \frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;x \leq -3.3 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-104}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-214}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{elif}\;x \leq -2.45 \cdot 10^{-231}:\\ \;\;\;\;-1 + \left(t_0 + 1\right)\\ \mathbf{elif}\;x \leq -1.08 \cdot 10^{-277}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-116}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error27.6
Cost7768
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{B} - t_0\\ \mathbf{if}\;F \leq -2.2 \cdot 10^{-179}:\\ \;\;\;\;\frac{F}{B \cdot \left(-F\right)} - t_0\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-244}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-12}:\\ \;\;\;\;\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 5800:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+69}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error29.6
Cost7636
\[\begin{array}{l} t_0 := \frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -21000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-176}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-244}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 4000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+69}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error27.7
Cost7504
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{B} - t_0\\ \mathbf{if}\;F \leq -6.1 \cdot 10^{-176}:\\ \;\;\;\;\frac{F}{B \cdot \left(-F\right)} - t_0\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-244}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1850:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+69}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error35.3
Cost6856
\[\begin{array}{l} \mathbf{if}\;F \leq -13000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-39}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 19
Error37.2
Cost6724
\[\begin{array}{l} \mathbf{if}\;F \leq -13000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 20
Error39.7
Cost584
\[\begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-54}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 21
Error46.8
Cost452
\[\begin{array}{l} \mathbf{if}\;F \leq -13000000:\\ \;\;\;\;-1 + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 22
Error44.7
Cost452
\[\begin{array}{l} \mathbf{if}\;F \leq -1.92 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 23
Error47.2
Cost388
\[\begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 24
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))))))