VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.5% → 99.5%
Time: 7.1s
Alternatives: 25
Speedup: 1.4×

Specification

?
\[\begin{array}{l} \\ \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)} \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))))))
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    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
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)));
}
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)))
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 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
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]
\begin{array}{l}

\\
\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)}
\end{array}

Local Percentage Accuracy vs ?

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.

Accuracy vs Speed?

Herbie found 25 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 77.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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)} \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))))))
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    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
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)));
}
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)))
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 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
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]
\begin{array}{l}

\\
\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)}
\end{array}

Alternative 1: 99.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.4 \cdot 10^{+66}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\left(-\frac{x \cdot 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)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.4e+66)
   (- (/ (fma (cos B) x 1.0) (sin B)))
   (if (<= F 100000000.0)
     (+
      (- (/ (* x 1.0) (tan B)))
      (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.4e+66) {
		tmp = -(fma(cos(B), x, 1.0) / sin(B));
	} else if (F <= 100000000.0) {
		tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.4e+66)
		tmp = Float64(-Float64(fma(cos(B), x, 1.0) / sin(B)));
	elseif (F <= 100000000.0)
		tmp = Float64(Float64(-Float64(Float64(x * 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)))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -3.4e+66], (-N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 100000000.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $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], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.4 \cdot 10^{+66}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\left(-\frac{x \cdot 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)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.4000000000000003e66

    1. Initial program 51.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      3. div-add-revN/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      4. lower-/.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      5. lower-+.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      6. *-commutativeN/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      7. lower-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      8. lower-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      9. lift-sin.f6499.8

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.8%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      2. lift-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      3. lift-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. +-commutativeN/A

        \[\leadsto -\frac{\cos B \cdot x + 1}{\sin B} \]
      5. lower-fma.f64N/A

        \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      6. lift-cos.f6499.8

        \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
    6. Applied rewrites99.8%

      \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]

    if -3.4000000000000003e66 < F < 1e8

    1. Initial program 99.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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

        \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
      3. lift-tan.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      4. associate-*r/N/A

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
      5. lower-/.f64N/A

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
      6. lower-*.f64N/A

        \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
      7. lift-tan.f6499.3

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]

    if 1e8 < F

    1. Initial program 58.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. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    3. Step-by-step derivation
      1. sub-divN/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6499.7

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 99.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.6 \cdot 10^{+57}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 130000000:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.6e+57)
   (- (/ (fma (cos B) x 1.0) (sin B)))
   (if (<= F 130000000.0)
     (+
      (- (* x (/ 1.0 (tan B))))
      (* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0)))))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.6e+57) {
		tmp = -(fma(cos(B), x, 1.0) / sin(B));
	} else if (F <= 130000000.0) {
		tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0))));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.6e+57)
		tmp = Float64(-Float64(fma(cos(B), x, 1.0) / sin(B)));
	elseif (F <= 130000000.0)
		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0)))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -3.6e+57], (-N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 130000000.0], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.6 \cdot 10^{+57}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 130000000:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.6000000000000002e57

    1. Initial program 52.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. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      3. div-add-revN/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      4. lower-/.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      5. lower-+.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      6. *-commutativeN/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      7. lower-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      8. lower-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      9. lift-sin.f6499.8

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.8%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      2. lift-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      3. lift-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. +-commutativeN/A

        \[\leadsto -\frac{\cos B \cdot x + 1}{\sin B} \]
      5. lower-fma.f64N/A

        \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      6. lift-cos.f6499.8

        \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
    6. Applied rewrites99.8%

      \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]

    if -3.6000000000000002e57 < F < 1.3e8

    1. Initial program 99.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. Taylor expanded in x around 0

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-sqrt.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
      2. lower-/.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
      3. +-commutativeN/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}} \]
      4. pow2N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}} \]
      5. lower-fma.f6499.3

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \]
    4. Applied rewrites99.3%

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

    if 1.3e8 < F

    1. Initial program 58.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. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    3. Step-by-step derivation
      1. sub-divN/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6499.7

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 99.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.35:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 0.051:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.35)
   (- (/ (fma (cos B) x 1.0) (sin B)))
   (if (<= F 0.051)
     (+ (- (* x (/ 1.0 (tan B)))) (/ (* F (sqrt 0.5)) (sin B)))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.35) {
		tmp = -(fma(cos(B), x, 1.0) / sin(B));
	} else if (F <= 0.051) {
		tmp = -(x * (1.0 / tan(B))) + ((F * sqrt(0.5)) / sin(B));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.35)
		tmp = Float64(-Float64(fma(cos(B), x, 1.0) / sin(B)));
	elseif (F <= 0.051)
		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * sqrt(0.5)) / sin(B)));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -1.35], (-N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.051], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 0.051:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.3500000000000001

    1. Initial program 60.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      3. div-add-revN/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      4. lower-/.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      5. lower-+.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      6. *-commutativeN/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      7. lower-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      8. lower-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      9. lift-sin.f6499.4

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.4%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      2. lift-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      3. lift-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. +-commutativeN/A

        \[\leadsto -\frac{\cos B \cdot x + 1}{\sin B} \]
      5. lower-fma.f64N/A

        \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      6. lift-cos.f6499.4

        \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
    6. Applied rewrites99.4%

      \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]

    if -1.3500000000000001 < F < 0.0509999999999999967

    1. Initial program 99.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      4. lift-pow.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
      5. lift-*.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \]
      7. lift-*.f64N/A

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

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

        \[\leadsto \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(-\color{blue}{\frac{1}{2}}\right)} \]
      10. lift-neg.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
      11. associate-*l/N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
      12. lower-/.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
    3. Applied rewrites99.5%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2 + {F}^{2}}}}}{\sin B} \]
      3. metadata-evalN/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2} + {F}^{2}}}}{\sin B} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. lower-/.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      6. +-commutativeN/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B} \]
      7. pow2N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}}}{\sin B} \]
      8. lift-fma.f6499.4

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
    6. Applied rewrites99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    7. Taylor expanded in F around 0

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B} \]
    8. Step-by-step derivation
      1. Applied rewrites98.9%

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

      if 0.0509999999999999967 < F

      1. Initial program 59.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. Taylor expanded in F around inf

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      3. Step-by-step derivation
        1. sub-divN/A

          \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
        2. lower-/.f64N/A

          \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        6. lower-cos.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        7. lift-sin.f6498.9

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      4. Applied rewrites98.9%

        \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
    9. Recombined 3 regimes into one program.
    10. Add Preprocessing

    Alternative 4: 91.2% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -1.4e-24)
       (- (/ (fma (cos B) x 1.0) (sin B)))
       (if (<= F 7e-12)
         (+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))))
         (/ (- 1.0 (* (cos B) x)) (sin B)))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -1.4e-24) {
    		tmp = -(fma(cos(B), x, 1.0) / sin(B));
    	} else if (F <= 7e-12) {
    		tmp = (-x / tan(B)) + ((F / B) * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))));
    	} else {
    		tmp = (1.0 - (cos(B) * x)) / sin(B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -1.4e-24)
    		tmp = Float64(-Float64(fma(cos(B), x, 1.0) / sin(B)));
    	elseif (F <= 7e-12)
    		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))));
    	else
    		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -1.4e-24], (-N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 7e-12], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\
    \;\;\;\;-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
    
    \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\
    \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -1.4000000000000001e-24

      1. Initial program 62.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. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      3. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
        2. lower-neg.f64N/A

          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
        3. div-add-revN/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        4. lower-/.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        5. lower-+.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        6. *-commutativeN/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        7. lower-*.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        8. lower-cos.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        9. lift-sin.f6495.7

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. Applied rewrites95.7%

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
      5. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        2. lift-*.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        3. lift-cos.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        4. +-commutativeN/A

          \[\leadsto -\frac{\cos B \cdot x + 1}{\sin B} \]
        5. lower-fma.f64N/A

          \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
        6. lift-cos.f6495.7

          \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      6. Applied rewrites95.7%

        \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]

      if -1.4000000000000001e-24 < F < 7.0000000000000001e-12

      1. Initial program 99.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. Taylor expanded in B around 0

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        2. lower-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
        4. lower-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
        5. +-commutativeN/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
        6. lower-+.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
        7. +-commutativeN/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
        8. pow2N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
        9. lower-fma.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
        10. count-2-revN/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        11. lower-+.f6483.6

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
      4. Applied rewrites83.6%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
      5. Step-by-step derivation
        1. lift-neg.f64N/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        2. lift-*.f64N/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        3. lift-/.f64N/A

          \[\leadsto \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        4. lift-tan.f64N/A

          \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        5. associate-*r/N/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        6. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        7. *-rgt-identityN/A

          \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        8. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        9. lower-neg.f64N/A

          \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        10. lift-tan.f6483.7

          \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        11. lift-sqrt.f64N/A

          \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        12. lift-/.f64N/A

          \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        13. lift-+.f64N/A

          \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        14. lift-+.f64N/A

          \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        15. lift-fma.f64N/A

          \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \]
      6. Applied rewrites83.7%

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

      if 7.0000000000000001e-12 < F

      1. Initial program 60.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. Taylor expanded in F around inf

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      3. Step-by-step derivation
        1. sub-divN/A

          \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
        2. lower-/.f64N/A

          \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        6. lower-cos.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        7. lift-sin.f6497.5

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      4. Applied rewrites97.5%

        \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 5: 85.6% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -2.7e+42)
       (- (/ (+ 1.0 x) (sin B)))
       (if (<= F 7e-12)
         (+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))))
         (/ (- 1.0 (* (cos B) x)) (sin B)))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -2.7e+42) {
    		tmp = -((1.0 + x) / sin(B));
    	} else if (F <= 7e-12) {
    		tmp = (-x / tan(B)) + ((F / B) * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))));
    	} else {
    		tmp = (1.0 - (cos(B) * x)) / sin(B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -2.7e+42)
    		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
    	elseif (F <= 7e-12)
    		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))));
    	else
    		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -2.7e+42], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 7e-12], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\
    \;\;\;\;-\frac{1 + x}{\sin B}\\
    
    \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\
    \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -2.7000000000000001e42

      1. Initial program 55.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. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      3. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
        2. lower-neg.f64N/A

          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
        3. div-add-revN/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        4. lower-/.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        5. lower-+.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        6. *-commutativeN/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        7. lower-*.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        8. lower-cos.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        9. lift-sin.f6499.8

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. Applied rewrites99.8%

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
      5. Taylor expanded in B around 0

        \[\leadsto -\frac{1 + x}{\sin B} \]
      6. Step-by-step derivation
        1. Applied rewrites77.9%

          \[\leadsto -\frac{1 + x}{\sin B} \]

        if -2.7000000000000001e42 < F < 7.0000000000000001e-12

        1. Initial program 99.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. Taylor expanded in B around 0

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          2. lower-/.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
          4. lower-/.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
          5. +-commutativeN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
          6. lower-+.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
          7. +-commutativeN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
          8. pow2N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
          9. lower-fma.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
          10. count-2-revN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          11. lower-+.f6482.1

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        4. Applied rewrites82.1%

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
        5. Step-by-step derivation
          1. lift-neg.f64N/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          2. lift-*.f64N/A

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          3. lift-/.f64N/A

            \[\leadsto \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          4. lift-tan.f64N/A

            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          5. associate-*r/N/A

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          6. distribute-neg-fracN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          7. *-rgt-identityN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          9. lower-neg.f64N/A

            \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          10. lift-tan.f6482.2

            \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          11. lift-sqrt.f64N/A

            \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          12. lift-/.f64N/A

            \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          13. lift-+.f64N/A

            \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          14. lift-+.f64N/A

            \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          15. lift-fma.f64N/A

            \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \]
        6. Applied rewrites82.2%

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

        if 7.0000000000000001e-12 < F

        1. Initial program 60.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. Taylor expanded in F around inf

          \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
        3. Step-by-step derivation
          1. sub-divN/A

            \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
          2. lower-/.f64N/A

            \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
          3. lower--.f64N/A

            \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
          4. *-commutativeN/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          6. lower-cos.f64N/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          7. lift-sin.f6497.5

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        4. Applied rewrites97.5%

          \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
      7. Recombined 3 regimes into one program.
      8. Add Preprocessing

      Alternative 6: 76.5% accurate, 1.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-31}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{+132}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (if (<= F -2.7e+42)
         (- (/ (+ 1.0 x) (sin B)))
         (if (<= F 4.5e-31)
           (+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))))
           (if (<= F 7.6e+132)
             (+ (- (/ x B)) (/ (* F (sqrt (/ 1.0 (fma F F 2.0)))) (sin B)))
             (- (/ (* (cos B) x) (sin B)))))))
      double code(double F, double B, double x) {
      	double tmp;
      	if (F <= -2.7e+42) {
      		tmp = -((1.0 + x) / sin(B));
      	} else if (F <= 4.5e-31) {
      		tmp = (-x / tan(B)) + ((F / B) * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))));
      	} else if (F <= 7.6e+132) {
      		tmp = -(x / B) + ((F * sqrt((1.0 / fma(F, F, 2.0)))) / sin(B));
      	} else {
      		tmp = -((cos(B) * x) / sin(B));
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	tmp = 0.0
      	if (F <= -2.7e+42)
      		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
      	elseif (F <= 4.5e-31)
      		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))));
      	elseif (F <= 7.6e+132)
      		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * sqrt(Float64(1.0 / fma(F, F, 2.0)))) / sin(B)));
      	else
      		tmp = Float64(-Float64(Float64(cos(B) * x) / sin(B)));
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := If[LessEqual[F, -2.7e+42], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.5e-31], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.6e+132], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\
      \;\;\;\;-\frac{1 + x}{\sin B}\\
      
      \mathbf{elif}\;F \leq 4.5 \cdot 10^{-31}:\\
      \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
      
      \mathbf{elif}\;F \leq 7.6 \cdot 10^{+132}:\\
      \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\
      
      \mathbf{else}:\\
      \;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if F < -2.7000000000000001e42

        1. Initial program 55.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. Taylor expanded in F around -inf

          \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
        3. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
          2. lower-neg.f64N/A

            \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
          3. div-add-revN/A

            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
          4. lower-/.f64N/A

            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
          5. lower-+.f64N/A

            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
          6. *-commutativeN/A

            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
          7. lower-*.f64N/A

            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
          8. lower-cos.f64N/A

            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
          9. lift-sin.f6499.8

            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        4. Applied rewrites99.8%

          \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
        5. Taylor expanded in B around 0

          \[\leadsto -\frac{1 + x}{\sin B} \]
        6. Step-by-step derivation
          1. Applied rewrites77.9%

            \[\leadsto -\frac{1 + x}{\sin B} \]

          if -2.7000000000000001e42 < F < 4.5000000000000004e-31

          1. Initial program 99.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. Taylor expanded in B around 0

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
            2. lower-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
            3. lower-sqrt.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
            4. lower-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
            5. +-commutativeN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
            6. lower-+.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
            7. +-commutativeN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
            8. pow2N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
            9. lower-fma.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
            10. count-2-revN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            11. lower-+.f6482.3

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
          4. Applied rewrites82.3%

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
          5. Step-by-step derivation
            1. lift-neg.f64N/A

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            2. lift-*.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            3. lift-/.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            4. lift-tan.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            5. associate-*r/N/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            6. distribute-neg-fracN/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            7. *-rgt-identityN/A

              \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            8. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            9. lower-neg.f64N/A

              \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            10. lift-tan.f6482.4

              \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            11. lift-sqrt.f64N/A

              \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            12. lift-/.f64N/A

              \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            13. lift-+.f64N/A

              \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            14. lift-+.f64N/A

              \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            15. lift-fma.f64N/A

              \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \]
          6. Applied rewrites82.3%

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

          if 4.5000000000000004e-31 < F < 7.60000000000000012e132

          1. Initial program 92.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. Step-by-step derivation
            1. lift-*.f64N/A

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            4. lift-pow.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
            5. lift-*.f64N/A

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \]
            7. lift-*.f64N/A

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

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

              \[\leadsto \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(-\color{blue}{\frac{1}{2}}\right)} \]
            10. lift-neg.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
            11. associate-*l/N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
            12. lower-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
          3. Applied rewrites99.5%

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
          5. Step-by-step derivation
            1. +-commutativeN/A

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2 + {F}^{2}}}}}{\sin B} \]
            3. metadata-evalN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2} + {F}^{2}}}}{\sin B} \]
            4. lower-sqrt.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
            5. lower-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
            6. +-commutativeN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B} \]
            7. pow2N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}}}{\sin B} \]
            8. lift-fma.f6499.5

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
          6. Applied rewrites99.5%

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
          7. Taylor expanded in B around 0

            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
          8. Step-by-step derivation
            1. lower-/.f6478.3

              \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
          9. Applied rewrites78.3%

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

          if 7.60000000000000012e132 < F

          1. Initial program 38.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. Taylor expanded in F around 0

            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
          3. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
            2. lower-neg.f64N/A

              \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
            3. lower-/.f64N/A

              \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
            4. *-commutativeN/A

              \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
            5. lower-*.f64N/A

              \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
            6. lower-cos.f64N/A

              \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
            7. lift-sin.f6449.5

              \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
          4. Applied rewrites49.5%

            \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
        7. Recombined 4 regimes into one program.
        8. Add Preprocessing

        Alternative 7: 75.1% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-31}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{+132}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (if (<= F -2.7e+42)
           (- (/ (+ 1.0 x) (sin B)))
           (if (<= F 4.5e-31)
             (+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))))
             (if (<= F 7.6e+132)
               (+ (- (/ x B)) (/ (* F (sqrt (/ 1.0 (fma F F 2.0)))) (sin B)))
               (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))))
        double code(double F, double B, double x) {
        	double tmp;
        	if (F <= -2.7e+42) {
        		tmp = -((1.0 + x) / sin(B));
        	} else if (F <= 4.5e-31) {
        		tmp = (-x / tan(B)) + ((F / B) * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))));
        	} else if (F <= 7.6e+132) {
        		tmp = -(x / B) + ((F * sqrt((1.0 / fma(F, F, 2.0)))) / sin(B));
        	} else {
        		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	tmp = 0.0
        	if (F <= -2.7e+42)
        		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
        	elseif (F <= 4.5e-31)
        		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))));
        	elseif (F <= 7.6e+132)
        		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * sqrt(Float64(1.0 / fma(F, F, 2.0)))) / sin(B)));
        	else
        		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B));
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := If[LessEqual[F, -2.7e+42], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.5e-31], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.6e+132], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\
        \;\;\;\;-\frac{1 + x}{\sin B}\\
        
        \mathbf{elif}\;F \leq 4.5 \cdot 10^{-31}:\\
        \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
        
        \mathbf{elif}\;F \leq 7.6 \cdot 10^{+132}:\\
        \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if F < -2.7000000000000001e42

          1. Initial program 55.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. Taylor expanded in F around -inf

            \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
          3. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
            2. lower-neg.f64N/A

              \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
            3. div-add-revN/A

              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
            4. lower-/.f64N/A

              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
            5. lower-+.f64N/A

              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
            6. *-commutativeN/A

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
            7. lower-*.f64N/A

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
            8. lower-cos.f64N/A

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
            9. lift-sin.f6499.8

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
          4. Applied rewrites99.8%

            \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
          5. Taylor expanded in B around 0

            \[\leadsto -\frac{1 + x}{\sin B} \]
          6. Step-by-step derivation
            1. Applied rewrites77.9%

              \[\leadsto -\frac{1 + x}{\sin B} \]

            if -2.7000000000000001e42 < F < 4.5000000000000004e-31

            1. Initial program 99.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. Taylor expanded in B around 0

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              2. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
              4. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
              5. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
              6. lower-+.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
              7. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
              8. pow2N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
              9. lower-fma.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
              10. count-2-revN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              11. lower-+.f6482.3

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            4. Applied rewrites82.3%

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
            5. Step-by-step derivation
              1. lift-neg.f64N/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              2. lift-*.f64N/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              3. lift-/.f64N/A

                \[\leadsto \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              4. lift-tan.f64N/A

                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              5. associate-*r/N/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              6. distribute-neg-fracN/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              7. *-rgt-identityN/A

                \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              8. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              9. lower-neg.f64N/A

                \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              10. lift-tan.f6482.4

                \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              11. lift-sqrt.f64N/A

                \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              12. lift-/.f64N/A

                \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              13. lift-+.f64N/A

                \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              14. lift-+.f64N/A

                \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              15. lift-fma.f64N/A

                \[\leadsto \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \]
            6. Applied rewrites82.3%

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

            if 4.5000000000000004e-31 < F < 7.60000000000000012e132

            1. Initial program 92.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. Step-by-step derivation
              1. lift-*.f64N/A

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              4. lift-pow.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
              5. lift-*.f64N/A

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \]
              7. lift-*.f64N/A

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

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

                \[\leadsto \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(-\color{blue}{\frac{1}{2}}\right)} \]
              10. lift-neg.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
              11. associate-*l/N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
              12. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
            3. Applied rewrites99.5%

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
            5. Step-by-step derivation
              1. +-commutativeN/A

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2 + {F}^{2}}}}}{\sin B} \]
              3. metadata-evalN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2} + {F}^{2}}}}{\sin B} \]
              4. lower-sqrt.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
              5. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
              6. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B} \]
              7. pow2N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}}}{\sin B} \]
              8. lift-fma.f6499.5

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
            6. Applied rewrites99.5%

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
            7. Taylor expanded in B around 0

              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
            8. Step-by-step derivation
              1. lower-/.f6478.3

                \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
            9. Applied rewrites78.3%

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

            if 7.60000000000000012e132 < F

            1. Initial program 38.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. Taylor expanded in B around 0

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              2. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
              4. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
              5. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
              6. lower-+.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
              7. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
              8. pow2N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
              9. lower-fma.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
              10. count-2-revN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              11. lower-+.f6434.9

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
            4. Applied rewrites34.9%

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
            5. Taylor expanded in F around -inf

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
            6. Step-by-step derivation
              1. lower-/.f6448.9

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
            7. Applied rewrites48.9%

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
          7. Recombined 4 regimes into one program.
          8. Add Preprocessing

          Alternative 8: 75.0% accurate, 1.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-31}:\\ \;\;\;\;t\_0 + \frac{F}{B} \cdot t\_1\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{+132}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot t\_1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{-1}{B}\\ \end{array} \end{array} \]
          (FPCore (F B x)
           :precision binary64
           (let* ((t_0 (- (* x (/ 1.0 (tan B))))) (t_1 (sqrt (/ 1.0 (fma F F 2.0)))))
             (if (<= F -2.7e+42)
               (- (/ (+ 1.0 x) (sin B)))
               (if (<= F 4.5e-31)
                 (+ t_0 (* (/ F B) t_1))
                 (if (<= F 7.6e+132)
                   (+ (- (/ x B)) (/ (* F t_1) (sin B)))
                   (+ t_0 (/ -1.0 B)))))))
          double code(double F, double B, double x) {
          	double t_0 = -(x * (1.0 / tan(B)));
          	double t_1 = sqrt((1.0 / fma(F, F, 2.0)));
          	double tmp;
          	if (F <= -2.7e+42) {
          		tmp = -((1.0 + x) / sin(B));
          	} else if (F <= 4.5e-31) {
          		tmp = t_0 + ((F / B) * t_1);
          	} else if (F <= 7.6e+132) {
          		tmp = -(x / B) + ((F * t_1) / sin(B));
          	} else {
          		tmp = t_0 + (-1.0 / B);
          	}
          	return tmp;
          }
          
          function code(F, B, x)
          	t_0 = Float64(-Float64(x * Float64(1.0 / tan(B))))
          	t_1 = sqrt(Float64(1.0 / fma(F, F, 2.0)))
          	tmp = 0.0
          	if (F <= -2.7e+42)
          		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
          	elseif (F <= 4.5e-31)
          		tmp = Float64(t_0 + Float64(Float64(F / B) * t_1));
          	elseif (F <= 7.6e+132)
          		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * t_1) / sin(B)));
          	else
          		tmp = Float64(t_0 + Float64(-1.0 / B));
          	end
          	return tmp
          end
          
          code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -2.7e+42], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.5e-31], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.6e+132], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := -x \cdot \frac{1}{\tan B}\\
          t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
          \mathbf{if}\;F \leq -2.7 \cdot 10^{+42}:\\
          \;\;\;\;-\frac{1 + x}{\sin B}\\
          
          \mathbf{elif}\;F \leq 4.5 \cdot 10^{-31}:\\
          \;\;\;\;t\_0 + \frac{F}{B} \cdot t\_1\\
          
          \mathbf{elif}\;F \leq 7.6 \cdot 10^{+132}:\\
          \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot t\_1}{\sin B}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0 + \frac{-1}{B}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if F < -2.7000000000000001e42

            1. Initial program 55.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. Taylor expanded in F around -inf

              \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
            3. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
              2. lower-neg.f64N/A

                \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
              3. div-add-revN/A

                \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
              4. lower-/.f64N/A

                \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
              5. lower-+.f64N/A

                \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
              6. *-commutativeN/A

                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
              7. lower-*.f64N/A

                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
              8. lower-cos.f64N/A

                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
              9. lift-sin.f6499.8

                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
            4. Applied rewrites99.8%

              \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
            5. Taylor expanded in B around 0

              \[\leadsto -\frac{1 + x}{\sin B} \]
            6. Step-by-step derivation
              1. Applied rewrites77.9%

                \[\leadsto -\frac{1 + x}{\sin B} \]

              if -2.7000000000000001e42 < F < 4.5000000000000004e-31

              1. Initial program 99.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. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                4. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                5. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                6. lower-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                7. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
                8. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
                9. lower-fma.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
                10. count-2-revN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                11. lower-+.f6482.3

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              4. Applied rewrites82.3%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
              5. Taylor expanded in x around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                2. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}} \]
                3. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{F \cdot F + 2}} \]
                4. lift-fma.f6482.2

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \]
              7. Applied rewrites82.2%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \]

              if 4.5000000000000004e-31 < F < 7.60000000000000012e132

              1. Initial program 92.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. Step-by-step derivation
                1. lift-*.f64N/A

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                4. lift-pow.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                5. lift-*.f64N/A

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \]
                7. lift-*.f64N/A

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

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

                  \[\leadsto \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(-\color{blue}{\frac{1}{2}}\right)} \]
                10. lift-neg.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                11. associate-*l/N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
                12. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
              3. Applied rewrites99.5%

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
              5. Step-by-step derivation
                1. +-commutativeN/A

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2 + {F}^{2}}}}}{\sin B} \]
                3. metadata-evalN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2} + {F}^{2}}}}{\sin B} \]
                4. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
                5. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
                6. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B} \]
                7. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}}}{\sin B} \]
                8. lift-fma.f6499.5

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
              6. Applied rewrites99.5%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
              7. Taylor expanded in B around 0

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
              8. Step-by-step derivation
                1. lower-/.f6478.3

                  \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
              9. Applied rewrites78.3%

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

              if 7.60000000000000012e132 < F

              1. Initial program 38.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. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                4. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                5. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                6. lower-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                7. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
                8. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
                9. lower-fma.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
                10. count-2-revN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                11. lower-+.f6434.9

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              4. Applied rewrites34.9%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
              5. Taylor expanded in F around -inf

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
              6. Step-by-step derivation
                1. lower-/.f6448.9

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
              7. Applied rewrites48.9%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
            7. Recombined 4 regimes into one program.
            8. Add Preprocessing

            Alternative 9: 75.0% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \mathbf{if}\;x \leq -4.8 \cdot 10^{-10}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-10}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
               (if (<= x -4.8e-10)
                 t_0
                 (if (<= x 2.5e-10)
                   (+ (- (/ x B)) (/ (* F (sqrt (/ 1.0 (fma F F 2.0)))) (sin B)))
                   t_0))))
            double code(double F, double B, double x) {
            	double t_0 = -(x * (1.0 / tan(B))) + (-1.0 / B);
            	double tmp;
            	if (x <= -4.8e-10) {
            		tmp = t_0;
            	} else if (x <= 2.5e-10) {
            		tmp = -(x / B) + ((F * sqrt((1.0 / fma(F, F, 2.0)))) / sin(B));
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B))
            	tmp = 0.0
            	if (x <= -4.8e-10)
            		tmp = t_0;
            	elseif (x <= 2.5e-10)
            		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * sqrt(Float64(1.0 / fma(F, F, 2.0)))) / sin(B)));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e-10], t$95$0, If[LessEqual[x, 2.5e-10], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
            \mathbf{if}\;x \leq -4.8 \cdot 10^{-10}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;x \leq 2.5 \cdot 10^{-10}:\\
            \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -4.8e-10 or 2.50000000000000016e-10 < x

              1. Initial program 84.0%

                \[\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. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                4. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                5. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                6. lower-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                7. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
                8. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
                9. lower-fma.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
                10. count-2-revN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                11. lower-+.f6483.1

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              4. Applied rewrites83.1%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
              5. Taylor expanded in F around -inf

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
              6. Step-by-step derivation
                1. lower-/.f6495.5

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
              7. Applied rewrites95.5%

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

              if -4.8e-10 < x < 2.50000000000000016e-10

              1. Initial program 72.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. Step-by-step derivation
                1. lift-*.f64N/A

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                4. lift-pow.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                5. lift-*.f64N/A

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \]
                7. lift-*.f64N/A

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

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

                  \[\leadsto \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(-\color{blue}{\frac{1}{2}}\right)} \]
                10. lift-neg.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                11. associate-*l/N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
                12. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
              3. Applied rewrites75.7%

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
              5. Step-by-step derivation
                1. +-commutativeN/A

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2 + {F}^{2}}}}}{\sin B} \]
                3. metadata-evalN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\color{blue}{2} + {F}^{2}}}}{\sin B} \]
                4. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
                5. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
                6. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B} \]
                7. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}}}{\sin B} \]
                8. lift-fma.f6475.7

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
              6. Applied rewrites75.7%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
              7. Taylor expanded in B around 0

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
              8. Step-by-step derivation
                1. lower-/.f6462.9

                  \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
              9. Applied rewrites62.9%

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 10: 68.1% accurate, 1.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \mathbf{if}\;x \leq -2.75 \cdot 10^{-95}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-147}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;x \leq 1.95 \cdot 10^{-10}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
               (if (<= x -2.75e-95)
                 t_0
                 (if (<= x 2.1e-147)
                   (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
                   (if (<= x 1.95e-10)
                     (/ (- (* (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0))) F) x) B)
                     t_0)))))
            double code(double F, double B, double x) {
            	double t_0 = -(x * (1.0 / tan(B))) + (-1.0 / B);
            	double tmp;
            	if (x <= -2.75e-95) {
            		tmp = t_0;
            	} else if (x <= 2.1e-147) {
            		tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
            	} else if (x <= 1.95e-10) {
            		tmp = ((sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))) * F) - x) / B;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B))
            	tmp = 0.0
            	if (x <= -2.75e-95)
            		tmp = t_0;
            	elseif (x <= 2.1e-147)
            		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B)));
            	elseif (x <= 1.95e-10)
            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0))) * F) - x) / B);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.75e-95], t$95$0, If[LessEqual[x, 2.1e-147], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e-10], N[(N[(N[(N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], t$95$0]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
            \mathbf{if}\;x \leq -2.75 \cdot 10^{-95}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;x \leq 2.1 \cdot 10^{-147}:\\
            \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
            
            \mathbf{elif}\;x \leq 1.95 \cdot 10^{-10}:\\
            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if x < -2.75000000000000001e-95 or 1.95e-10 < x

              1. Initial program 81.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. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                4. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                5. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                6. lower-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                7. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
                8. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
                9. lower-fma.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
                10. count-2-revN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                11. lower-+.f6478.0

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
              4. Applied rewrites78.0%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
              5. Taylor expanded in F around -inf

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
              6. Step-by-step derivation
                1. lower-/.f6484.4

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
              7. Applied rewrites84.4%

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

              if -2.75000000000000001e-95 < x < 2.1e-147

              1. Initial program 73.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. Taylor expanded in x around 0

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                5. +-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                6. pow2N/A

                  \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                7. lower-fma.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                8. lift-sin.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                9. lift-/.f6457.1

                  \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
              4. Applied rewrites57.1%

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

              if 2.1e-147 < x < 1.95e-10

              1. Initial program 73.1%

                \[\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. Taylor expanded in B around 0

                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
              4. Applied rewrites35.9%

                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 11: 57.9% accurate, 1.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{-66}:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{+151}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (if (<= F -1.4e-24)
               (- (/ (+ 1.0 x) (sin B)))
               (if (<= F 7.4e-66)
                 (+
                  (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B)
                  (* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
                 (if (<= F 1.3e+151)
                   (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
                   (/ (- 1.0 x) B)))))
            double code(double F, double B, double x) {
            	double tmp;
            	if (F <= -1.4e-24) {
            		tmp = -((1.0 + x) / sin(B));
            	} else if (F <= 7.4e-66) {
            		tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
            	} else if (F <= 1.3e+151) {
            		tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
            	} else {
            		tmp = (1.0 - x) / B;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	tmp = 0.0
            	if (F <= -1.4e-24)
            		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
            	elseif (F <= 7.4e-66)
            		tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0)))));
            	elseif (F <= 1.3e+151)
            		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B)));
            	else
            		tmp = Float64(Float64(1.0 - x) / B);
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := If[LessEqual[F, -1.4e-24], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 7.4e-66], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e+151], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\
            \;\;\;\;-\frac{1 + x}{\sin B}\\
            
            \mathbf{elif}\;F \leq 7.4 \cdot 10^{-66}:\\
            \;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
            
            \mathbf{elif}\;F \leq 1.3 \cdot 10^{+151}:\\
            \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{1 - x}{B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if F < -1.4000000000000001e-24

              1. Initial program 62.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. Taylor expanded in F around -inf

                \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
              3. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                2. lower-neg.f64N/A

                  \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                3. div-add-revN/A

                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                4. lower-/.f64N/A

                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                5. lower-+.f64N/A

                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                6. *-commutativeN/A

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                7. lower-*.f64N/A

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                8. lower-cos.f64N/A

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                9. lift-sin.f6495.7

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
              4. Applied rewrites95.7%

                \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
              5. Taylor expanded in B around 0

                \[\leadsto -\frac{1 + x}{\sin B} \]
              6. Step-by-step derivation
                1. Applied rewrites74.8%

                  \[\leadsto -\frac{1 + x}{\sin B} \]

                if -1.4000000000000001e-24 < F < 7.4000000000000004e-66

                1. Initial program 99.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. Taylor expanded in B around 0

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                  2. lower-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                  4. lower-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                  5. +-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                  6. lower-+.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                  7. +-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
                  8. pow2N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
                  9. lower-fma.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
                  10. count-2-revN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                  11. lower-+.f6484.5

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                4. Applied rewrites84.5%

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
                5. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                6. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{\color{blue}{B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                  2. lower--.f64N/A

                    \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                  3. lower-*.f64N/A

                    \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                  5. unpow2N/A

                    \[\leadsto \frac{\frac{1}{3} \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                  6. lower-*.f6450.0

                    \[\leadsto \frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                7. Applied rewrites50.0%

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

                if 7.4000000000000004e-66 < F < 1.30000000000000007e151

                1. Initial program 92.8%

                  \[\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. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                3. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                  4. lower-/.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                  5. +-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                  6. pow2N/A

                    \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                  7. lower-fma.f64N/A

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                  8. lift-sin.f64N/A

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                  9. lift-/.f6454.3

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                4. Applied rewrites54.3%

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

                if 1.30000000000000007e151 < F

                1. Initial program 33.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. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                4. Applied rewrites26.7%

                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                5. Taylor expanded in F around inf

                  \[\leadsto \frac{1 - x}{B} \]
                6. Step-by-step derivation
                  1. Applied rewrites50.0%

                    \[\leadsto \frac{1 - x}{B} \]
                7. Recombined 4 regimes into one program.
                8. Add Preprocessing

                Alternative 12: 57.0% accurate, 2.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 106000000:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -1.4e-24)
                   (- (/ (+ 1.0 x) (sin B)))
                   (if (<= F 106000000.0)
                     (+
                      (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B)
                      (* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
                     (/ (- 1.0 x) B))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -1.4e-24) {
                		tmp = -((1.0 + x) / sin(B));
                	} else if (F <= 106000000.0) {
                		tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
                	} else {
                		tmp = (1.0 - x) / B;
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -1.4e-24)
                		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
                	elseif (F <= 106000000.0)
                		tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0)))));
                	else
                		tmp = Float64(Float64(1.0 - x) / B);
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -1.4e-24], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 106000000.0], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\
                \;\;\;\;-\frac{1 + x}{\sin B}\\
                
                \mathbf{elif}\;F \leq 106000000:\\
                \;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1 - x}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -1.4000000000000001e-24

                  1. Initial program 62.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. Taylor expanded in F around -inf

                    \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                  3. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                    2. lower-neg.f64N/A

                      \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                    3. div-add-revN/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    4. lower-/.f64N/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    5. lower-+.f64N/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    6. *-commutativeN/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    7. lower-*.f64N/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    8. lower-cos.f64N/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    9. lift-sin.f6495.7

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  4. Applied rewrites95.7%

                    \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                  5. Taylor expanded in B around 0

                    \[\leadsto -\frac{1 + x}{\sin B} \]
                  6. Step-by-step derivation
                    1. Applied rewrites74.8%

                      \[\leadsto -\frac{1 + x}{\sin B} \]

                    if -1.4000000000000001e-24 < F < 1.06e8

                    1. Initial program 99.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. Taylor expanded in B around 0

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                      2. lower-/.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                      3. lower-sqrt.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                      4. lower-/.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                      5. +-commutativeN/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                      6. lower-+.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                      7. +-commutativeN/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left({F}^{2} + 2 \cdot x\right) + 2}} \]
                      8. pow2N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(F \cdot F + 2 \cdot x\right) + 2}} \]
                      9. lower-fma.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2 \cdot x\right) + 2}} \]
                      10. count-2-revN/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                      11. lower-+.f6483.2

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                    4. Applied rewrites83.2%

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                    6. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{\color{blue}{B}} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                      2. lower--.f64N/A

                        \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                      3. lower-*.f64N/A

                        \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                      4. lower-*.f64N/A

                        \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                      5. unpow2N/A

                        \[\leadsto \frac{\frac{1}{3} \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                      6. lower-*.f6450.4

                        \[\leadsto \frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                    7. Applied rewrites50.4%

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

                    if 1.06e8 < F

                    1. Initial program 58.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. Taylor expanded in B around 0

                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                    4. Applied rewrites36.1%

                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                    5. Taylor expanded in F around inf

                      \[\leadsto \frac{1 - x}{B} \]
                    6. Step-by-step derivation
                      1. Applied rewrites49.0%

                        \[\leadsto \frac{1 - x}{B} \]
                    7. Recombined 3 regimes into one program.
                    8. Add Preprocessing

                    Alternative 13: 56.9% accurate, 2.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 0.051:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -1.4e-24)
                       (- (/ (+ 1.0 x) (sin B)))
                       (if (<= F 0.051)
                         (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                         (/ (- (- 1.0 (/ 1.0 (* F F))) x) B))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -1.4e-24) {
                    		tmp = -((1.0 + x) / sin(B));
                    	} else if (F <= 0.051) {
                    		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                    	} else {
                    		tmp = ((1.0 - (1.0 / (F * F))) - x) / B;
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -1.4e-24)
                    		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
                    	elseif (F <= 0.051)
                    		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B);
                    	else
                    		tmp = Float64(Float64(Float64(1.0 - Float64(1.0 / Float64(F * F))) - x) / B);
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -1.4e-24], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.051], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\
                    \;\;\;\;-\frac{1 + x}{\sin B}\\
                    
                    \mathbf{elif}\;F \leq 0.051:\\
                    \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -1.4000000000000001e-24

                      1. Initial program 62.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. Taylor expanded in F around -inf

                        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                      3. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                        2. lower-neg.f64N/A

                          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                        3. div-add-revN/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        4. lower-/.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        5. lower-+.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        6. *-commutativeN/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        7. lower-*.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        8. lower-cos.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        9. lift-sin.f6495.7

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      4. Applied rewrites95.7%

                        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                      5. Taylor expanded in B around 0

                        \[\leadsto -\frac{1 + x}{\sin B} \]
                      6. Step-by-step derivation
                        1. Applied rewrites74.8%

                          \[\leadsto -\frac{1 + x}{\sin B} \]

                        if -1.4000000000000001e-24 < F < 0.0509999999999999967

                        1. Initial program 99.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. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                        4. Applied rewrites50.6%

                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                        5. Taylor expanded in F around 0

                          \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                        6. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                          2. +-commutativeN/A

                            \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                          3. lower-fma.f6450.4

                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]
                        7. Applied rewrites50.4%

                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]

                        if 0.0509999999999999967 < F

                        1. Initial program 59.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. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                        4. Applied rewrites36.6%

                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                        5. Taylor expanded in F around inf

                          \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                        6. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                          2. div-addN/A

                            \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                          3. metadata-evalN/A

                            \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                          4. associate-*r/N/A

                            \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                          5. associate-*r/N/A

                            \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                          6. +-commutativeN/A

                            \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                          7. lower-fma.f64N/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                          8. +-commutativeN/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                          9. associate-*r/N/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot 1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                          10. metadata-evalN/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                          11. associate-*r/N/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                          12. div-addN/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                          13. lower-/.f64N/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                          14. +-commutativeN/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                          15. lower-fma.f64N/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                          16. pow2N/A

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                          17. lift-*.f6448.6

                            \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                        7. Applied rewrites48.6%

                          \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                        8. Taylor expanded in x around 0

                          \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                        9. Step-by-step derivation
                          1. lower--.f64N/A

                            \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                          2. lower-/.f64N/A

                            \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                          3. pow2N/A

                            \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                          4. lift-*.f6448.7

                            \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                        10. Applied rewrites48.7%

                          \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                      7. Recombined 3 regimes into one program.
                      8. Add Preprocessing

                      Alternative 14: 50.1% accurate, 2.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.046:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (if (<= B 0.046)
                         (/ (- (* (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0))) F) x) B)
                         (/ -1.0 (sin B))))
                      double code(double F, double B, double x) {
                      	double tmp;
                      	if (B <= 0.046) {
                      		tmp = ((sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))) * F) - x) / B;
                      	} else {
                      		tmp = -1.0 / sin(B);
                      	}
                      	return tmp;
                      }
                      
                      function code(F, B, x)
                      	tmp = 0.0
                      	if (B <= 0.046)
                      		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0))) * F) - x) / B);
                      	else
                      		tmp = Float64(-1.0 / sin(B));
                      	end
                      	return tmp
                      end
                      
                      code[F_, B_, x_] := If[LessEqual[B, 0.046], N[(N[(N[(N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;B \leq 0.046:\\
                      \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{-1}{\sin B}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if B < 0.045999999999999999

                        1. Initial program 75.0%

                          \[\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. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                        4. Applied rewrites56.8%

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

                        if 0.045999999999999999 < B

                        1. Initial program 84.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. Taylor expanded in F around -inf

                          \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                        3. Step-by-step derivation
                          1. mul-1-negN/A

                            \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                          2. lower-neg.f64N/A

                            \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                          3. div-add-revN/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          4. lower-/.f64N/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          5. lower-+.f64N/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          6. *-commutativeN/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          7. lower-*.f64N/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          8. lower-cos.f64N/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          9. lift-sin.f6454.0

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        4. Applied rewrites54.0%

                          \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                        5. Taylor expanded in x around 0

                          \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                        6. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{-1}{\sin B} \]
                          2. lift-sin.f6417.6

                            \[\leadsto \frac{-1}{\sin B} \]
                        7. Applied rewrites17.6%

                          \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                      3. Recombined 2 regimes into one program.
                      4. Add Preprocessing

                      Alternative 15: 50.0% accurate, 3.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{+149}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 0.051:\\ \;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (if (<= F -1.8e+149)
                         (/
                          (-
                           (-
                            (*
                             (* B B)
                             (- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666)))
                            1.0)
                           x)
                          B)
                         (if (<= F 0.051)
                           (/ (- (* (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))) F) x) B)
                           (/ (- (- 1.0 (/ 1.0 (* F F))) x) B))))
                      double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -1.8e+149) {
                      		tmp = ((((B * B) * ((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - 1.0) - x) / B;
                      	} else if (F <= 0.051) {
                      		tmp = (((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                      	} else {
                      		tmp = ((1.0 - (1.0 / (F * F))) - x) / B;
                      	}
                      	return tmp;
                      }
                      
                      function code(F, B, x)
                      	tmp = 0.0
                      	if (F <= -1.8e+149)
                      		tmp = Float64(Float64(Float64(Float64(Float64(B * B) * Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - 1.0) - x) / B);
                      	elseif (F <= 0.051)
                      		tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                      	else
                      		tmp = Float64(Float64(Float64(1.0 - Float64(1.0 / Float64(F * F))) - x) / B);
                      	end
                      	return tmp
                      end
                      
                      code[F_, B_, x_] := If[LessEqual[F, -1.8e+149], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.051], N[(N[(N[(N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;F \leq -1.8 \cdot 10^{+149}:\\
                      \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - 1\right) - x}{B}\\
                      
                      \mathbf{elif}\;F \leq 0.051:\\
                      \;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if F < -1.79999999999999997e149

                        1. Initial program 32.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. Taylor expanded in F around -inf

                          \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                        3. Step-by-step derivation
                          1. mul-1-negN/A

                            \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                          2. lower-neg.f64N/A

                            \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                          3. div-add-revN/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          4. lower-/.f64N/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          5. lower-+.f64N/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          6. *-commutativeN/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          7. lower-*.f64N/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          8. lower-cos.f64N/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          9. lift-sin.f6499.8

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        4. Applied rewrites99.8%

                          \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                        5. Taylor expanded in B around 0

                          \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]
                        6. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                          2. associate--r+N/A

                            \[\leadsto \frac{\left({B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          3. lower--.f64N/A

                            \[\leadsto \frac{\left({B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          4. lower--.f64N/A

                            \[\leadsto \frac{\left({B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          5. lower-*.f64N/A

                            \[\leadsto \frac{\left({B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          6. unpow2N/A

                            \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          7. lower-*.f64N/A

                            \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          8. lower--.f64N/A

                            \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          9. lower-*.f64N/A

                            \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - 1\right) - x}{B} \]
                          10. +-commutativeN/A

                            \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{-1}{2} \cdot x + \frac{1}{6}\right)\right) - 1\right) - x}{B} \]
                          11. lower-fma.f6451.9

                            \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - 1\right) - x}{B} \]
                        7. Applied rewrites51.9%

                          \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - 1\right) - x}{\color{blue}{B}} \]

                        if -1.79999999999999997e149 < F < 0.0509999999999999967

                        1. Initial program 97.8%

                          \[\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. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                        4. Applied rewrites50.3%

                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                        5. Step-by-step derivation
                          1. Applied rewrites50.3%

                            \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]

                          if 0.0509999999999999967 < F

                          1. Initial program 59.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. Taylor expanded in B around 0

                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                          4. Applied rewrites36.6%

                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                          5. Taylor expanded in F around inf

                            \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                          6. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                            2. div-addN/A

                              \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                            3. metadata-evalN/A

                              \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                            4. associate-*r/N/A

                              \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                            5. associate-*r/N/A

                              \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                            6. +-commutativeN/A

                              \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                            7. lower-fma.f64N/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                            8. +-commutativeN/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                            9. associate-*r/N/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot 1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                            10. metadata-evalN/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                            11. associate-*r/N/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                            12. div-addN/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                            13. lower-/.f64N/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                            14. +-commutativeN/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                            15. lower-fma.f64N/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                            16. pow2N/A

                              \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                            17. lift-*.f6448.6

                              \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                          7. Applied rewrites48.6%

                            \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                          8. Taylor expanded in x around 0

                            \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                          9. Step-by-step derivation
                            1. lower--.f64N/A

                              \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                            2. lower-/.f64N/A

                              \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                            3. pow2N/A

                              \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                            4. lift-*.f6448.7

                              \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                          10. Applied rewrites48.7%

                            \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                        6. Recombined 3 regimes into one program.
                        7. Add Preprocessing

                        Alternative 16: 49.7% accurate, 3.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{+149}:\\ \;\;\;\;-\frac{1 + \left(x + -0.5 \cdot \left(\left(B \cdot B\right) \cdot x\right)\right)}{B}\\ \mathbf{elif}\;F \leq 0.051:\\ \;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (<= F -2.5e+149)
                           (- (/ (+ 1.0 (+ x (* -0.5 (* (* B B) x)))) B))
                           (if (<= F 0.051)
                             (/ (- (* (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))) F) x) B)
                             (/ (- (- 1.0 (/ 1.0 (* F F))) x) B))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -2.5e+149) {
                        		tmp = -((1.0 + (x + (-0.5 * ((B * B) * x)))) / B);
                        	} else if (F <= 0.051) {
                        		tmp = (((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                        	} else {
                        		tmp = ((1.0 - (1.0 / (F * F))) - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if (F <= -2.5e+149)
                        		tmp = Float64(-Float64(Float64(1.0 + Float64(x + Float64(-0.5 * Float64(Float64(B * B) * x)))) / B));
                        	elseif (F <= 0.051)
                        		tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                        	else
                        		tmp = Float64(Float64(Float64(1.0 - Float64(1.0 / Float64(F * F))) - x) / B);
                        	end
                        	return tmp
                        end
                        
                        code[F_, B_, x_] := If[LessEqual[F, -2.5e+149], (-N[(N[(1.0 + N[(x + N[(-0.5 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 0.051], N[(N[(N[(N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;F \leq -2.5 \cdot 10^{+149}:\\
                        \;\;\;\;-\frac{1 + \left(x + -0.5 \cdot \left(\left(B \cdot B\right) \cdot x\right)\right)}{B}\\
                        
                        \mathbf{elif}\;F \leq 0.051:\\
                        \;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if F < -2.49999999999999995e149

                          1. Initial program 32.1%

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

                            \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                          3. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                            2. lower-neg.f64N/A

                              \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                            3. div-add-revN/A

                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                            4. lower-/.f64N/A

                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                            5. lower-+.f64N/A

                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                            6. *-commutativeN/A

                              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                            7. lower-*.f64N/A

                              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                            8. lower-cos.f64N/A

                              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                            9. lift-sin.f6499.8

                              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          4. Applied rewrites99.8%

                            \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                          5. Taylor expanded in B around 0

                            \[\leadsto -\frac{1 + \cos B \cdot x}{B} \]
                          6. Step-by-step derivation
                            1. Applied rewrites51.9%

                              \[\leadsto -\frac{1 + \cos B \cdot x}{B} \]
                            2. Taylor expanded in B around 0

                              \[\leadsto -\frac{1 + \left(x + \frac{-1}{2} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                            3. Step-by-step derivation
                              1. metadata-evalN/A

                                \[\leadsto -\frac{1 + \left(x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                              2. metadata-evalN/A

                                \[\leadsto -\frac{1 + \left(x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                              3. lower-+.f64N/A

                                \[\leadsto -\frac{1 + \left(x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                              4. lower-*.f64N/A

                                \[\leadsto -\frac{1 + \left(x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                              5. metadata-evalN/A

                                \[\leadsto -\frac{1 + \left(x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                              6. metadata-evalN/A

                                \[\leadsto -\frac{1 + \left(x + \frac{-1}{2} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                              7. lower-*.f64N/A

                                \[\leadsto -\frac{1 + \left(x + \frac{-1}{2} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                              8. unpow2N/A

                                \[\leadsto -\frac{1 + \left(x + \frac{-1}{2} \cdot \left(\left(B \cdot B\right) \cdot x\right)\right)}{B} \]
                              9. lower-*.f6451.7

                                \[\leadsto -\frac{1 + \left(x + -0.5 \cdot \left(\left(B \cdot B\right) \cdot x\right)\right)}{B} \]
                            4. Applied rewrites51.7%

                              \[\leadsto -\frac{1 + \left(x + -0.5 \cdot \left(\left(B \cdot B\right) \cdot x\right)\right)}{B} \]

                            if -2.49999999999999995e149 < F < 0.0509999999999999967

                            1. Initial program 97.8%

                              \[\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. Taylor expanded in B around 0

                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            3. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                            4. Applied rewrites50.3%

                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                            5. Step-by-step derivation
                              1. Applied rewrites50.3%

                                \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]

                              if 0.0509999999999999967 < F

                              1. Initial program 59.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. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                              4. Applied rewrites36.6%

                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                              5. Taylor expanded in F around inf

                                \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                              6. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                2. div-addN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                3. metadata-evalN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                4. associate-*r/N/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                5. associate-*r/N/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                6. +-commutativeN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                7. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                9. associate-*r/N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot 1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                10. metadata-evalN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                11. associate-*r/N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                12. div-addN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                13. lower-/.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                14. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                15. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                16. pow2N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                17. lift-*.f6448.6

                                  \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              7. Applied rewrites48.6%

                                \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              8. Taylor expanded in x around 0

                                \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                              9. Step-by-step derivation
                                1. lower--.f64N/A

                                  \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                2. lower-/.f64N/A

                                  \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                3. pow2N/A

                                  \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                4. lift-*.f6448.7

                                  \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                              10. Applied rewrites48.7%

                                \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                            6. Recombined 3 regimes into one program.
                            7. Add Preprocessing

                            Alternative 17: 49.4% accurate, 4.2× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-6}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 0.051:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -1.3e-6)
                               (/ (- (- (* 0.5 (/ (fma 2.0 x 2.0) (* F F))) 1.0) x) B)
                               (if (<= F 0.051)
                                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                                 (/ (- (- 1.0 (/ 1.0 (* F F))) x) B))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -1.3e-6) {
                            		tmp = (((0.5 * (fma(2.0, x, 2.0) / (F * F))) - 1.0) - x) / B;
                            	} else if (F <= 0.051) {
                            		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                            	} else {
                            		tmp = ((1.0 - (1.0 / (F * F))) - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -1.3e-6)
                            		tmp = Float64(Float64(Float64(Float64(0.5 * Float64(fma(2.0, x, 2.0) / Float64(F * F))) - 1.0) - x) / B);
                            	elseif (F <= 0.051)
                            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B);
                            	else
                            		tmp = Float64(Float64(Float64(1.0 - Float64(1.0 / Float64(F * F))) - x) / B);
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -1.3e-6], N[(N[(N[(N[(0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.051], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -1.3 \cdot 10^{-6}:\\
                            \;\;\;\;\frac{\left(0.5 \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} - 1\right) - x}{B}\\
                            
                            \mathbf{elif}\;F \leq 0.051:\\
                            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -1.30000000000000005e-6

                              1. Initial program 60.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. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                              4. Applied rewrites37.6%

                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                              5. Taylor expanded in F around -inf

                                \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                              6. Step-by-step derivation
                                1. metadata-evalN/A

                                  \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                2. lower--.f64N/A

                                  \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                              7. Applied rewrites49.8%

                                \[\leadsto \frac{\left(0.5 \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} - 1\right) - x}{B} \]

                              if -1.30000000000000005e-6 < F < 0.0509999999999999967

                              1. Initial program 99.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. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                              4. Applied rewrites50.6%

                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                              5. Taylor expanded in F around 0

                                \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                              6. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                2. +-commutativeN/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                3. lower-fma.f6450.4

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]
                              7. Applied rewrites50.4%

                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]

                              if 0.0509999999999999967 < F

                              1. Initial program 59.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. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                              4. Applied rewrites36.6%

                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                              5. Taylor expanded in F around inf

                                \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                              6. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                2. div-addN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                3. metadata-evalN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                4. associate-*r/N/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                5. associate-*r/N/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                6. +-commutativeN/A

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                7. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                9. associate-*r/N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot 1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                10. metadata-evalN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                11. associate-*r/N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                12. div-addN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                13. lower-/.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                14. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                15. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                16. pow2N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                17. lift-*.f6448.6

                                  \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              7. Applied rewrites48.6%

                                \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              8. Taylor expanded in x around 0

                                \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                              9. Step-by-step derivation
                                1. lower--.f64N/A

                                  \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                2. lower-/.f64N/A

                                  \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                3. pow2N/A

                                  \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                4. lift-*.f6448.7

                                  \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                              10. Applied rewrites48.7%

                                \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                            3. Recombined 3 regimes into one program.
                            4. Add Preprocessing

                            Alternative 18: 49.4% accurate, 4.2× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 0.051:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -1.4e-24)
                               (/ (- -1.0 x) B)
                               (if (<= F 0.051)
                                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                                 (/ (- (- 1.0 (/ 1.0 (* F F))) x) B))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -1.4e-24) {
                            		tmp = (-1.0 - x) / B;
                            	} else if (F <= 0.051) {
                            		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                            	} else {
                            		tmp = ((1.0 - (1.0 / (F * F))) - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -1.4e-24)
                            		tmp = Float64(Float64(-1.0 - x) / B);
                            	elseif (F <= 0.051)
                            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B);
                            	else
                            		tmp = Float64(Float64(Float64(1.0 - Float64(1.0 / Float64(F * F))) - x) / B);
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -1.4e-24], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.051], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\
                            \;\;\;\;\frac{-1 - x}{B}\\
                            
                            \mathbf{elif}\;F \leq 0.051:\\
                            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -1.4000000000000001e-24

                              1. Initial program 62.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. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                              4. Applied rewrites38.2%

                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                              5. Taylor expanded in F around -inf

                                \[\leadsto \frac{-1 - x}{B} \]
                              6. Step-by-step derivation
                                1. Applied rewrites48.8%

                                  \[\leadsto \frac{-1 - x}{B} \]

                                if -1.4000000000000001e-24 < F < 0.0509999999999999967

                                1. Initial program 99.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. Taylor expanded in B around 0

                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                4. Applied rewrites50.6%

                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                5. Taylor expanded in F around 0

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                6. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                  2. +-commutativeN/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                  3. lower-fma.f6450.4

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]
                                7. Applied rewrites50.4%

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]

                                if 0.0509999999999999967 < F

                                1. Initial program 59.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. Taylor expanded in B around 0

                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                4. Applied rewrites36.6%

                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                5. Taylor expanded in F around inf

                                  \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                6. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                  2. div-addN/A

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                  3. metadata-evalN/A

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                  4. associate-*r/N/A

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                  5. associate-*r/N/A

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                  6. +-commutativeN/A

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                  7. lower-fma.f64N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                  8. +-commutativeN/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                  9. associate-*r/N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot 1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                  10. metadata-evalN/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                  11. associate-*r/N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                  12. div-addN/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                  13. lower-/.f64N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                  14. +-commutativeN/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                  15. lower-fma.f64N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                  16. pow2N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                  17. lift-*.f6448.6

                                    \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                7. Applied rewrites48.6%

                                  \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                8. Taylor expanded in x around 0

                                  \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                9. Step-by-step derivation
                                  1. lower--.f64N/A

                                    \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                  2. lower-/.f64N/A

                                    \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                  3. pow2N/A

                                    \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                  4. lift-*.f6448.7

                                    \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                10. Applied rewrites48.7%

                                  \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                              7. Recombined 3 regimes into one program.
                              8. Add Preprocessing

                              Alternative 19: 49.2% accurate, 4.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 0.051:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
                              (FPCore (F B x)
                               :precision binary64
                               (if (<= F -1.4e-24)
                                 (/ (- -1.0 x) B)
                                 (if (<= F 0.051)
                                   (fma (/ F B) (sqrt 0.5) (/ (- x) B))
                                   (/ (- (- 1.0 (/ 1.0 (* F F))) x) B))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (F <= -1.4e-24) {
                              		tmp = (-1.0 - x) / B;
                              	} else if (F <= 0.051) {
                              		tmp = fma((F / B), sqrt(0.5), (-x / B));
                              	} else {
                              		tmp = ((1.0 - (1.0 / (F * F))) - x) / B;
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (F <= -1.4e-24)
                              		tmp = Float64(Float64(-1.0 - x) / B);
                              	elseif (F <= 0.051)
                              		tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-x) / B));
                              	else
                              		tmp = Float64(Float64(Float64(1.0 - Float64(1.0 / Float64(F * F))) - x) / B);
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := If[LessEqual[F, -1.4e-24], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.051], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\
                              \;\;\;\;\frac{-1 - x}{B}\\
                              
                              \mathbf{elif}\;F \leq 0.051:\\
                              \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if F < -1.4000000000000001e-24

                                1. Initial program 62.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. Taylor expanded in B around 0

                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                4. Applied rewrites38.2%

                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                5. Taylor expanded in F around -inf

                                  \[\leadsto \frac{-1 - x}{B} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites48.8%

                                    \[\leadsto \frac{-1 - x}{B} \]

                                  if -1.4000000000000001e-24 < F < 0.0509999999999999967

                                  1. Initial program 99.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. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites50.6%

                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                  5. Taylor expanded in F around 0

                                    \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                  6. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \color{blue}{\frac{x}{B}} \]
                                    2. lower-fma.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                    3. lift-/.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                    4. lower-sqrt.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                    5. lower-/.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                    6. +-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 \cdot x + 2}}, -1 \cdot \frac{x}{B}\right) \]
                                    7. lower-fma.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, -1 \cdot \frac{x}{B}\right) \]
                                    8. associate-*r/N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-1 \cdot x}{B}\right) \]
                                    9. mul-1-negN/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{\mathsf{neg}\left(x\right)}{B}\right) \]
                                    10. lower-/.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{\mathsf{neg}\left(x\right)}{B}\right) \]
                                    11. lower-neg.f6450.4

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                  7. Applied rewrites50.4%

                                    \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}}, \frac{-x}{B}\right) \]
                                  8. Taylor expanded in x around 0

                                    \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2}}, \frac{-x}{B}\right) \]
                                  9. Step-by-step derivation
                                    1. Applied rewrites50.4%

                                      \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right) \]

                                    if 0.0509999999999999967 < F

                                    1. Initial program 59.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. Taylor expanded in B around 0

                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                    4. Applied rewrites36.6%

                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                    5. Taylor expanded in F around inf

                                      \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                    6. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                      2. div-addN/A

                                        \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                      3. metadata-evalN/A

                                        \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                      4. associate-*r/N/A

                                        \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                      5. associate-*r/N/A

                                        \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                      6. +-commutativeN/A

                                        \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                      7. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                      8. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                      9. associate-*r/N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot 1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                      10. metadata-evalN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                      11. associate-*r/N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                      12. div-addN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                      13. lower-/.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                      14. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                      15. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                      16. pow2N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                      17. lift-*.f6448.6

                                        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                    7. Applied rewrites48.6%

                                      \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                    8. Taylor expanded in x around 0

                                      \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                    9. Step-by-step derivation
                                      1. lower--.f64N/A

                                        \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                      2. lower-/.f64N/A

                                        \[\leadsto \frac{\left(1 - \frac{1}{{F}^{2}}\right) - x}{B} \]
                                      3. pow2N/A

                                        \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                      4. lift-*.f6448.7

                                        \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                    10. Applied rewrites48.7%

                                      \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                  10. Recombined 3 regimes into one program.
                                  11. Add Preprocessing

                                  Alternative 20: 46.6% accurate, 5.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                  (FPCore (F B x)
                                   :precision binary64
                                   (if (<= F -1.4e-24)
                                     (/ (- -1.0 x) B)
                                     (if (<= F 7e-12) (fma (/ F B) (sqrt 0.5) (/ (- x) B)) (/ (- 1.0 x) B))))
                                  double code(double F, double B, double x) {
                                  	double tmp;
                                  	if (F <= -1.4e-24) {
                                  		tmp = (-1.0 - x) / B;
                                  	} else if (F <= 7e-12) {
                                  		tmp = fma((F / B), sqrt(0.5), (-x / B));
                                  	} else {
                                  		tmp = (1.0 - x) / B;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(F, B, x)
                                  	tmp = 0.0
                                  	if (F <= -1.4e-24)
                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                  	elseif (F <= 7e-12)
                                  		tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-x) / B));
                                  	else
                                  		tmp = Float64(Float64(1.0 - x) / B);
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[F_, B_, x_] := If[LessEqual[F, -1.4e-24], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-12], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;F \leq -1.4 \cdot 10^{-24}:\\
                                  \;\;\;\;\frac{-1 - x}{B}\\
                                  
                                  \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\
                                  \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{1 - x}{B}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if F < -1.4000000000000001e-24

                                    1. Initial program 62.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. Taylor expanded in B around 0

                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                    4. Applied rewrites38.2%

                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                    5. Taylor expanded in F around -inf

                                      \[\leadsto \frac{-1 - x}{B} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites48.8%

                                        \[\leadsto \frac{-1 - x}{B} \]

                                      if -1.4000000000000001e-24 < F < 7.0000000000000001e-12

                                      1. Initial program 99.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. Taylor expanded in B around 0

                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                      3. Step-by-step derivation
                                        1. lower-/.f64N/A

                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                      4. Applied rewrites50.6%

                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                      5. Taylor expanded in F around 0

                                        \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                      6. Step-by-step derivation
                                        1. +-commutativeN/A

                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \color{blue}{\frac{x}{B}} \]
                                        2. lower-fma.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                        3. lift-/.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                        4. lower-sqrt.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                        5. lower-/.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                        6. +-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 \cdot x + 2}}, -1 \cdot \frac{x}{B}\right) \]
                                        7. lower-fma.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, -1 \cdot \frac{x}{B}\right) \]
                                        8. associate-*r/N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-1 \cdot x}{B}\right) \]
                                        9. mul-1-negN/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{\mathsf{neg}\left(x\right)}{B}\right) \]
                                        10. lower-/.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{\mathsf{neg}\left(x\right)}{B}\right) \]
                                        11. lower-neg.f6450.6

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                      7. Applied rewrites50.6%

                                        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}}, \frac{-x}{B}\right) \]
                                      8. Taylor expanded in x around 0

                                        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2}}, \frac{-x}{B}\right) \]
                                      9. Step-by-step derivation
                                        1. Applied rewrites50.6%

                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right) \]

                                        if 7.0000000000000001e-12 < F

                                        1. Initial program 60.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. Taylor expanded in B around 0

                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                        3. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                        4. Applied rewrites36.9%

                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                        5. Taylor expanded in F around inf

                                          \[\leadsto \frac{1 - x}{B} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites47.7%

                                            \[\leadsto \frac{1 - x}{B} \]
                                        7. Recombined 3 regimes into one program.
                                        8. Add Preprocessing

                                        Alternative 21: 42.8% accurate, 5.6× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.9 \cdot 10^{-117}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (if (<= F -2.7e-50)
                                           (/ (- -1.0 x) B)
                                           (if (<= F 2.9e-117)
                                             (/ (- x) B)
                                             (if (<= F 7e-12) (/ (* F (sqrt 0.5)) B) (/ (- 1.0 x) B)))))
                                        double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -2.7e-50) {
                                        		tmp = (-1.0 - x) / B;
                                        	} else if (F <= 2.9e-117) {
                                        		tmp = -x / B;
                                        	} else if (F <= 7e-12) {
                                        		tmp = (F * sqrt(0.5)) / B;
                                        	} else {
                                        		tmp = (1.0 - x) / B;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        module fmin_fmax_functions
                                            implicit none
                                            private
                                            public fmax
                                            public fmin
                                        
                                            interface fmax
                                                module procedure fmax88
                                                module procedure fmax44
                                                module procedure fmax84
                                                module procedure fmax48
                                            end interface
                                            interface fmin
                                                module procedure fmin88
                                                module procedure fmin44
                                                module procedure fmin84
                                                module procedure fmin48
                                            end interface
                                        contains
                                            real(8) function fmax88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmax44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmax84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmax48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmin44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmin48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                            end function
                                        end module
                                        
                                        real(8) function code(f, b, x)
                                        use fmin_fmax_functions
                                            real(8), intent (in) :: f
                                            real(8), intent (in) :: b
                                            real(8), intent (in) :: x
                                            real(8) :: tmp
                                            if (f <= (-2.7d-50)) then
                                                tmp = ((-1.0d0) - x) / b
                                            else if (f <= 2.9d-117) then
                                                tmp = -x / b
                                            else if (f <= 7d-12) then
                                                tmp = (f * sqrt(0.5d0)) / b
                                            else
                                                tmp = (1.0d0 - x) / b
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -2.7e-50) {
                                        		tmp = (-1.0 - x) / B;
                                        	} else if (F <= 2.9e-117) {
                                        		tmp = -x / B;
                                        	} else if (F <= 7e-12) {
                                        		tmp = (F * Math.sqrt(0.5)) / B;
                                        	} else {
                                        		tmp = (1.0 - x) / B;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(F, B, x):
                                        	tmp = 0
                                        	if F <= -2.7e-50:
                                        		tmp = (-1.0 - x) / B
                                        	elif F <= 2.9e-117:
                                        		tmp = -x / B
                                        	elif F <= 7e-12:
                                        		tmp = (F * math.sqrt(0.5)) / B
                                        	else:
                                        		tmp = (1.0 - x) / B
                                        	return tmp
                                        
                                        function code(F, B, x)
                                        	tmp = 0.0
                                        	if (F <= -2.7e-50)
                                        		tmp = Float64(Float64(-1.0 - x) / B);
                                        	elseif (F <= 2.9e-117)
                                        		tmp = Float64(Float64(-x) / B);
                                        	elseif (F <= 7e-12)
                                        		tmp = Float64(Float64(F * sqrt(0.5)) / B);
                                        	else
                                        		tmp = Float64(Float64(1.0 - x) / B);
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(F, B, x)
                                        	tmp = 0.0;
                                        	if (F <= -2.7e-50)
                                        		tmp = (-1.0 - x) / B;
                                        	elseif (F <= 2.9e-117)
                                        		tmp = -x / B;
                                        	elseif (F <= 7e-12)
                                        		tmp = (F * sqrt(0.5)) / B;
                                        	else
                                        		tmp = (1.0 - x) / B;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[F_, B_, x_] := If[LessEqual[F, -2.7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.9e-117], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 7e-12], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;F \leq -2.7 \cdot 10^{-50}:\\
                                        \;\;\;\;\frac{-1 - x}{B}\\
                                        
                                        \mathbf{elif}\;F \leq 2.9 \cdot 10^{-117}:\\
                                        \;\;\;\;\frac{-x}{B}\\
                                        
                                        \mathbf{elif}\;F \leq 7 \cdot 10^{-12}:\\
                                        \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{1 - x}{B}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 4 regimes
                                        2. if F < -2.7e-50

                                          1. Initial program 64.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. Taylor expanded in B around 0

                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                          4. Applied rewrites38.7%

                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                          5. Taylor expanded in F around -inf

                                            \[\leadsto \frac{-1 - x}{B} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites47.3%

                                              \[\leadsto \frac{-1 - x}{B} \]

                                            if -2.7e-50 < F < 2.9000000000000001e-117

                                            1. Initial program 99.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. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                            4. Applied rewrites50.4%

                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                            5. Taylor expanded in F around 0

                                              \[\leadsto \frac{-1 \cdot x}{B} \]
                                            6. Step-by-step derivation
                                              1. mul-1-negN/A

                                                \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                              2. lower-neg.f6437.8

                                                \[\leadsto \frac{-x}{B} \]
                                            7. Applied rewrites37.8%

                                              \[\leadsto \frac{-x}{B} \]

                                            if 2.9000000000000001e-117 < F < 7.0000000000000001e-12

                                            1. Initial program 99.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. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                            4. Applied rewrites52.0%

                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                            5. Taylor expanded in F around 0

                                              \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                            6. Step-by-step derivation
                                              1. +-commutativeN/A

                                                \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \color{blue}{\frac{x}{B}} \]
                                              2. lower-fma.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                              3. lift-/.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                              4. lower-sqrt.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                              5. lower-/.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                              6. +-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 \cdot x + 2}}, -1 \cdot \frac{x}{B}\right) \]
                                              7. lower-fma.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, -1 \cdot \frac{x}{B}\right) \]
                                              8. associate-*r/N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-1 \cdot x}{B}\right) \]
                                              9. mul-1-negN/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{\mathsf{neg}\left(x\right)}{B}\right) \]
                                              10. lower-/.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{\mathsf{neg}\left(x\right)}{B}\right) \]
                                              11. lower-neg.f6452.0

                                                \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                            7. Applied rewrites52.0%

                                              \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}}, \frac{-x}{B}\right) \]
                                            8. Taylor expanded in x around 0

                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                            9. Step-by-step derivation
                                              1. metadata-evalN/A

                                                \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{B} \]
                                              2. metadata-evalN/A

                                                \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                              3. metadata-evalN/A

                                                \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                              4. sqrt-unprodN/A

                                                \[\leadsto \frac{F \cdot \left(\sqrt{-1} \cdot \sqrt{\mathsf{neg}\left(\frac{1}{2}\right)}\right)}{B} \]
                                              5. sqrt-unprodN/A

                                                \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                              6. metadata-evalN/A

                                                \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                              7. metadata-evalN/A

                                                \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{B} \]
                                              8. metadata-evalN/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                              9. metadata-evalN/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                              10. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                              11. lower-*.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                              12. lower-sqrt.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                              13. metadata-eval28.2

                                                \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]
                                            10. Applied rewrites28.2%

                                              \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]

                                            if 7.0000000000000001e-12 < F

                                            1. Initial program 60.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. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                            4. Applied rewrites36.9%

                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                            5. Taylor expanded in F around inf

                                              \[\leadsto \frac{1 - x}{B} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites47.7%

                                                \[\leadsto \frac{1 - x}{B} \]
                                            7. Recombined 4 regimes into one program.
                                            8. Add Preprocessing

                                            Alternative 22: 42.3% accurate, 7.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.95 \cdot 10^{-114}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -2.7e-50)
                                               (/ (- -1.0 x) B)
                                               (if (<= F 2.95e-114) (/ (- x) B) (/ (- 1.0 x) B))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -2.7e-50) {
                                            		tmp = (-1.0 - x) / B;
                                            	} else if (F <= 2.95e-114) {
                                            		tmp = -x / B;
                                            	} else {
                                            		tmp = (1.0 - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            module fmin_fmax_functions
                                                implicit none
                                                private
                                                public fmax
                                                public fmin
                                            
                                                interface fmax
                                                    module procedure fmax88
                                                    module procedure fmax44
                                                    module procedure fmax84
                                                    module procedure fmax48
                                                end interface
                                                interface fmin
                                                    module procedure fmin88
                                                    module procedure fmin44
                                                    module procedure fmin84
                                                    module procedure fmin48
                                                end interface
                                            contains
                                                real(8) function fmax88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmax44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmax84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmax48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmin44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmin48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                end function
                                            end module
                                            
                                            real(8) function code(f, b, x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: f
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: x
                                                real(8) :: tmp
                                                if (f <= (-2.7d-50)) then
                                                    tmp = ((-1.0d0) - x) / b
                                                else if (f <= 2.95d-114) then
                                                    tmp = -x / b
                                                else
                                                    tmp = (1.0d0 - x) / b
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -2.7e-50) {
                                            		tmp = (-1.0 - x) / B;
                                            	} else if (F <= 2.95e-114) {
                                            		tmp = -x / B;
                                            	} else {
                                            		tmp = (1.0 - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= -2.7e-50:
                                            		tmp = (-1.0 - x) / B
                                            	elif F <= 2.95e-114:
                                            		tmp = -x / B
                                            	else:
                                            		tmp = (1.0 - x) / B
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -2.7e-50)
                                            		tmp = Float64(Float64(-1.0 - x) / B);
                                            	elseif (F <= 2.95e-114)
                                            		tmp = Float64(Float64(-x) / B);
                                            	else
                                            		tmp = Float64(Float64(1.0 - x) / B);
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if (F <= -2.7e-50)
                                            		tmp = (-1.0 - x) / B;
                                            	elseif (F <= 2.95e-114)
                                            		tmp = -x / B;
                                            	else
                                            		tmp = (1.0 - x) / B;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -2.7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.95e-114], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -2.7 \cdot 10^{-50}:\\
                                            \;\;\;\;\frac{-1 - x}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 2.95 \cdot 10^{-114}:\\
                                            \;\;\;\;\frac{-x}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{1 - x}{B}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -2.7e-50

                                              1. Initial program 64.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. Taylor expanded in B around 0

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites38.7%

                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around -inf

                                                \[\leadsto \frac{-1 - x}{B} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites47.3%

                                                  \[\leadsto \frac{-1 - x}{B} \]

                                                if -2.7e-50 < F < 2.9500000000000001e-114

                                                1. Initial program 99.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. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                4. Applied rewrites50.4%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                5. Taylor expanded in F around 0

                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                6. Step-by-step derivation
                                                  1. mul-1-negN/A

                                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                  2. lower-neg.f6437.7

                                                    \[\leadsto \frac{-x}{B} \]
                                                7. Applied rewrites37.7%

                                                  \[\leadsto \frac{-x}{B} \]

                                                if 2.9500000000000001e-114 < F

                                                1. Initial program 68.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. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                4. Applied rewrites40.0%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                5. Taylor expanded in F around inf

                                                  \[\leadsto \frac{1 - x}{B} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites42.3%

                                                    \[\leadsto \frac{1 - x}{B} \]
                                                7. Recombined 3 regimes into one program.
                                                8. Add Preprocessing

                                                Alternative 23: 35.6% accurate, 10.7× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                (FPCore (F B x)
                                                 :precision binary64
                                                 (if (<= F -2.7e-50) (/ (- -1.0 x) B) (/ (- x) B)))
                                                double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -2.7e-50) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else {
                                                		tmp = -x / B;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                module fmin_fmax_functions
                                                    implicit none
                                                    private
                                                    public fmax
                                                    public fmin
                                                
                                                    interface fmax
                                                        module procedure fmax88
                                                        module procedure fmax44
                                                        module procedure fmax84
                                                        module procedure fmax48
                                                    end interface
                                                    interface fmin
                                                        module procedure fmin88
                                                        module procedure fmin44
                                                        module procedure fmin84
                                                        module procedure fmin48
                                                    end interface
                                                contains
                                                    real(8) function fmax88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmax44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmin44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                    end function
                                                end module
                                                
                                                real(8) function code(f, b, x)
                                                use fmin_fmax_functions
                                                    real(8), intent (in) :: f
                                                    real(8), intent (in) :: b
                                                    real(8), intent (in) :: x
                                                    real(8) :: tmp
                                                    if (f <= (-2.7d-50)) then
                                                        tmp = ((-1.0d0) - x) / b
                                                    else
                                                        tmp = -x / b
                                                    end if
                                                    code = tmp
                                                end function
                                                
                                                public static double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -2.7e-50) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else {
                                                		tmp = -x / B;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                def code(F, B, x):
                                                	tmp = 0
                                                	if F <= -2.7e-50:
                                                		tmp = (-1.0 - x) / B
                                                	else:
                                                		tmp = -x / B
                                                	return tmp
                                                
                                                function code(F, B, x)
                                                	tmp = 0.0
                                                	if (F <= -2.7e-50)
                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                	else
                                                		tmp = Float64(Float64(-x) / B);
                                                	end
                                                	return tmp
                                                end
                                                
                                                function tmp_2 = code(F, B, x)
                                                	tmp = 0.0;
                                                	if (F <= -2.7e-50)
                                                		tmp = (-1.0 - x) / B;
                                                	else
                                                		tmp = -x / B;
                                                	end
                                                	tmp_2 = tmp;
                                                end
                                                
                                                code[F_, B_, x_] := If[LessEqual[F, -2.7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;F \leq -2.7 \cdot 10^{-50}:\\
                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{-x}{B}\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if F < -2.7e-50

                                                  1. Initial program 64.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. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  3. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                  4. Applied rewrites38.7%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                  5. Taylor expanded in F around -inf

                                                    \[\leadsto \frac{-1 - x}{B} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites47.3%

                                                      \[\leadsto \frac{-1 - x}{B} \]

                                                    if -2.7e-50 < F

                                                    1. Initial program 83.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. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    3. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                    4. Applied rewrites44.9%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    5. Taylor expanded in F around 0

                                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                                    6. Step-by-step derivation
                                                      1. mul-1-negN/A

                                                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                      2. lower-neg.f6430.5

                                                        \[\leadsto \frac{-x}{B} \]
                                                    7. Applied rewrites30.5%

                                                      \[\leadsto \frac{-x}{B} \]
                                                  7. Recombined 2 regimes into one program.
                                                  8. Add Preprocessing

                                                  Alternative 24: 29.4% accurate, 8.9× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{B}\\ \mathbf{if}\;x \leq -5.4 \cdot 10^{-12}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-138}:\\ \;\;\;\;-\frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                  (FPCore (F B x)
                                                   :precision binary64
                                                   (let* ((t_0 (/ (- x) B)))
                                                     (if (<= x -5.4e-12) t_0 (if (<= x 6.2e-138) (- (/ 1.0 B)) t_0))))
                                                  double code(double F, double B, double x) {
                                                  	double t_0 = -x / B;
                                                  	double tmp;
                                                  	if (x <= -5.4e-12) {
                                                  		tmp = t_0;
                                                  	} else if (x <= 6.2e-138) {
                                                  		tmp = -(1.0 / B);
                                                  	} else {
                                                  		tmp = t_0;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  module fmin_fmax_functions
                                                      implicit none
                                                      private
                                                      public fmax
                                                      public fmin
                                                  
                                                      interface fmax
                                                          module procedure fmax88
                                                          module procedure fmax44
                                                          module procedure fmax84
                                                          module procedure fmax48
                                                      end interface
                                                      interface fmin
                                                          module procedure fmin88
                                                          module procedure fmin44
                                                          module procedure fmin84
                                                          module procedure fmin48
                                                      end interface
                                                  contains
                                                      real(8) function fmax88(x, y) result (res)
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                      end function
                                                      real(4) function fmax44(x, y) result (res)
                                                          real(4), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmax84(x, y) result(res)
                                                          real(8), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmax48(x, y) result(res)
                                                          real(4), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin88(x, y) result (res)
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                      end function
                                                      real(4) function fmin44(x, y) result (res)
                                                          real(4), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin84(x, y) result(res)
                                                          real(8), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin48(x, y) result(res)
                                                          real(4), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                      end function
                                                  end module
                                                  
                                                  real(8) function code(f, b, x)
                                                  use fmin_fmax_functions
                                                      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 / b
                                                      if (x <= (-5.4d-12)) then
                                                          tmp = t_0
                                                      else if (x <= 6.2d-138) then
                                                          tmp = -(1.0d0 / b)
                                                      else
                                                          tmp = t_0
                                                      end if
                                                      code = tmp
                                                  end function
                                                  
                                                  public static double code(double F, double B, double x) {
                                                  	double t_0 = -x / B;
                                                  	double tmp;
                                                  	if (x <= -5.4e-12) {
                                                  		tmp = t_0;
                                                  	} else if (x <= 6.2e-138) {
                                                  		tmp = -(1.0 / B);
                                                  	} else {
                                                  		tmp = t_0;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  def code(F, B, x):
                                                  	t_0 = -x / B
                                                  	tmp = 0
                                                  	if x <= -5.4e-12:
                                                  		tmp = t_0
                                                  	elif x <= 6.2e-138:
                                                  		tmp = -(1.0 / B)
                                                  	else:
                                                  		tmp = t_0
                                                  	return tmp
                                                  
                                                  function code(F, B, x)
                                                  	t_0 = Float64(Float64(-x) / B)
                                                  	tmp = 0.0
                                                  	if (x <= -5.4e-12)
                                                  		tmp = t_0;
                                                  	elseif (x <= 6.2e-138)
                                                  		tmp = Float64(-Float64(1.0 / B));
                                                  	else
                                                  		tmp = t_0;
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  function tmp_2 = code(F, B, x)
                                                  	t_0 = -x / B;
                                                  	tmp = 0.0;
                                                  	if (x <= -5.4e-12)
                                                  		tmp = t_0;
                                                  	elseif (x <= 6.2e-138)
                                                  		tmp = -(1.0 / B);
                                                  	else
                                                  		tmp = t_0;
                                                  	end
                                                  	tmp_2 = tmp;
                                                  end
                                                  
                                                  code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -5.4e-12], t$95$0, If[LessEqual[x, 6.2e-138], (-N[(1.0 / B), $MachinePrecision]), t$95$0]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  t_0 := \frac{-x}{B}\\
                                                  \mathbf{if}\;x \leq -5.4 \cdot 10^{-12}:\\
                                                  \;\;\;\;t\_0\\
                                                  
                                                  \mathbf{elif}\;x \leq 6.2 \cdot 10^{-138}:\\
                                                  \;\;\;\;-\frac{1}{B}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;t\_0\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if x < -5.39999999999999961e-12 or 6.1999999999999996e-138 < x

                                                    1. Initial program 81.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. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    3. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                    4. Applied rewrites46.4%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    5. Taylor expanded in F around 0

                                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                                    6. Step-by-step derivation
                                                      1. mul-1-negN/A

                                                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                      2. lower-neg.f6441.9

                                                        \[\leadsto \frac{-x}{B} \]
                                                    7. Applied rewrites41.9%

                                                      \[\leadsto \frac{-x}{B} \]

                                                    if -5.39999999999999961e-12 < x < 6.1999999999999996e-138

                                                    1. Initial program 73.0%

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

                                                      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                    3. Step-by-step derivation
                                                      1. mul-1-negN/A

                                                        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                                                      2. lower-neg.f64N/A

                                                        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                                      3. div-add-revN/A

                                                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                                      4. lower-/.f64N/A

                                                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                                      5. lower-+.f64N/A

                                                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                                      6. *-commutativeN/A

                                                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                      7. lower-*.f64N/A

                                                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                      8. lower-cos.f64N/A

                                                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                      9. lift-sin.f6426.3

                                                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                    4. Applied rewrites26.3%

                                                      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                                                    5. Taylor expanded in B around 0

                                                      \[\leadsto -\frac{1 + \cos B \cdot x}{B} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites14.7%

                                                        \[\leadsto -\frac{1 + \cos B \cdot x}{B} \]
                                                      2. Taylor expanded in x around 0

                                                        \[\leadsto -\frac{1}{B} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites14.7%

                                                          \[\leadsto -\frac{1}{B} \]
                                                      4. Recombined 2 regimes into one program.
                                                      5. Add Preprocessing

                                                      Alternative 25: 10.4% accurate, 21.7× speedup?

                                                      \[\begin{array}{l} \\ -\frac{1}{B} \end{array} \]
                                                      (FPCore (F B x) :precision binary64 (- (/ 1.0 B)))
                                                      double code(double F, double B, double x) {
                                                      	return -(1.0 / B);
                                                      }
                                                      
                                                      module fmin_fmax_functions
                                                          implicit none
                                                          private
                                                          public fmax
                                                          public fmin
                                                      
                                                          interface fmax
                                                              module procedure fmax88
                                                              module procedure fmax44
                                                              module procedure fmax84
                                                              module procedure fmax48
                                                          end interface
                                                          interface fmin
                                                              module procedure fmin88
                                                              module procedure fmin44
                                                              module procedure fmin84
                                                              module procedure fmin48
                                                          end interface
                                                      contains
                                                          real(8) function fmax88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmax44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmin44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                          end function
                                                      end module
                                                      
                                                      real(8) function code(f, b, x)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: f
                                                          real(8), intent (in) :: b
                                                          real(8), intent (in) :: x
                                                          code = -(1.0d0 / b)
                                                      end function
                                                      
                                                      public static double code(double F, double B, double x) {
                                                      	return -(1.0 / B);
                                                      }
                                                      
                                                      def code(F, B, x):
                                                      	return -(1.0 / B)
                                                      
                                                      function code(F, B, x)
                                                      	return Float64(-Float64(1.0 / B))
                                                      end
                                                      
                                                      function tmp = code(F, B, x)
                                                      	tmp = -(1.0 / B);
                                                      end
                                                      
                                                      code[F_, B_, x_] := (-N[(1.0 / B), $MachinePrecision])
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      -\frac{1}{B}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Initial program 77.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. Taylor expanded in F around -inf

                                                        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                      3. Step-by-step derivation
                                                        1. mul-1-negN/A

                                                          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                                                        2. lower-neg.f64N/A

                                                          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                                        3. div-add-revN/A

                                                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                                        4. lower-/.f64N/A

                                                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                                        5. lower-+.f64N/A

                                                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                                        6. *-commutativeN/A

                                                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                        7. lower-*.f64N/A

                                                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                        8. lower-cos.f64N/A

                                                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                        9. lift-sin.f6454.9

                                                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                                      4. Applied rewrites54.9%

                                                        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                                                      5. Taylor expanded in B around 0

                                                        \[\leadsto -\frac{1 + \cos B \cdot x}{B} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites28.7%

                                                          \[\leadsto -\frac{1 + \cos B \cdot x}{B} \]
                                                        2. Taylor expanded in x around 0

                                                          \[\leadsto -\frac{1}{B} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites10.4%

                                                            \[\leadsto -\frac{1}{B} \]
                                                          2. Add Preprocessing

                                                          Reproduce

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