VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.7% → 99.2%
Time: 8.4s
Alternatives: 22
Speedup: 1.7×

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 22 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: 76.7% 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.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+79}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)\\


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

    1. Initial program 48.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 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.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}} \]

    if -3.99999999999999987e79 < F < 7.9999999999999999e46

    1. Initial program 98.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 \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.f6498.8

        \[\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 rewrites98.8%

      \[\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)}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

    if 7.9999999999999999e46 < F

    1. Initial program 53.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 rewrites70.2%

      \[\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. 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 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(F, \color{blue}{\frac{1}{F \cdot \sin B}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \color{blue}{\sin B}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      3. lift-sin.f6499.5

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

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

Alternative 2: 99.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{+79}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

\mathbf{elif}\;F \leq 10^{+47}:\\
\;\;\;\;\left(-x \cdot t\_0\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \left(-x\right) \cdot t\_0\right)\\


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

    1. Initial program 48.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 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.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}} \]

    if -2.89999999999999992e79 < F < 1e47

    1. Initial program 98.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 \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.f6498.8

        \[\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 rewrites98.8%

      \[\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 1e47 < F

    1. Initial program 53.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(-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 rewrites70.2%

      \[\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. 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 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(F, \color{blue}{\frac{1}{F \cdot \sin B}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \color{blue}{\sin B}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      3. lift-sin.f6499.5

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

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

Alternative 3: 99.2% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)\\


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

    1. Initial program 58.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.3

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

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

    if -1.3999999999999999 < F < 1.44999999999999996

    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 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.5

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

      \[\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)}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      if 1.44999999999999996 < F

      1. Initial program 59.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \]
        2. metadata-eval99.1

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

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

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

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

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

          \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) + \frac{1}{\sin B} \]
        8. distribute-lft-neg-inN/A

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
      6. Applied rewrites99.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
    9. Recombined 3 regimes into one program.
    10. Add Preprocessing

    Alternative 4: 99.1% accurate, 1.2× speedup?

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

      1. Initial program 58.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.3

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

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

      if -1.3500000000000001 < F < 1.3999999999999999

      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 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.5

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

        \[\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)}}} \]
      5. Taylor expanded in F around 0

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

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

        if 1.3999999999999999 < F

        1. Initial program 59.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \]
          2. metadata-eval99.1

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

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

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

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

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

            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) + \frac{1}{\sin B} \]
          8. distribute-lft-neg-inN/A

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
        6. Applied rewrites99.1%

          \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
      7. Recombined 3 regimes into one program.
      8. Add Preprocessing

      Alternative 5: 92.2% accurate, 1.3× speedup?

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

        1. Initial program 59.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}{-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.f6496.9

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

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

        if -5.8e-19 < F < 7.8e-95

        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 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.5

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

          \[\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)}}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          if 7.8e-95 < F < 19000

          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. 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.4%

            \[\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. 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 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \]
            2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
          7. Step-by-step derivation
            1. distribute-lft-neg-inN/A

              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1} \cdot \frac{x}{B}\right) \]
            2. mul-1-negN/A

              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
            3. distribute-frac-negN/A

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

              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{B}\right) \]
            5. lift-/.f6475.7

              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\color{blue}{B}}\right) \]
          8. Applied rewrites75.7%

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

          if 19000 < 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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \]
            2. metadata-eval99.6

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

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

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

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

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

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) + \frac{1}{\sin B} \]
            8. distribute-lft-neg-inN/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
          6. Applied rewrites99.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
        9. Recombined 4 regimes into one program.
        10. Add Preprocessing

        Alternative 6: 92.2% accurate, 1.4× speedup?

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

          1. Initial program 59.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}{-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.f6496.9

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

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

          if -5.8e-19 < F < 7.8e-95

          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 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.5

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

            \[\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)}}} \]
          5. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            if 7.8e-95 < F < 19000

            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. 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.4%

              \[\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. 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 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \]
              2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
            7. Step-by-step derivation
              1. distribute-lft-neg-inN/A

                \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1} \cdot \frac{x}{B}\right) \]
              2. mul-1-negN/A

                \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
              3. distribute-frac-negN/A

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

                \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{B}\right) \]
              5. lift-/.f6475.7

                \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\color{blue}{B}}\right) \]
            8. Applied rewrites75.7%

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

            if 19000 < 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.6

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

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

          Alternative 7: 84.7% accurate, 1.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{+104}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{elif}\;F \leq 19000:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
          (FPCore (F B x)
           :precision binary64
           (if (<= F -1.05e+104)
             (+ (- (/ x B)) (/ -1.0 (sin B)))
             (if (<= F 7.8e-95)
               (+ (- (/ (* x 1.0) (tan B))) (* (/ F B) (sqrt (/ 1.0 (fma F F 2.0)))))
               (if (<= F 19000.0)
                 (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B))
                 (/ (- 1.0 (* (cos B) x)) (sin B))))))
          double code(double F, double B, double x) {
          	double tmp;
          	if (F <= -1.05e+104) {
          		tmp = -(x / B) + (-1.0 / sin(B));
          	} else if (F <= 7.8e-95) {
          		tmp = -((x * 1.0) / tan(B)) + ((F / B) * sqrt((1.0 / fma(F, F, 2.0))));
          	} else if (F <= 19000.0) {
          		tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
          	} else {
          		tmp = (1.0 - (cos(B) * x)) / sin(B);
          	}
          	return tmp;
          }
          
          function code(F, B, x)
          	tmp = 0.0
          	if (F <= -1.05e+104)
          		tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B)));
          	elseif (F <= 7.8e-95)
          		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, 2.0)))));
          	elseif (F <= 19000.0)
          		tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / 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.05e+104], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.8e-95], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 19000.0], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $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.05 \cdot 10^{+104}:\\
          \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
          
          \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\
          \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
          
          \mathbf{elif}\;F \leq 19000:\\
          \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if F < -1.0499999999999999e104

            1. Initial program 44.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 rewrites62.6%

              \[\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 B around 0

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

                \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
            6. Applied rewrites38.4%

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

              \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{-1}}{\sin B} \]
            8. Step-by-step derivation
              1. Applied rewrites74.7%

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

              if -1.0499999999999999e104 < F < 7.8e-95

              1. Initial program 98.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.f6498.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 rewrites98.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)}}} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

                \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\color{blue}{B}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \]
              8. Step-by-step derivation
                1. Applied rewrites81.8%

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

                if 7.8e-95 < F < 19000

                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. 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.4%

                  \[\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. 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 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \]
                  2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                7. Step-by-step derivation
                  1. distribute-lft-neg-inN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1} \cdot \frac{x}{B}\right) \]
                  2. mul-1-negN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
                  3. distribute-frac-negN/A

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

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{B}\right) \]
                  5. lift-/.f6475.7

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\color{blue}{B}}\right) \]
                8. Applied rewrites75.7%

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

                if 19000 < 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.6

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

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

              Alternative 8: 78.0% accurate, 1.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{+104}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{+106}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\ \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 -1.05e+104)
                 (+ (- (/ x B)) (/ -1.0 (sin B)))
                 (if (<= F 7.8e-95)
                   (+ (- (/ (* x 1.0) (tan B))) (* (/ F B) (sqrt (/ 1.0 (fma F F 2.0)))))
                   (if (<= F 8.2e+106)
                     (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B))
                     (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 B))))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (F <= -1.05e+104) {
              		tmp = -(x / B) + (-1.0 / sin(B));
              	} else if (F <= 7.8e-95) {
              		tmp = -((x * 1.0) / tan(B)) + ((F / B) * sqrt((1.0 / fma(F, F, 2.0))));
              	} else if (F <= 8.2e+106) {
              		tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
              	} else {
              		tmp = -(x * (1.0 / tan(B))) + (1.0 / B);
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	tmp = 0.0
              	if (F <= -1.05e+104)
              		tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B)));
              	elseif (F <= 7.8e-95)
              		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, 2.0)))));
              	elseif (F <= 8.2e+106)
              		tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / 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, -1.05e+104], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.8e-95], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.2e+106], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $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 -1.05 \cdot 10^{+104}:\\
              \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
              
              \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\
              \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
              
              \mathbf{elif}\;F \leq 8.2 \cdot 10^{+106}:\\
              \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\
              
              \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 < -1.0499999999999999e104

                1. Initial program 44.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 rewrites62.6%

                  \[\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 B around 0

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

                    \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
                6. Applied rewrites38.4%

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

                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{-1}}{\sin B} \]
                8. Step-by-step derivation
                  1. Applied rewrites74.7%

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

                  if -1.0499999999999999e104 < F < 7.8e-95

                  1. Initial program 98.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.f6498.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 rewrites98.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)}}} \]
                  5. Step-by-step derivation
                    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\color{blue}{B}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \]
                  8. Step-by-step derivation
                    1. Applied rewrites81.8%

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

                    if 7.8e-95 < F < 8.2000000000000005e106

                    1. Initial program 96.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. 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. 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 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \]
                      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                    7. Step-by-step derivation
                      1. distribute-lft-neg-inN/A

                        \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \color{blue}{-1} \cdot \frac{x}{B}\right) \]
                      2. mul-1-negN/A

                        \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
                      3. distribute-frac-negN/A

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

                        \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{B}\right) \]
                      5. lift-/.f6476.5

                        \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\color{blue}{B}}\right) \]
                    8. Applied rewrites76.5%

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

                    if 8.2000000000000005e106 < F

                    1. Initial program 44.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                      2. lift-sin.f6499.7

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B} \]
                    6. Step-by-step derivation
                      1. Applied rewrites73.9%

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

                    Alternative 9: 77.5% accurate, 1.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{x}{B}\\ t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{if}\;F \leq -1.05 \cdot 10^{+104}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot t\_1\\ \mathbf{elif}\;F \leq 6.7 \cdot 10^{+106}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (let* ((t_0 (- (/ x B))) (t_1 (sqrt (/ 1.0 (fma F F 2.0)))))
                       (if (<= F -1.05e+104)
                         (+ t_0 (/ -1.0 (sin B)))
                         (if (<= F 7.8e-95)
                           (+ (- (/ (* x 1.0) (tan B))) (* (/ F B) t_1))
                           (if (<= F 6.7e+106)
                             (+ t_0 (* (/ F (sin B)) t_1))
                             (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 B)))))))
                    double code(double F, double B, double x) {
                    	double t_0 = -(x / B);
                    	double t_1 = sqrt((1.0 / fma(F, F, 2.0)));
                    	double tmp;
                    	if (F <= -1.05e+104) {
                    		tmp = t_0 + (-1.0 / sin(B));
                    	} else if (F <= 7.8e-95) {
                    		tmp = -((x * 1.0) / tan(B)) + ((F / B) * t_1);
                    	} else if (F <= 6.7e+106) {
                    		tmp = t_0 + ((F / sin(B)) * t_1);
                    	} else {
                    		tmp = -(x * (1.0 / tan(B))) + (1.0 / B);
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	t_0 = Float64(-Float64(x / B))
                    	t_1 = sqrt(Float64(1.0 / fma(F, F, 2.0)))
                    	tmp = 0.0
                    	if (F <= -1.05e+104)
                    		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
                    	elseif (F <= 7.8e-95)
                    		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * t_1));
                    	elseif (F <= 6.7e+106)
                    		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * t_1));
                    	else
                    		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / B));
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -1.05e+104], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.8e-95], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.7e+106], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$1), $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}
                    t_0 := -\frac{x}{B}\\
                    t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
                    \mathbf{if}\;F \leq -1.05 \cdot 10^{+104}:\\
                    \;\;\;\;t\_0 + \frac{-1}{\sin B}\\
                    
                    \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\
                    \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot t\_1\\
                    
                    \mathbf{elif}\;F \leq 6.7 \cdot 10^{+106}:\\
                    \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot t\_1\\
                    
                    \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 < -1.0499999999999999e104

                      1. Initial program 44.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 rewrites62.6%

                        \[\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 B around 0

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

                          \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
                      6. Applied rewrites38.4%

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

                        \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{-1}}{\sin B} \]
                      8. Step-by-step derivation
                        1. Applied rewrites74.7%

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

                        if -1.0499999999999999e104 < F < 7.8e-95

                        1. Initial program 98.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.f6498.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 rewrites98.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)}}} \]
                        5. Step-by-step derivation
                          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\color{blue}{B}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \]
                        8. Step-by-step derivation
                          1. Applied rewrites81.8%

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

                          if 7.8e-95 < F < 6.7e106

                          1. Initial program 96.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 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.f6495.9

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

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

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

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

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

                          if 6.7e106 < F

                          1. Initial program 44.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                            2. lift-sin.f6499.7

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

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                          5. Taylor expanded in B around 0

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B} \]
                          6. Step-by-step derivation
                            1. Applied rewrites73.9%

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

                          Alternative 10: 77.4% accurate, 1.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ t_1 := -\frac{x}{B}\\ t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{if}\;F \leq -1.05 \cdot 10^{+104}:\\ \;\;\;\;t\_1 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\ \;\;\;\;t\_0 + \frac{F}{B} \cdot t\_2\\ \mathbf{elif}\;F \leq 6.7 \cdot 10^{+106}:\\ \;\;\;\;t\_1 + \frac{F}{\sin B} \cdot t\_2\\ \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 (- (/ x B)))
                                  (t_2 (sqrt (/ 1.0 (fma F F 2.0)))))
                             (if (<= F -1.05e+104)
                               (+ t_1 (/ -1.0 (sin B)))
                               (if (<= F 7.8e-95)
                                 (+ t_0 (* (/ F B) t_2))
                                 (if (<= F 6.7e+106) (+ t_1 (* (/ F (sin B)) t_2)) (+ t_0 (/ 1.0 B)))))))
                          double code(double F, double B, double x) {
                          	double t_0 = -(x * (1.0 / tan(B)));
                          	double t_1 = -(x / B);
                          	double t_2 = sqrt((1.0 / fma(F, F, 2.0)));
                          	double tmp;
                          	if (F <= -1.05e+104) {
                          		tmp = t_1 + (-1.0 / sin(B));
                          	} else if (F <= 7.8e-95) {
                          		tmp = t_0 + ((F / B) * t_2);
                          	} else if (F <= 6.7e+106) {
                          		tmp = t_1 + ((F / sin(B)) * t_2);
                          	} 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 = Float64(-Float64(x / B))
                          	t_2 = sqrt(Float64(1.0 / fma(F, F, 2.0)))
                          	tmp = 0.0
                          	if (F <= -1.05e+104)
                          		tmp = Float64(t_1 + Float64(-1.0 / sin(B)));
                          	elseif (F <= 7.8e-95)
                          		tmp = Float64(t_0 + Float64(Float64(F / B) * t_2));
                          	elseif (F <= 6.7e+106)
                          		tmp = Float64(t_1 + Float64(Float64(F / sin(B)) * t_2));
                          	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[(x / B), $MachinePrecision])}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -1.05e+104], N[(t$95$1 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.8e-95], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.7e+106], N[(t$95$1 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$2), $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 := -\frac{x}{B}\\
                          t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
                          \mathbf{if}\;F \leq -1.05 \cdot 10^{+104}:\\
                          \;\;\;\;t\_1 + \frac{-1}{\sin B}\\
                          
                          \mathbf{elif}\;F \leq 7.8 \cdot 10^{-95}:\\
                          \;\;\;\;t\_0 + \frac{F}{B} \cdot t\_2\\
                          
                          \mathbf{elif}\;F \leq 6.7 \cdot 10^{+106}:\\
                          \;\;\;\;t\_1 + \frac{F}{\sin B} \cdot t\_2\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_0 + \frac{1}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if F < -1.0499999999999999e104

                            1. Initial program 44.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 rewrites62.6%

                              \[\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 B around 0

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

                                \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
                            6. Applied rewrites38.4%

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

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{-1}}{\sin B} \]
                            8. Step-by-step derivation
                              1. Applied rewrites74.7%

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

                              if -1.0499999999999999e104 < F < 7.8e-95

                              1. Initial program 98.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.f6498.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 rewrites98.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)}}} \]
                              5. Taylor expanded in B around 0

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{B}} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \]
                              6. Step-by-step derivation
                                1. Applied rewrites81.6%

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

                                if 7.8e-95 < F < 6.7e106

                                1. Initial program 96.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 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.f6495.9

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

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

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

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

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

                                if 6.7e106 < F

                                1. Initial program 44.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                  2. lift-sin.f6499.7

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                5. Taylor expanded in B around 0

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites73.9%

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

                                Alternative 11: 73.3% accurate, 1.8× speedup?

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

                                  1. Initial program 80.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                    2. lift-sin.f6479.7

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                  5. Taylor expanded in B around 0

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

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

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

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

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

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right) \cdot B} \]
                                    6. lower-*.f6482.0

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot \color{blue}{B}} \]
                                  8. 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{1}{\mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right) \cdot B} \]
                                    2. lift-*.f64N/A

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                                  9. Applied rewrites82.1%

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

                                  if -8.50000000000000044e-60 < x < 4.00000000000000015e-89

                                  1. Initial program 72.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 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.f6472.0

                                      \[\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 rewrites72.0%

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

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

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

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

                                Alternative 12: 73.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 -1.3 \cdot 10^{-59}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-89}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \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 -1.3e-59)
                                     t_0
                                     (if (<= x 4e-89)
                                       (+ (- (/ x B)) (* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0)))))
                                       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 <= -1.3e-59) {
                                		tmp = t_0;
                                	} else if (x <= 4e-89) {
                                		tmp = -(x / B) + ((F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0))));
                                	} 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 <= -1.3e-59)
                                		tmp = t_0;
                                	elseif (x <= 4e-89)
                                		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0)))));
                                	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, -1.3e-59], t$95$0, If[LessEqual[x, 4e-89], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $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 -1.3 \cdot 10^{-59}:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;x \leq 4 \cdot 10^{-89}:\\
                                \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < -1.29999999999999999e-59 or 4.00000000000000015e-89 < x

                                  1. Initial program 80.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                    2. lift-sin.f6479.7

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                  5. Taylor expanded in B around 0

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites81.6%

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

                                    if -1.29999999999999999e-59 < x < 4.00000000000000015e-89

                                    1. Initial program 72.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 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.f6472.0

                                        \[\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 rewrites72.0%

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

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

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

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

                                  Alternative 13: 64.4% accurate, 2.1× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.000122:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B \cdot \left(1 - 0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\ \end{array} \end{array} \]
                                  (FPCore (F B x)
                                   :precision binary64
                                   (if (<= B 0.000122)
                                     (+
                                      (- (/ x B))
                                      (/
                                       (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5))
                                       (* B (- 1.0 (* 0.16666666666666666 (* B B))))))
                                     (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 B))))
                                  double code(double F, double B, double x) {
                                  	double tmp;
                                  	if (B <= 0.000122) {
                                  		tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / (B * (1.0 - (0.16666666666666666 * (B * B)))));
                                  	} else {
                                  		tmp = -(x * (1.0 / tan(B))) + (1.0 / B);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(F, B, x)
                                  	tmp = 0.0
                                  	if (B <= 0.000122)
                                  		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / Float64(B * Float64(1.0 - Float64(0.16666666666666666 * Float64(B * 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[B, 0.000122], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[(B * N[(1.0 - N[(0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;B \leq 0.000122:\\
                                  \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B \cdot \left(1 - 0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if B < 1.21999999999999997e-4

                                    1. Initial program 73.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. 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 rewrites85.1%

                                      \[\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 B around 0

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

                                        \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
                                    6. Applied rewrites66.8%

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

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

                                        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{B \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {B}^{2}\right)}} \]
                                      2. fp-cancel-sign-sub-invN/A

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

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

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

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

                                        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{B \cdot \left(1 - \frac{1}{6} \cdot \left(B \cdot \color{blue}{B}\right)\right)} \]
                                      7. lift-*.f6457.8

                                        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B \cdot \left(1 - 0.16666666666666666 \cdot \left(B \cdot \color{blue}{B}\right)\right)} \]
                                    9. Applied rewrites57.8%

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

                                    if 1.21999999999999997e-4 < B

                                    1. Initial program 85.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                      2. lift-sin.f6456.5

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

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                    5. Taylor expanded in B around 0

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites51.2%

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

                                    Alternative 14: 57.4% accurate, 2.2× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.000116:\\ \;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{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 (<= B 0.000116)
                                       (/ (- (* (/ 1.0 (sqrt (fma F F 2.0))) F) x) B)
                                       (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 B))))
                                    double code(double F, double B, double x) {
                                    	double tmp;
                                    	if (B <= 0.000116) {
                                    		tmp = (((1.0 / sqrt(fma(F, F, 2.0))) * F) - x) / B;
                                    	} else {
                                    		tmp = -(x * (1.0 / tan(B))) + (1.0 / B);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(F, B, x)
                                    	tmp = 0.0
                                    	if (B <= 0.000116)
                                    		tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * F) - x) / 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[B, 0.000116], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $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}\;B \leq 0.000116:\\
                                    \;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if B < 1.16e-4

                                      1. Initial program 73.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 rewrites57.8%

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

                                          \[\leadsto \frac{-1 - x}{B} \]
                                        2. Taylor expanded in x around 0

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

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

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

                                            \[\leadsto \frac{\frac{\sqrt{1}}{\sqrt{2 + {F}^{2}}} \cdot F - x}{B} \]
                                          4. metadata-evalN/A

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

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

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

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

                                            \[\leadsto \frac{\frac{1}{\sqrt{F \cdot F + 2}} \cdot F - x}{B} \]
                                          9. lift-fma.f6457.7

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

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

                                        if 1.16e-4 < B

                                        1. Initial program 85.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                        3. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                          2. lift-sin.f6456.5

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

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                        5. Taylor expanded in B around 0

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites51.2%

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

                                        Alternative 15: 56.1% accurate, 2.3× speedup?

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

                                          1. Initial program 59.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. 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 rewrites74.2%

                                            \[\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 B around 0

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

                                              \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
                                          6. Applied rewrites51.7%

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

                                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{-1}}{\sin B} \]
                                          8. Step-by-step derivation
                                            1. Applied rewrites74.0%

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

                                            if -5.8e-19 < F < 7.00000000000000038e-11

                                            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 rewrites51.3%

                                              \[\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. lower-/.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.f6451.3

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

                                              \[\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 rewrites51.3%

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

                                              if 7.00000000000000038e-11 < F

                                              1. Initial program 60.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

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

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

                                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                              5. Taylor expanded in B around 0

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

                                                  \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{1}{\sin B} \]
                                              7. Applied rewrites74.1%

                                                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                                            10. Recombined 3 regimes into one program.
                                            11. Add Preprocessing

                                            Alternative 16: 56.0% accurate, 2.3× speedup?

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

                                              1. Initial program 59.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 rewrites38.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{-1 - x}{B} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites50.5%

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

                                                if -5.8e-19 < F < 7.00000000000000038e-11

                                                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 rewrites51.3%

                                                  \[\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. lower-/.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.f6451.3

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

                                                  \[\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 rewrites51.3%

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

                                                  if 7.00000000000000038e-11 < F

                                                  1. Initial program 60.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                                  3. Step-by-step derivation
                                                    1. lower-/.f64N/A

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

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

                                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                                  5. Taylor expanded in B around 0

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

                                                      \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{1}{\sin B} \]
                                                  7. Applied rewrites74.1%

                                                    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                                                10. Recombined 3 regimes into one program.
                                                11. Add Preprocessing

                                                Alternative 17: 50.4% accurate, 4.9× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-11}:\\ \;\;\;\;\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 -5.8e-19)
                                                   (/ (- -1.0 x) B)
                                                   (if (<= F 7e-11)
                                                     (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 <= -5.8e-19) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else if (F <= 7e-11) {
                                                		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 <= -5.8e-19)
                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                	elseif (F <= 7e-11)
                                                		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, -5.8e-19], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-11], 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 -5.8 \cdot 10^{-19}:\\
                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                
                                                \mathbf{elif}\;F \leq 7 \cdot 10^{-11}:\\
                                                \;\;\;\;\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 < -5.8e-19

                                                  1. Initial program 59.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 rewrites38.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{-1 - x}{B} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites50.5%

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

                                                    if -5.8e-19 < F < 7.00000000000000038e-11

                                                    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 rewrites51.3%

                                                      \[\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. lower-/.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.f6451.3

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

                                                      \[\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 rewrites51.3%

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

                                                      if 7.00000000000000038e-11 < F

                                                      1. Initial program 60.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 rewrites38.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{\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. *-commutativeN/A

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

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

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

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

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

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

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

                                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, -0.5, 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.8

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

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

                                                    Alternative 18: 50.4% accurate, 5.0× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;\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 -5.8e-19)
                                                       (/ (- -1.0 x) B)
                                                       (if (<= F 1.4) (fma (/ F B) (sqrt 0.5) (/ (- x) B)) (/ (- 1.0 x) B))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -5.8e-19) {
                                                    		tmp = (-1.0 - x) / B;
                                                    	} else if (F <= 1.4) {
                                                    		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 <= -5.8e-19)
                                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                                    	elseif (F <= 1.4)
                                                    		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, -5.8e-19], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4], 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 -5.8 \cdot 10^{-19}:\\
                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                    
                                                    \mathbf{elif}\;F \leq 1.4:\\
                                                    \;\;\;\;\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 < -5.8e-19

                                                      1. Initial program 59.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 rewrites38.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{-1 - x}{B} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites50.5%

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

                                                        if -5.8e-19 < F < 1.3999999999999999

                                                        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 rewrites51.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 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. lower-/.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.f6451.0

                                                            \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                                        7. Applied rewrites51.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 \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2}}, \frac{-x}{B}\right) \]
                                                        9. Step-by-step derivation
                                                          1. Applied rewrites51.0%

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

                                                          if 1.3999999999999999 < F

                                                          1. Initial program 59.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 rewrites38.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 rewrites49.6%

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

                                                          Alternative 19: 43.6% accurate, 6.3× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-172}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                          (FPCore (F B x)
                                                           :precision binary64
                                                           (if (<= F -5.8e-19)
                                                             (/ (- -1.0 x) B)
                                                             (if (<= F -3e-172)
                                                               (/ (* F (sqrt 0.5)) B)
                                                               (if (<= F 4.8e-68) (/ (- x) B) (/ (- 1.0 x) B)))))
                                                          double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= -5.8e-19) {
                                                          		tmp = (-1.0 - x) / B;
                                                          	} else if (F <= -3e-172) {
                                                          		tmp = (F * sqrt(0.5)) / B;
                                                          	} else if (F <= 4.8e-68) {
                                                          		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 <= (-5.8d-19)) then
                                                                  tmp = ((-1.0d0) - x) / b
                                                              else if (f <= (-3d-172)) then
                                                                  tmp = (f * sqrt(0.5d0)) / b
                                                              else if (f <= 4.8d-68) 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 <= -5.8e-19) {
                                                          		tmp = (-1.0 - x) / B;
                                                          	} else if (F <= -3e-172) {
                                                          		tmp = (F * Math.sqrt(0.5)) / B;
                                                          	} else if (F <= 4.8e-68) {
                                                          		tmp = -x / B;
                                                          	} else {
                                                          		tmp = (1.0 - x) / B;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          def code(F, B, x):
                                                          	tmp = 0
                                                          	if F <= -5.8e-19:
                                                          		tmp = (-1.0 - x) / B
                                                          	elif F <= -3e-172:
                                                          		tmp = (F * math.sqrt(0.5)) / B
                                                          	elif F <= 4.8e-68:
                                                          		tmp = -x / B
                                                          	else:
                                                          		tmp = (1.0 - x) / B
                                                          	return tmp
                                                          
                                                          function code(F, B, x)
                                                          	tmp = 0.0
                                                          	if (F <= -5.8e-19)
                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                          	elseif (F <= -3e-172)
                                                          		tmp = Float64(Float64(F * sqrt(0.5)) / B);
                                                          	elseif (F <= 4.8e-68)
                                                          		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 <= -5.8e-19)
                                                          		tmp = (-1.0 - x) / B;
                                                          	elseif (F <= -3e-172)
                                                          		tmp = (F * sqrt(0.5)) / B;
                                                          	elseif (F <= 4.8e-68)
                                                          		tmp = -x / B;
                                                          	else
                                                          		tmp = (1.0 - x) / B;
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          code[F_, B_, x_] := If[LessEqual[F, -5.8e-19], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3e-172], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.8e-68], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;F \leq -5.8 \cdot 10^{-19}:\\
                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                          
                                                          \mathbf{elif}\;F \leq -3 \cdot 10^{-172}:\\
                                                          \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\
                                                          
                                                          \mathbf{elif}\;F \leq 4.8 \cdot 10^{-68}:\\
                                                          \;\;\;\;\frac{-x}{B}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\frac{1 - x}{B}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 4 regimes
                                                          2. if F < -5.8e-19

                                                            1. Initial program 59.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 rewrites38.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{-1 - x}{B} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites50.5%

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

                                                              if -5.8e-19 < F < -2.99999999999999984e-172

                                                              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 rewrites52.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 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. lower-/.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{\frac{1}{2}}}{B} \]
                                                                2. metadata-evalN/A

                                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                                                3. metadata-evalN/A

                                                                  \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{B} \]
                                                                4. sqrt-unprodN/A

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

                                                                  \[\leadsto \frac{F \cdot \left(\sqrt{-1} \cdot \sqrt{\frac{-1}{2}}\right)}{B} \]
                                                                6. sqrt-unprodN/A

                                                                  \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{B} \]
                                                                7. metadata-evalN/A

                                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                                                8. metadata-evalN/A

                                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                                                9. lower-*.f64N/A

                                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                                                10. lower-sqrt.f64N/A

                                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                                                11. metadata-eval24.8

                                                                  \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]
                                                              10. Applied rewrites24.8%

                                                                \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]

                                                              if -2.99999999999999984e-172 < F < 4.79999999999999982e-68

                                                              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.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 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.f6440.7

                                                                  \[\leadsto \frac{-x}{B} \]
                                                              7. Applied rewrites40.7%

                                                                \[\leadsto \frac{-x}{B} \]

                                                              if 4.79999999999999982e-68 < F

                                                              1. Initial program 65.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 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.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 rewrites45.1%

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

                                                              Alternative 20: 43.3% accurate, 7.9× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{-111}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                              (FPCore (F B x)
                                                               :precision binary64
                                                               (if (<= F -5.6e-111)
                                                                 (/ (- -1.0 x) B)
                                                                 (if (<= F 4.8e-68) (/ (- x) B) (/ (- 1.0 x) B))))
                                                              double code(double F, double B, double x) {
                                                              	double tmp;
                                                              	if (F <= -5.6e-111) {
                                                              		tmp = (-1.0 - x) / B;
                                                              	} else if (F <= 4.8e-68) {
                                                              		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 <= (-5.6d-111)) then
                                                                      tmp = ((-1.0d0) - x) / b
                                                                  else if (f <= 4.8d-68) 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 <= -5.6e-111) {
                                                              		tmp = (-1.0 - x) / B;
                                                              	} else if (F <= 4.8e-68) {
                                                              		tmp = -x / B;
                                                              	} else {
                                                              		tmp = (1.0 - x) / B;
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              def code(F, B, x):
                                                              	tmp = 0
                                                              	if F <= -5.6e-111:
                                                              		tmp = (-1.0 - x) / B
                                                              	elif F <= 4.8e-68:
                                                              		tmp = -x / B
                                                              	else:
                                                              		tmp = (1.0 - x) / B
                                                              	return tmp
                                                              
                                                              function code(F, B, x)
                                                              	tmp = 0.0
                                                              	if (F <= -5.6e-111)
                                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                                              	elseif (F <= 4.8e-68)
                                                              		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 <= -5.6e-111)
                                                              		tmp = (-1.0 - x) / B;
                                                              	elseif (F <= 4.8e-68)
                                                              		tmp = -x / B;
                                                              	else
                                                              		tmp = (1.0 - x) / B;
                                                              	end
                                                              	tmp_2 = tmp;
                                                              end
                                                              
                                                              code[F_, B_, x_] := If[LessEqual[F, -5.6e-111], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.8e-68], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              \mathbf{if}\;F \leq -5.6 \cdot 10^{-111}:\\
                                                              \;\;\;\;\frac{-1 - x}{B}\\
                                                              
                                                              \mathbf{elif}\;F \leq 4.8 \cdot 10^{-68}:\\
                                                              \;\;\;\;\frac{-x}{B}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\frac{1 - x}{B}\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 3 regimes
                                                              2. if F < -5.5999999999999999e-111

                                                                1. Initial program 66.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 rewrites41.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 rewrites45.7%

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

                                                                  if -5.5999999999999999e-111 < F < 4.79999999999999982e-68

                                                                  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 rewrites51.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 \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.f6439.6

                                                                      \[\leadsto \frac{-x}{B} \]
                                                                  7. Applied rewrites39.6%

                                                                    \[\leadsto \frac{-x}{B} \]

                                                                  if 4.79999999999999982e-68 < F

                                                                  1. Initial program 65.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 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.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 rewrites45.1%

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

                                                                  Alternative 21: 37.0% accurate, 10.7× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{-111}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                  (FPCore (F B x)
                                                                   :precision binary64
                                                                   (if (<= F -5.6e-111) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                  double code(double F, double B, double x) {
                                                                  	double tmp;
                                                                  	if (F <= -5.6e-111) {
                                                                  		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 <= (-5.6d-111)) 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 <= -5.6e-111) {
                                                                  		tmp = (-1.0 - x) / B;
                                                                  	} else {
                                                                  		tmp = -x / B;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(F, B, x):
                                                                  	tmp = 0
                                                                  	if F <= -5.6e-111:
                                                                  		tmp = (-1.0 - x) / B
                                                                  	else:
                                                                  		tmp = -x / B
                                                                  	return tmp
                                                                  
                                                                  function code(F, B, x)
                                                                  	tmp = 0.0
                                                                  	if (F <= -5.6e-111)
                                                                  		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 <= -5.6e-111)
                                                                  		tmp = (-1.0 - x) / B;
                                                                  	else
                                                                  		tmp = -x / B;
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[F_, B_, x_] := If[LessEqual[F, -5.6e-111], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;F \leq -5.6 \cdot 10^{-111}:\\
                                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{-x}{B}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 2 regimes
                                                                  2. if F < -5.5999999999999999e-111

                                                                    1. Initial program 66.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 rewrites41.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 rewrites45.7%

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

                                                                      if -5.5999999999999999e-111 < F

                                                                      1. Initial program 82.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 rewrites45.5%

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

                                                                          \[\leadsto \frac{-x}{B} \]
                                                                      7. Applied rewrites32.1%

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

                                                                    Alternative 22: 29.6% accurate, 21.7× speedup?

                                                                    \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                                    (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                                    double code(double F, double B, double x) {
                                                                    	return -x / 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 = -x / b
                                                                    end function
                                                                    
                                                                    public static double code(double F, double B, double x) {
                                                                    	return -x / B;
                                                                    }
                                                                    
                                                                    def code(F, B, x):
                                                                    	return -x / B
                                                                    
                                                                    function code(F, B, x)
                                                                    	return Float64(Float64(-x) / B)
                                                                    end
                                                                    
                                                                    function tmp = code(F, B, x)
                                                                    	tmp = -x / B;
                                                                    end
                                                                    
                                                                    code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \frac{-x}{B}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Initial program 76.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 rewrites43.8%

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

                                                                        \[\leadsto \frac{-x}{B} \]
                                                                    7. Applied rewrites29.6%

                                                                      \[\leadsto \frac{-x}{B} \]
                                                                    8. Add Preprocessing

                                                                    Reproduce

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