VandenBroeck and Keller, Equation (23)

?

Percentage Accurate: 77.2% → 99.7%
Time: 32.9s
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 -5.2 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 14000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, -t_0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} + \frac{-1 - x}{F \cdot \left(F \cdot \sin B\right)}\right) - 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 -5.2e+15)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 14000000.0)
       (fma (/ F (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5) (- t_0))
       (- (+ (/ 1.0 (sin B)) (/ (- -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 <= -5.2e+15) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 14000000.0) {
		tmp = fma((F / sin(B)), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), -t_0);
	} else {
		tmp = ((1.0 / sin(B)) + ((-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 <= -5.2e+15)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 14000000.0)
		tmp = fma(Float64(F / sin(B)), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(-t_0));
	else
		tmp = Float64(Float64(Float64(1.0 / sin(B)) + Float64(Float64(-1.0 - x) / Float64(F * Float64(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, -5.2e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 14000000.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] + (-t$95$0)), $MachinePrecision], N[(N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / N[(F * N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -5.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

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

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} + \frac{-1 - x}{F \cdot \left(F \cdot \sin B\right)}\right) - t_0\\


\end{array}

Local Percentage Accuracy?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 25 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each of Herbie's proposed alternatives. Up and to the right is better. Each dot represents an alternative program; the red square represents the initial program.

Derivation?

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

    1. Initial program 59.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. Simplified71.3%

      \[\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}} \]
      Step-by-step derivation

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

      +-commutative [=>]59.5

      \[ \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 [=>]59.5

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

      associate-*l/ [=>]71.4

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

      associate-*r/ [<=]71.2

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

      *-commutative [<=]71.2

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

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

    if -5.2e15 < F < 1.4e7

    1. Initial program 99.6%

      \[\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. Simplified99.6%

      \[\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)} \]
      Step-by-step derivation

      [Start]99.6

      \[ \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 [=>]99.6

      \[ \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 [=>]99.6

      \[ \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 [=>]99.6

      \[ \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 [=>]99.6

      \[ \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 [=>]99.6

      \[ \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 [=>]99.6

      \[ \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 [=>]99.6

      \[ \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 [=>]99.6

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

      distribute-lft-neg-in [=>]99.6

      \[ \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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]

      associate-*r/ [=>]99.6

      \[ \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{\left(-x\right) \cdot 1}{\tan B}}\right) \]

      *-rgt-identity [=>]99.6

      \[ \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.4e7 < F

    1. Initial program 69.6%

      \[\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. Simplified81.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}} \]
      Step-by-step derivation

      [Start]69.6

      \[ \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 [=>]69.6

      \[ \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 [=>]69.6

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

      associate-*l/ [=>]79.8

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

      associate-*r/ [<=]79.7

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

      *-commutative [<=]79.7

      \[ \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Applied egg-rr81.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} \]
      Step-by-step derivation

      [Start]81.0

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

      associate-*r/ [=>]81.1

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

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{2 + 2 \cdot x}{\sin B \cdot {F}^{2}} + \frac{1}{\sin B}\right)} - \frac{x}{\tan B} \]
    5. Simplified99.8%

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

      [Start]98.5

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

      +-commutative [=>]98.5

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

      associate-*r/ [=>]98.5

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

      distribute-lft-in [=>]98.5

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

      metadata-eval [=>]98.5

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

      associate-*r* [=>]99.8

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

      metadata-eval [=>]99.8

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

      mul-1-neg [=>]99.8

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

      *-commutative [=>]99.8

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

      unpow2 [=>]99.8

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

      associate-*l* [=>]99.8

      \[ \left(\frac{1}{\sin B} + \frac{-1 + \left(-x\right)}{\color{blue}{F \cdot \left(F \cdot \sin B\right)}}\right) - \frac{x}{\tan B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 14000000:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(\frac{1}{\sin B} + \frac{-1 - x}{F \cdot \left(F \cdot \sin B\right)}\right) - \frac{x}{\tan B}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.7%
Cost33160
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 14000000:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(\frac{1}{\sin B} + \frac{-1 - x}{F \cdot \left(F \cdot \sin B\right)}\right) - t_0\\ \end{array} \]
Alternative 2
Accuracy99.6%
Cost20744
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 14000000:\\ \;\;\;\;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}:\\ \;\;\;\;\left(\frac{1}{\sin B} + \frac{-1 - x}{F \cdot \left(F \cdot \sin B\right)}\right) - t_0\\ \end{array} \]
Alternative 3
Accuracy98.9%
Cost20740
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := 2 + x \cdot 2\\ \mathbf{if}\;F \leq -25:\\ \;\;\;\;\frac{F \cdot \left(0.5 \cdot \frac{t_1}{{F}^{3}} + \frac{-1}{F}\right)}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 31:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{t_1}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} + \frac{-1 - x}{F \cdot \left(F \cdot \sin B\right)}\right) - t_0\\ \end{array} \]
Alternative 4
Accuracy99.1%
Cost20552
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 16:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} + \frac{-1 - x}{F \cdot \left(F \cdot \sin B\right)}\right) - t_0\\ \end{array} \]
Alternative 5
Accuracy99.1%
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 54:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B} - t_0\\ \end{array} \]
Alternative 6
Accuracy91.9%
Cost20360
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9.4 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.0068:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + x \cdot 2}}, -t_0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 7
Accuracy88.9%
Cost14480
\[\begin{array}{l} t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -2.25 \cdot 10^{-77}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-86}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;F \leq 1800:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B} - t_1\\ \end{array} \]
Alternative 8
Accuracy84.7%
Cost14156
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.75 \cdot 10^{-73}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-85}:\\ \;\;\;\;-t_0\\ \mathbf{elif}\;F \leq 1.05:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \frac{-1 - x}{F \cdot F}}{\sin B} - t_0\\ \end{array} \]
Alternative 9
Accuracy64.3%
Cost14044
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ t_1 := \frac{x}{\tan B}\\ t_2 := -t_1\\ \mathbf{if}\;F \leq -1.55 \cdot 10^{+200}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.38 \cdot 10^{+104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{+95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -5.3 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -9.4 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-85}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 14500000:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{B} - t_1\\ \end{array} \]
Alternative 10
Accuracy64.3%
Cost14044
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ t_1 := \frac{x}{\tan B}\\ t_2 := -t_1\\ \mathbf{if}\;F \leq -1.15 \cdot 10^{+200}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{+104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -9.2 \cdot 10^{+95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -2.55 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -9.4 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-84}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 14500000:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{B} - t_1\\ \end{array} \]
Alternative 11
Accuracy84.7%
Cost13900
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9.2 \cdot 10^{-73}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-85}:\\ \;\;\;\;-t_0\\ \mathbf{elif}\;F \leq 0.007:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 12
Accuracy84.7%
Cost13644
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.5 \cdot 10^{-72}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-85}:\\ \;\;\;\;-t_0\\ \mathbf{elif}\;F \leq 0.11:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 13
Accuracy77.3%
Cost13516
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.1 \cdot 10^{-72}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-85}:\\ \;\;\;\;-t_0\\ \mathbf{elif}\;F \leq 14500000:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{B} - t_0\\ \end{array} \]
Alternative 14
Accuracy63.9%
Cost7896
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ t_1 := \frac{x}{\tan B}\\ t_2 := -t_1\\ \mathbf{if}\;F \leq -1.4 \cdot 10^{+201}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{+104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{+95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -9.4 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-68}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{B} - t_1\\ \end{array} \]
Alternative 15
Accuracy65.2%
Cost7768
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ t_1 := -\frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.7 \cdot 10^{+203}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{+103}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -8 \cdot 10^{+95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -9.4 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-12}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + x \cdot \frac{-1}{B}\\ \end{array} \]
Alternative 16
Accuracy58.3%
Cost7581
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ t_1 := -\frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.4 \cdot 10^{+200}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1 \cdot 10^{+104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -8 \cdot 10^{+95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -9.4 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-12} \lor \neg \left(F \leq 1.02 \cdot 10^{+169}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 17
Accuracy43.4%
Cost7120
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ \mathbf{if}\;F \leq -1.72 \cdot 10^{+115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -3.4 \cdot 10^{-63}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-83}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 18
Accuracy44.0%
Cost6988
\[\begin{array}{l} t_0 := \frac{-1}{\sin B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{+113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -7.8 \cdot 10^{-62}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-106}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
Alternative 19
Accuracy43.6%
Cost904
\[\begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-106}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
Alternative 20
Accuracy43.6%
Cost840
\[\begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-106}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
Alternative 21
Accuracy43.8%
Cost584
\[\begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 22
Accuracy30.6%
Cost521
\[\begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-83} \lor \neg \left(x \leq 4.5 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]
Alternative 23
Accuracy36.7%
Cost452
\[\begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 24
Accuracy10.7%
Cost192
\[\frac{-1}{B} \]

Reproduce?

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