?

Average Error: 13.7 → 0.2
Time: 37.2s
Precision: binary64
Cost: 39496

?

\[\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 -122000000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq 120000000:\\ \;\;\;\;\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)\\ \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 -122000000.0)
     (- (/ 1.0 (/ (/ (sin B) (/ -1.0 F)) F)) t_0)
     (if (<= F 120000000.0)
       (fma
        (/ F (sin B))
        (pow (fma x 2.0 (fma F F 2.0)) -0.5)
        (/ (- x) (tan B)))
       (- (/ 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 <= -122000000.0) {
		tmp = (1.0 / ((sin(B) / (-1.0 / F)) / F)) - t_0;
	} else if (F <= 120000000.0) {
		tmp = fma((F / sin(B)), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (-x / tan(B)));
	} 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 <= -122000000.0)
		tmp = Float64(Float64(1.0 / Float64(Float64(sin(B) / Float64(-1.0 / F)) / F)) - t_0);
	elseif (F <= 120000000.0)
		tmp = fma(Float64(F / sin(B)), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(Float64(-x) / tan(B)));
	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, -122000000.0], N[(N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] / N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.0], N[(N[(F / N[Sin[B], $MachinePrecision]), $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] - 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 -122000000:\\
\;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\

\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;\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)\\

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


\end{array}

Error?

Derivation?

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

    1. Initial program 24.9

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

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

      [Start]24.9

      \[ \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)} \]

      +-commutative [=>]24.9

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

      unsub-neg [=>]24.9

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

      +-commutative [=>]24.9

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

      *-commutative [=>]24.9

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

      fma-def [=>]24.9

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

      fma-def [=>]24.9

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

      metadata-eval [=>]24.9

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

      metadata-eval [=>]24.9

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

      associate-*r/ [=>]24.9

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

      *-rgt-identity [=>]24.9

      \[ \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{\color{blue}{x}}{\tan B} \]
    3. Applied egg-rr32.8

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    4. Simplified19.0

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

      [Start]32.8

      \[ \left(e^{\mathsf{log1p}\left(F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]

      expm1-def [=>]32.8

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

      expm1-log1p [=>]19.0

      \[ \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} - \frac{x}{\tan B} \]
    5. Applied egg-rr19.0

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

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

    if -1.22e8 < F < 1.2e8

    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

      [Start]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)} \]

      +-commutative [=>]0.4

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

      fma-def [=>]0.4

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

      +-commutative [=>]0.4

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

      *-commutative [=>]0.4

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

      fma-def [=>]0.4

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

      fma-def [=>]0.4

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

      metadata-eval [=>]0.4

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

      metadata-eval [=>]0.4

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

      associate-*r/ [=>]0.3

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

      distribute-neg-frac [=>]0.3

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

      *-rgt-identity [=>]0.3

      \[ \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{-\color{blue}{x}}{\tan B}\right) \]

    if 1.2e8 < F

    1. Initial program 25.7

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

      [Start]25.7

      \[ \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)} \]

      +-commutative [=>]25.7

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

      unsub-neg [=>]25.7

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

      +-commutative [=>]25.7

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

      *-commutative [=>]25.7

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

      fma-def [=>]25.7

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

      fma-def [=>]25.7

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

      metadata-eval [=>]25.7

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

      metadata-eval [=>]25.7

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

      associate-*r/ [=>]25.7

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

      *-rgt-identity [=>]25.7

      \[ \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{\color{blue}{x}}{\tan B} \]
    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 -122000000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 120000000:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternatives

Alternative 1
Error0.3
Cost33160
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq 140000000:\\ \;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 2
Error0.2
Cost33160
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -185000000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq 140000000:\\ \;\;\;\;\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} \]
Alternative 3
Error0.3
Cost20744
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -265000000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq 126000000:\\ \;\;\;\;\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{1}{\sin B} - t_0\\ \end{array} \]
Alternative 4
Error0.3
Cost20744
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -100000000000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq 140000000:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 5
Error0.7
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq 1.45:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 6
Error0.7
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - 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{1}{\sin B} - t_0\\ \end{array} \]
Alternative 7
Error7.1
Cost14480
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \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 -1350000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq -1.9 \cdot 10^{-103}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-146}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 3000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 8
Error7.1
Cost14480
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{if}\;F \leq -930000:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq -2.9 \cdot 10^{-103}:\\ \;\;\;\;t_1 + \frac{-1}{\frac{B}{x}}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-147}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2100000:\\ \;\;\;\;t_1 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 9
Error7.6
Cost14288
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{if}\;F \leq -1.9 \cdot 10^{-9}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq -1.9 \cdot 10^{-103}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-149}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.044:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 10
Error16.2
Cost13776
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -3.3 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{+71}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.86 \cdot 10^{-118}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 11
Error11.5
Cost13764
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9 \cdot 10^{-31}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - t_0\\ \mathbf{elif}\;F \leq 1.86 \cdot 10^{-118}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 12
Error22.2
Cost13712
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -6.2 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{+71}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-58}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+88} \lor \neg \left(F \leq 8.2 \cdot 10^{+254}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \]
Alternative 13
Error22.2
Cost13712
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -1.55 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -9 \cdot 10^{+71}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+88} \lor \neg \left(F \leq 5.4 \cdot 10^{+253}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \]
Alternative 14
Error11.5
Cost13636
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -6.1 \cdot 10^{-30}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t_0\\ \mathbf{elif}\;F \leq 1.86 \cdot 10^{-118}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 15
Error11.5
Cost13636
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.25 \cdot 10^{-28}:\\ \;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.86 \cdot 10^{-118}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 16
Error26.6
Cost8728
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ t_2 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \left(0.16666666666666666 \cdot \left(F \cdot B\right) + \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{if}\;F \leq -3.7 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1 \cdot 10^{+73}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.25 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-266}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-278}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 150000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+84} \lor \neg \left(F \leq 2.15 \cdot 10^{+253}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \]
Alternative 17
Error26.6
Cost8344
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -4.3 \cdot 10^{+201}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{+72}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.2 \cdot 10^{-266}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-276}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 150000000:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+87} \lor \neg \left(F \leq 2.5 \cdot 10^{+253}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \]
Alternative 18
Error26.7
Cost7905
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -6.2 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{+73}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sin B}{\frac{-1}{F}}}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.2 \cdot 10^{-87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{-266}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-276}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 20.5:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{+87} \lor \neg \left(F \leq 1.9 \cdot 10^{+254}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \]
Alternative 19
Error30.3
Cost7904
\[\begin{array}{l} t_0 := \frac{1}{\sin B}\\ t_1 := \frac{-1}{\sin B}\\ t_2 := \frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;x \leq -9.8 \cdot 10^{-23}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-166}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-192}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-224}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-287}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-152}:\\ \;\;\;\;1 + \left(-1 + t_1\right)\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-82}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 20
Error27.0
Cost7641
\[\begin{array}{l} t_0 := \frac{F}{B} \cdot \sqrt{0.5} - \frac{x}{B}\\ t_1 := \frac{x}{\tan B}\\ t_2 := \frac{-1}{B} - t_1\\ \mathbf{if}\;F \leq -4.8 \cdot 10^{-85}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-267}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-272}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 0.52:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+86} \lor \neg \left(F \leq 7.2 \cdot 10^{+254}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_1\\ \end{array} \]
Alternative 21
Error27.0
Cost7641
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -1.25 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{-267}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-277}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 0.96:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+88} \lor \neg \left(F \leq 1.75 \cdot 10^{+252}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \]
Alternative 22
Error28.1
Cost7509
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq 2.6 \cdot 10^{-286}:\\ \;\;\;\;\frac{-1}{B} - t_0\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-255}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 280000000 \lor \neg \left(F \leq 1.55 \cdot 10^{+84}\right) \land F \leq 2.9 \cdot 10^{+251}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 23
Error37.3
Cost7121
\[\begin{array}{l} \mathbf{if}\;F \leq -3.7 \cdot 10^{+47}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-59}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{+116} \lor \neg \left(F \leq 5.4 \cdot 10^{+234}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 24
Error38.6
Cost6724
\[\begin{array}{l} \mathbf{if}\;F \leq -3.7 \cdot 10^{+47}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-27}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{-1 - x}{F \cdot F}\right) - x}{B}\\ \end{array} \]
Alternative 25
Error40.0
Cost1096
\[\begin{array}{l} \mathbf{if}\;F \leq -9.6 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-27}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{-1 - x}{F \cdot F}\right) - x}{B}\\ \end{array} \]
Alternative 26
Error39.9
Cost840
\[\begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-53}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 27
Error46.0
Cost785
\[\begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{+65}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-63} \lor \neg \left(F \leq 1.5 \cdot 10^{+196}\right) \land F \leq 5.1 \cdot 10^{+234}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
Alternative 28
Error42.8
Cost785
\[\begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-61} \lor \neg \left(F \leq 8.2 \cdot 10^{+195}\right) \land F \leq 5.1 \cdot 10^{+234}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
Alternative 29
Error40.1
Cost584
\[\begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.86 \cdot 10^{-118}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 30
Error52.1
Cost324
\[\begin{array}{l} \mathbf{if}\;F \leq -8 \cdot 10^{-266}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
Alternative 31
Error57.0
Cost192
\[\frac{-1}{B} \]

Error

Reproduce?

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