Average Error: 14.1 → 0.2
Time: 45.5s
Precision: binary64
Cost: 20616
\[\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 -16000000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -16000000000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 6.2e+14)
       (- (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) t_0)
       (- (/ 1.0 (sin B)) (/ x (/ (sin B) (cos B))))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -16000000000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 6.2e+14) {
		tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - (x / (sin(B) / cos(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-16000000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 6.2d+14) then
        tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - t_0
    else
        tmp = (1.0d0 / sin(b)) - (x / (sin(b) / cos(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -16000000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 6.2e+14) {
		tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / (Math.sin(B) / Math.cos(B)));
	}
	return tmp;
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -16000000000000.0:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 6.2e+14:
		tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0
	else:
		tmp = (1.0 / math.sin(B)) - (x / (math.sin(B) / math.cos(B)))
	return tmp
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -16000000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 6.2e+14)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / Float64(sin(B) / cos(B))));
	end
	return tmp
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -16000000000000.0)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 6.2e+14)
		tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - t_0;
	else
		tmp = (1.0 / sin(B)) - (x / (sin(B) / cos(B)));
	end
	tmp_2 = 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, -16000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.2e+14], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -16000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 6.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - t_0\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

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

    1. Initial program 26.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. Simplified26.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
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (fma.f64 F F 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x 2) (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 x)) (+.f64 (*.f64 F F) 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.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 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.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 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (neg.f64 x) 1)) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= associate-*r/_binary64 (*.f64 (neg.f64 x) (/.f64 1 (tan.f64 B))))): 29 points increase in error, 11 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= distribute-lft-neg-in_binary64 (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)))))): 0 points increase in error, 0 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.2

      \[\leadsto \color{blue}{-1 \cdot \frac{\cos B \cdot x}{\sin B} - \frac{1}{\sin B}} \]
    4. Applied egg-rr0.2

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

    if -1.6e13 < F < 6.2e14

    1. Initial program 0.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. Applied egg-rr0.3

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

    if 6.2e14 < F

    1. Initial program 26.2

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

      \[\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
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (fma.f64 F F 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (fma.f64 x 2 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x 2) (+.f64 (*.f64 F F) 2))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 x)) (+.f64 (*.f64 F F) 2)) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x))) -1/2) (/.f64 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.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 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.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 (neg.f64 x) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (neg.f64 x) 1)) (tan.f64 B))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= associate-*r/_binary64 (*.f64 (neg.f64 x) (/.f64 1 (tan.f64 B))))): 29 points increase in error, 11 points decrease in error
      (fma.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))) (Rewrite<= distribute-lft-neg-in_binary64 (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)))))): 0 points increase in error, 0 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.2

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}} \]
      Proof
      (-.f64 (/.f64 1 (sin.f64 B)) (/.f64 x (/.f64 (sin.f64 B) (cos.f64 B)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (/.f64 1 (sin.f64 B)) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 x (cos.f64 B)) (sin.f64 B)))): 12 points increase in error, 9 points decrease in error
      (-.f64 (/.f64 1 (sin.f64 B)) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (cos.f64 B) x)) (sin.f64 B))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 (/.f64 1 (sin.f64 B)) (neg.f64 (/.f64 (*.f64 (cos.f64 B) x) (sin.f64 B))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 1 (sin.f64 B)) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 (cos.f64 B) x) (sin.f64 B))))): 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 -16000000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]

Alternatives

Alternative 1
Error1.3
Cost20424
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.00078:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
Alternative 2
Error5.9
Cost20040
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
Alternative 3
Error0.7
Cost20040
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
Alternative 4
Error9.7
Cost14028
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t_0\\ \mathbf{elif}\;F \leq 2.357214188000263 \cdot 10^{+223}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{1}{F}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 5
Error9.9
Cost13900
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t_0\\ \mathbf{elif}\;F \leq 2.357214188000263 \cdot 10^{+223}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 6
Error24.6
Cost13712
\[\begin{array}{l} t_0 := \left(-x\right) \cdot \frac{\cos B}{\sin B}\\ t_1 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.659541374002375 \cdot 10^{+193}:\\ \;\;\;\;-1 + \left(1 - t_1\right)\\ \mathbf{elif}\;F \leq -2.53930457330983 \cdot 10^{+132}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.8 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 10^{-29}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error24.6
Cost13712
\[\begin{array}{l} t_0 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.659541374002375 \cdot 10^{+193}:\\ \;\;\;\;-1 + \left(1 - t_0\right)\\ \mathbf{elif}\;F \leq -2.53930457330983 \cdot 10^{+132}:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq -1.8 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 10^{-29}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error11.9
Cost13640
\[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t_0\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 9
Error16.6
Cost13448
\[\begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-30}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-29}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 10
Error30.1
Cost8152
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := t_0 + \frac{1}{B}\\ t_2 := \frac{1}{\sin B}\\ t_3 := \frac{F \cdot \sqrt{0.5}}{B} - x \cdot \left(\frac{1}{B} + B \cdot -0.3333333333333333\right)\\ \mathbf{if}\;F \leq -1.659541374002375 \cdot 10^{+193}:\\ \;\;\;\;-1 + \left(1 - t_2\right)\\ \mathbf{elif}\;F \leq -2.53930457330983 \cdot 10^{+132}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-191}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-288}:\\ \;\;\;\;t_0 + \frac{1}{F} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-199}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 11
Error30.0
Cost8152
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := t_0 + \frac{1}{B}\\ t_2 := \frac{1}{\sin B}\\ t_3 := \frac{F \cdot \sqrt{0.5}}{B} + \left(\left(x \cdot B\right) \cdot 0.3333333333333333 - \frac{x}{B}\right)\\ \mathbf{if}\;F \leq -1.659541374002375 \cdot 10^{+193}:\\ \;\;\;\;-1 + \left(1 - t_2\right)\\ \mathbf{elif}\;F \leq -2.53930457330983 \cdot 10^{+132}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-191}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-288}:\\ \;\;\;\;t_0 + \frac{1}{F} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-199}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error30.0
Cost7900
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := t_0 + \frac{1}{B}\\ t_2 := \frac{1}{\sin B}\\ t_3 := \frac{F \cdot \sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -1.659541374002375 \cdot 10^{+193}:\\ \;\;\;\;-1 + \left(1 - t_2\right)\\ \mathbf{elif}\;F \leq -2.53930457330983 \cdot 10^{+132}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-191}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-288}:\\ \;\;\;\;t_0 + \frac{1}{F} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-199}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error30.0
Cost7900
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := t_0 + \frac{1}{B}\\ t_2 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.659541374002375 \cdot 10^{+193}:\\ \;\;\;\;-1 + \left(1 - t_2\right)\\ \mathbf{elif}\;F \leq -2.53930457330983 \cdot 10^{+132}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-191}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-288}:\\ \;\;\;\;t_0 + \frac{1}{F} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-199}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error30.7
Cost7636
\[\begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ t_1 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.659541374002375 \cdot 10^{+193}:\\ \;\;\;\;-1 + \left(1 - t_1\right)\\ \mathbf{elif}\;F \leq -2.53930457330983 \cdot 10^{+132}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-199}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.0350860161071949 \cdot 10^{+210}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error30.5
Cost7240
\[\begin{array}{l} t_0 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.7 \cdot 10^{-20}:\\ \;\;\;\;-1 + \left(1 - t_0\right)\\ \mathbf{elif}\;F \leq 0.00078:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{x}{B}\\ \end{array} \]
Alternative 16
Error35.0
Cost7112
\[\begin{array}{l} t_0 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.55 \cdot 10^{-32}:\\ \;\;\;\;-1 + \left(1 - t_0\right)\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{x}{B}\\ \end{array} \]
Alternative 17
Error34.9
Cost6980
\[\begin{array}{l} t_0 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.55 \cdot 10^{-32}:\\ \;\;\;\;-1 + \left(1 - t_0\right)\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{-27}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error37.6
Cost6856
\[\begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{-27}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 19
Error34.9
Cost6856
\[\begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{-27}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 20
Error40.2
Cost968
\[\begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \]
Alternative 21
Error42.6
Cost584
\[\begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-46}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 10^{-29}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 22
Error40.3
Cost584
\[\begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 10^{-29}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
Alternative 23
Error47.8
Cost388
\[\begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-46}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
Alternative 24
Error57.0
Cost192
\[\frac{-1}{B} \]

Error

Reproduce

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