?

Average Error: 21.86% → 0.33%
Time: 28.5s
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 -115000:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;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} \]
(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 -115000.0)
     (- (/ (/ F (- (/ (- -1.0 x) F) F)) (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)
       (- (/ 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 <= -115000.0) {
		tmp = ((F / (((-1.0 - x) / F) - F)) / 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 = (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 <= -115000.0)
		tmp = Float64(Float64(Float64(F / Float64(Float64(Float64(-1.0 - x) / F) - F)) / sin(B)) - t_0);
	elseif (F <= 200000000.0)
		tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -115000.0], N[(N[(N[(F / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -115000:\\
\;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\

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

Error?

Derivation?

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

    1. Initial program 41.53

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      [Start]32

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

      pow-sqr [=>]31.88

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

      metadata-eval [=>]31.88

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

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\right)} - 1}}{\sin B} - \frac{x}{\tan B} \]
    7. Simplified31.84

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

      [Start]32.26

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

      expm1-def [=>]32.26

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

      expm1-log1p [=>]31.84

      \[ \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around -inf 0.22

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

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

      [Start]0.22

      \[ \frac{\frac{F}{-0.5 \cdot \frac{2 \cdot x + 2}{F} + -1 \cdot F}}{\sin B} - \frac{x}{\tan B} \]

      mul-1-neg [=>]0.22

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

      unsub-neg [=>]0.22

      \[ \frac{\frac{F}{\color{blue}{-0.5 \cdot \frac{2 \cdot x + 2}{F} - F}}}{\sin B} - \frac{x}{\tan B} \]

      +-commutative [=>]0.22

      \[ \frac{\frac{F}{-0.5 \cdot \frac{\color{blue}{2 + 2 \cdot x}}{F} - F}}{\sin B} - \frac{x}{\tan B} \]

      associate-*r/ [=>]0.22

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

      distribute-lft-in [=>]0.22

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

      metadata-eval [=>]0.22

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

      associate-*r* [=>]0.22

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

      metadata-eval [=>]0.22

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

      mul-1-neg [=>]0.22

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

    if -115000 < F < 2e8

    1. Initial program 0.65

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e8 < F

    1. Initial program 38.59

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.33

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -115000:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;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}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternatives

Alternative 1
Error0.87%
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := 2 + x \cdot 2\\ \mathbf{if}\;F \leq -0.92:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.95:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{t_1}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + 0.5 \cdot \frac{t_1}{F}}}{\sin B} - t_0\\ \end{array} \]
Alternative 2
Error0.87%
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := 2 + x \cdot 2\\ \mathbf{if}\;F \leq -1.02:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.95:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_1}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + 0.5 \cdot \frac{t_1}{F}}}{\sin B} - t_0\\ \end{array} \]
Alternative 3
Error0.87%
Cost20296
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := 2 + x \cdot 2\\ \mathbf{if}\;F \leq -1:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.95:\\ \;\;\;\;\frac{\frac{F}{\sqrt{t_1}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + 0.5 \cdot \frac{t_1}{F}}}{\sin B} - t_0\\ \end{array} \]
Alternative 4
Error13.01%
Cost14545
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.36 \cdot 10^{-47}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{-115} \lor \neg \left(F \leq 2.4 \cdot 10^{-78}\right) \land F \leq 3:\\ \;\;\;\;{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}}{\sin B} - t_0\\ \end{array} \]
Alternative 5
Error9.19%
Cost14344
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4600000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 2.5:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot {\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}}{\sin B} - t_0\\ \end{array} \]
Alternative 6
Error16.4%
Cost14148
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq 10^{-164}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}}{\sin B} - t_0\\ \end{array} \]
Alternative 7
Error17.12%
Cost13892
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq 6.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1 - x}{F} - F}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 8
Error17.42%
Cost13512
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-78}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \]
Alternative 9
Error40.6%
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 9.5:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{elif}\;F \leq 1.96 \cdot 10^{+177}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
Alternative 10
Error40.6%
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5.4:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{+177}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
Alternative 11
Error29.1%
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.6:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{+177}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
Alternative 12
Error50.25%
Cost7892
\[\begin{array}{l} t_0 := \frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-285}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-267}:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.28 \cdot 10^{+39}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+177}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
Alternative 13
Error50.22%
Cost7764
\[\begin{array}{l} t_0 := \frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-285}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-267}:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{+37}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{+177}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
Alternative 14
Error52.96%
Cost7640
\[\begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_1 := \frac{1 - x}{B}\\ \mathbf{if}\;B \leq -2.8 \cdot 10^{+89}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.25 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;B \leq -1.5 \cdot 10^{-51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -3 \cdot 10^{-237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.08 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;B \leq 8.5 \cdot 10^{-35}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 15
Error52.13%
Cost7632
\[\begin{array}{l} t_0 := \frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-285}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-267}:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+52}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 16
Error57.33%
Cost6920
\[\begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 3.1:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 17
Error58.66%
Cost6724
\[\begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-98}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 18
Error62.58%
Cost584
\[\begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-98}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 19
Error76.16%
Cost521
\[\begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-125} \lor \neg \left(x \leq 1.4 \cdot 10^{-58}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
Alternative 20
Error70.4%
Cost452
\[\begin{array}{l} \mathbf{if}\;F \leq 6.1 \cdot 10^{-99}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 21
Error89.19%
Cost192
\[\frac{1}{B} \]

Error

Reproduce?

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