VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.6% → 99.7%
Time: 7.3s
Alternatives: 24
Speedup: 1.8×

Specification

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

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 24 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.6% accurate, 1.0× speedup?

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

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

        \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. Applied rewrites56.1%

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

      if -4.0000000000000002e48 < F < 1e8

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

          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
        4. lower-unsound-/.f6485.4%

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

          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
        6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

      if 1e8 < F

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

          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
      5. Step-by-step derivation
        1. Applied rewrites56.6%

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

      Alternative 2: 99.7% accurate, 1.0× speedup?

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

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

            \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
        5. Step-by-step derivation
          1. Applied rewrites56.1%

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

          if -4.0000000000000002e48 < F < 1e8

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

              \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

          if 1e8 < F

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

              \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
          5. Step-by-step derivation
            1. Applied rewrites56.6%

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

          Alternative 3: 99.7% accurate, 1.2× speedup?

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

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

                \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
            5. Step-by-step derivation
              1. Applied rewrites56.1%

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

              if -4.9999999999999998e27 < F < 1e12

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

                  \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                4. lower-unsound-/.f6485.4%

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

                  \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
              6. Step-by-step derivation
                1. lift-fma.f64N/A

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

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

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

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

              if 1e12 < F

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

                  \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
              5. Step-by-step derivation
                1. Applied rewrites56.6%

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

              Alternative 4: 99.1% accurate, 1.2× speedup?

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

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

                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                5. Step-by-step derivation
                  1. Applied rewrites56.1%

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

                  if -5700 < F < 3.6000000000000002e-4

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

                      \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                    4. lower-unsound-/.f6485.4%

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

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                    6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                  6. Step-by-step derivation
                    1. lift-fma.f64N/A

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

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

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

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

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

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

                    if 3.6000000000000002e-4 < F

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

                        \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                      \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                    5. Step-by-step derivation
                      1. Applied rewrites56.6%

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

                    Alternative 5: 91.8% accurate, 1.3× speedup?

                    \[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -6800:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 110000000:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \]
                    (FPCore (F B x)
                      :precision binary64
                      (let* ((t_0 (/ x (tan B))))
                      (if (<= F -6800.0)
                        (- (/ -1.0 (sin B)) t_0)
                        (if (<= F 110000000.0)
                          (+
                           (- (* x (/ 1.0 (tan B))))
                           (*
                            (/ F B)
                            (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
                          (- (/ 1.0 (sin B)) t_0)))))
                    double code(double F, double B, double x) {
                    	double t_0 = x / tan(B);
                    	double tmp;
                    	if (F <= -6800.0) {
                    		tmp = (-1.0 / sin(B)) - t_0;
                    	} else if (F <= 110000000.0) {
                    		tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                    	} else {
                    		tmp = (1.0 / sin(B)) - t_0;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(f, b, x)
                    use fmin_fmax_functions
                        real(8), intent (in) :: f
                        real(8), intent (in) :: b
                        real(8), intent (in) :: x
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = x / tan(b)
                        if (f <= (-6800.0d0)) then
                            tmp = ((-1.0d0) / sin(b)) - t_0
                        else if (f <= 110000000.0d0) then
                            tmp = -(x * (1.0d0 / tan(b))) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
                        else
                            tmp = (1.0d0 / sin(b)) - t_0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double F, double B, double x) {
                    	double t_0 = x / Math.tan(B);
                    	double tmp;
                    	if (F <= -6800.0) {
                    		tmp = (-1.0 / Math.sin(B)) - t_0;
                    	} else if (F <= 110000000.0) {
                    		tmp = -(x * (1.0 / Math.tan(B))) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                    	} else {
                    		tmp = (1.0 / Math.sin(B)) - t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(F, B, x):
                    	t_0 = x / math.tan(B)
                    	tmp = 0
                    	if F <= -6800.0:
                    		tmp = (-1.0 / math.sin(B)) - t_0
                    	elif F <= 110000000.0:
                    		tmp = -(x * (1.0 / math.tan(B))) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
                    	else:
                    		tmp = (1.0 / math.sin(B)) - t_0
                    	return tmp
                    
                    function code(F, B, x)
                    	t_0 = Float64(x / tan(B))
                    	tmp = 0.0
                    	if (F <= -6800.0)
                    		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
                    	elseif (F <= 110000000.0)
                    		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
                    	else
                    		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(F, B, x)
                    	t_0 = x / tan(B);
                    	tmp = 0.0;
                    	if (F <= -6800.0)
                    		tmp = (-1.0 / sin(B)) - t_0;
                    	elseif (F <= 110000000.0)
                    		tmp = -(x * (1.0 / tan(B))) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
                    	else
                    		tmp = (1.0 / sin(B)) - t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6800.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 110000000.0], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    t_0 := \frac{x}{\tan B}\\
                    \mathbf{if}\;F \leq -6800:\\
                    \;\;\;\;\frac{-1}{\sin B} - t\_0\\
                    
                    \mathbf{elif}\;F \leq 110000000:\\
                    \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1}{\sin B} - t\_0\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -6800

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

                          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                      5. Step-by-step derivation
                        1. Applied rewrites56.1%

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

                        if -6800 < F < 1.1e8

                        1. Initial program 76.6%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Taylor expanded in B around 0

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

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

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

                        if 1.1e8 < F

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

                            \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                          \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                        5. Step-by-step derivation
                          1. Applied rewrites56.6%

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

                        Alternative 6: 90.1% accurate, 1.3× speedup?

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

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

                              \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                          5. Step-by-step derivation
                            1. Applied rewrites56.1%

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

                            if -26 < F < -1.42e-151

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

                                \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

                            if -1.42e-151 < F < 6.5000000000000002e-131

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

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

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

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

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

                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                              5. lower-sin.f6456.1%

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

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

                            if 6.5000000000000002e-131 < F < 9.2e11

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

                                \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                              4. lower-unsound-/.f6485.4%

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

                                \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                              6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                            6. Step-by-step derivation
                              1. lift-fma.f64N/A

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

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

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

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

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

                                \[\leadsto \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\color{blue}{B}} \]
                            10. Applied rewrites58.5%

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

                            if 9.2e11 < F

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

                                \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                              \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                            5. Step-by-step derivation
                              1. Applied rewrites56.6%

                                \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                            6. Recombined 5 regimes into one program.
                            7. Add Preprocessing

                            Alternative 7: 83.4% accurate, 1.4× speedup?

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

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

                                  \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

                                \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                              5. Step-by-step derivation
                                1. Applied rewrites56.1%

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

                                if -26 < F < -1.42e-151

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

                                if -1.42e-151 < F < 6.5000000000000002e-131

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

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

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

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

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

                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                  5. lower-sin.f6456.1%

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

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

                                if 6.5000000000000002e-131 < F < 9.2e11

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  4. lower-unsound-/.f6485.4%

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                                6. Step-by-step derivation
                                  1. lift-fma.f64N/A

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

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

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

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

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

                                    \[\leadsto \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\color{blue}{B}} \]
                                10. Applied rewrites58.5%

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

                                if 9.2e11 < F

                                1. Initial program 76.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. lower-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 \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {B}^{2}\right)}} \]
                                6. Step-by-step derivation
                                  1. lower-*.f64N/A

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

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{\color{blue}{2}}\right)} \]
                                  4. lower-pow.f6455.6%

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) \]
                                  8. mult-flip-revN/A

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                  10. sub-flip-reverseN/A

                                    \[\leadsto \color{blue}{\frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} - \frac{x}{\tan B}} \]
                                9. Applied rewrites55.7%

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

                              Alternative 8: 77.7% accurate, 1.4× speedup?

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

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

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

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

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

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

                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                  5. lower-sin.f6456.1%

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

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

                                if -2.5000000000000001e-33 < x < 5.1999999999999996e-44

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

                              Alternative 9: 77.5% accurate, 1.5× speedup?

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

                                1. Initial program 76.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. lower-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 \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {B}^{2}\right)}} \]
                                6. Step-by-step derivation
                                  1. lower-*.f64N/A

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

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{\color{blue}{2}}\right)} \]
                                  4. lower-pow.f6455.6%

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) \]
                                  8. mult-flip-revN/A

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                  10. sub-flip-reverseN/A

                                    \[\leadsto \color{blue}{\frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} - \frac{x}{\tan B}} \]
                                9. Applied rewrites55.7%

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

                                if -2.5000000000000001e-33 < x < 3.7e7

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

                              Alternative 10: 77.5% accurate, 1.8× speedup?

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

                                1. Initial program 76.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. lower-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 \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {B}^{2}\right)}} \]
                                6. Step-by-step derivation
                                  1. lower-*.f64N/A

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

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{\color{blue}{2}}\right)} \]
                                  4. lower-pow.f6455.6%

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) \]
                                  8. mult-flip-revN/A

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                  10. sub-flip-reverseN/A

                                    \[\leadsto \color{blue}{\frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} - \frac{x}{\tan B}} \]
                                9. Applied rewrites55.7%

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

                                if -2.5000000000000001e-33 < x < 3.7e7

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  4. lower-unsound-/.f6485.4%

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                                6. Step-by-step derivation
                                  1. lift-fma.f64N/A

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

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

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

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

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

                                    \[\leadsto \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\color{blue}{B}} \]
                                10. Applied rewrites58.5%

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

                              Alternative 11: 68.8% accurate, 1.7× speedup?

                              \[\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l} \mathbf{if}\;\left|B\right| \leq 8.4 \cdot 10^{+19}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{\left|B\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\left|B\right| \cdot \left|B\right|, -0.16666666666666666, 1\right) \cdot \left|B\right|} - \frac{x}{\tan \left(\left|B\right|\right)}\\ \end{array} \]
                              (FPCore (F B x)
                                :precision binary64
                                (*
                               (copysign 1.0 B)
                               (if (<= (fabs B) 8.4e+19)
                                 (/ (- (/ F (sqrt (+ 2.0 (fma 2.0 x (pow F 2.0))))) x) (fabs B))
                                 (-
                                  (/
                                   1.0
                                   (*
                                    (fma (* (fabs B) (fabs B)) -0.16666666666666666 1.0)
                                    (fabs B)))
                                  (/ x (tan (fabs B)))))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (fabs(B) <= 8.4e+19) {
                              		tmp = ((F / sqrt((2.0 + fma(2.0, x, pow(F, 2.0))))) - x) / fabs(B);
                              	} else {
                              		tmp = (1.0 / (fma((fabs(B) * fabs(B)), -0.16666666666666666, 1.0) * fabs(B))) - (x / tan(fabs(B)));
                              	}
                              	return copysign(1.0, B) * tmp;
                              }
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (abs(B) <= 8.4e+19)
                              		tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + fma(2.0, x, (F ^ 2.0))))) - x) / abs(B));
                              	else
                              		tmp = Float64(Float64(1.0 / Float64(fma(Float64(abs(B) * abs(B)), -0.16666666666666666, 1.0) * abs(B))) - Float64(x / tan(abs(B))));
                              	end
                              	return Float64(copysign(1.0, B) * tmp)
                              end
                              
                              code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 8.4e+19], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(N[(N[Abs[B], $MachinePrecision] * N[Abs[B], $MachinePrecision]), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * N[Abs[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                              
                              \mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
                              \mathbf{if}\;\left|B\right| \leq 8.4 \cdot 10^{+19}:\\
                              \;\;\;\;\frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{\left|B\right|}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{1}{\mathsf{fma}\left(\left|B\right| \cdot \left|B\right|, -0.16666666666666666, 1\right) \cdot \left|B\right|} - \frac{x}{\tan \left(\left|B\right|\right)}\\
                              
                              
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if B < 8.4e19

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  4. lower-unsound-/.f6485.4%

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                                6. Step-by-step derivation
                                  1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                  7. lower-pow.f6445.0%

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                10. Applied rewrites45.0%

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

                                if 8.4e19 < B

                                1. Initial program 76.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. lower-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 \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {B}^{2}\right)}} \]
                                6. Step-by-step derivation
                                  1. lower-*.f64N/A

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

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{\color{blue}{2}}\right)} \]
                                  4. lower-pow.f6455.6%

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) \]
                                  8. mult-flip-revN/A

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

                                    \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                  10. sub-flip-reverseN/A

                                    \[\leadsto \color{blue}{\frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} - \frac{x}{\tan B}} \]
                                9. Applied rewrites55.7%

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

                              Alternative 12: 67.5% accurate, 1.8× speedup?

                              \[\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l} \mathbf{if}\;\left|B\right| \leq 7.6 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{\left|B\right|}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\left|B\right| \cdot F}, F, \frac{-x}{\tan \left(\left|B\right|\right)}\right)\\ \end{array} \]
                              (FPCore (F B x)
                                :precision binary64
                                (*
                               (copysign 1.0 B)
                               (if (<= (fabs B) 7.6e+18)
                                 (/ (- (/ F (sqrt (+ 2.0 (fma 2.0 x (pow F 2.0))))) x) (fabs B))
                                 (fma (/ 1.0 (* (fabs B) F)) F (/ (- x) (tan (fabs B)))))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (fabs(B) <= 7.6e+18) {
                              		tmp = ((F / sqrt((2.0 + fma(2.0, x, pow(F, 2.0))))) - x) / fabs(B);
                              	} else {
                              		tmp = fma((1.0 / (fabs(B) * F)), F, (-x / tan(fabs(B))));
                              	}
                              	return copysign(1.0, B) * tmp;
                              }
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (abs(B) <= 7.6e+18)
                              		tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + fma(2.0, x, (F ^ 2.0))))) - x) / abs(B));
                              	else
                              		tmp = fma(Float64(1.0 / Float64(abs(B) * F)), F, Float64(Float64(-x) / tan(abs(B))));
                              	end
                              	return Float64(copysign(1.0, B) * tmp)
                              end
                              
                              code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 7.6e+18], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Abs[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                              
                              \mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
                              \mathbf{if}\;\left|B\right| \leq 7.6 \cdot 10^{+18}:\\
                              \;\;\;\;\frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{\left|B\right|}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(\frac{1}{\left|B\right| \cdot F}, F, \frac{-x}{\tan \left(\left|B\right|\right)}\right)\\
                              
                              
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if B < 7.6e18

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  4. lower-unsound-/.f6485.4%

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                                6. Step-by-step derivation
                                  1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                  7. lower-pow.f6445.0%

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                10. Applied rewrites45.0%

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

                                if 7.6e18 < B

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{F \cdot \color{blue}{\sin B}}, F, \frac{-x}{\tan B}\right) \]
                                  3. lower-sin.f6452.9%

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{B \cdot \color{blue}{F}}, F, \frac{-x}{\tan B}\right) \]
                                8. Step-by-step derivation
                                  1. lower-*.f6450.6%

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{B \cdot F}, F, \frac{-x}{\tan B}\right) \]
                                9. Applied rewrites50.6%

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

                              Alternative 13: 52.4% accurate, 2.7× speedup?

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

                                1. Initial program 76.6%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(\frac{1}{F} + \frac{x}{F}\right)\right)}{B} \]
                                  5. lower-/.f6429.0%

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

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

                                if -1.16e171 < F < 9.5000000000000009e130

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  4. lower-unsound-/.f6485.4%

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                                6. Step-by-step derivation
                                  1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                  7. lower-pow.f6445.0%

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                10. Applied rewrites45.0%

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

                                if 9.5000000000000009e130 < F

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  4. lower-unsound-/.f6485.4%

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                  2. lower-sin.f6416.6%

                                    \[\leadsto \frac{1}{\sin B} \]
                                8. Applied rewrites16.6%

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

                              Alternative 14: 52.1% accurate, 2.7× speedup?

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

                                1. Initial program 76.6%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(\frac{1}{F} + \frac{x}{F}\right)\right)}{B} \]
                                  5. lower-/.f6429.0%

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

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

                                if -1.16e171 < F < 6.0000000000000001e85

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

                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  4. lower-unsound-/.f6485.4%

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                                6. Step-by-step derivation
                                  1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                  7. lower-pow.f6445.0%

                                    \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                10. Applied rewrites45.0%

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

                                if 6.0000000000000001e85 < F

                                1. Initial program 76.6%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                  4. lower-/.f6429.1%

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

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

                              Alternative 15: 51.9% accurate, 2.7× speedup?

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

                                1. Initial program 76.6%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto -1 \cdot \left(F \cdot \left(\frac{1}{B \cdot F} + \frac{x}{B \cdot \color{blue}{F}}\right)\right) \]
                                  7. lower-*.f6427.7%

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

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

                                if -1.9199999999999999e146 < F < 9.9999999999999995e123

                                1. Initial program 76.6%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Taylor expanded in B around 0

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]
                                5. Step-by-step derivation
                                  1. Applied rewrites45.0%

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

                                  if 9.9999999999999995e123 < F

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                    4. lower-/.f6429.1%

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

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

                                Alternative 16: 51.8% accurate, 3.0× speedup?

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

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(\frac{1}{F} + \frac{x}{F}\right)\right)}{B} \]
                                    5. lower-/.f6429.0%

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

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

                                  if -5700 < F < 3.6000000000000002e-4

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

                                    \[\leadsto \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B} \]
                                  6. Step-by-step derivation
                                    1. lower-*.f6430.7%

                                      \[\leadsto \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B} \]
                                  7. Applied rewrites30.7%

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

                                  if 3.6000000000000002e-4 < F

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                    4. lower-/.f6429.1%

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

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

                                Alternative 17: 50.7% accurate, 2.4× speedup?

                                \[\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l} \mathbf{if}\;\left|B\right| \leq 4.5 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{\left|B\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin \left(\left|B\right|\right)}\\ \end{array} \]
                                (FPCore (F B x)
                                  :precision binary64
                                  (*
                                 (copysign 1.0 B)
                                 (if (<= (fabs B) 4.5e+20)
                                   (/ (- (/ F (sqrt (+ 2.0 (fma 2.0 x (pow F 2.0))))) x) (fabs B))
                                   (/ -1.0 (sin (fabs B))))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (fabs(B) <= 4.5e+20) {
                                		tmp = ((F / sqrt((2.0 + fma(2.0, x, pow(F, 2.0))))) - x) / fabs(B);
                                	} else {
                                		tmp = -1.0 / sin(fabs(B));
                                	}
                                	return copysign(1.0, B) * tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (abs(B) <= 4.5e+20)
                                		tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + fma(2.0, x, (F ^ 2.0))))) - x) / abs(B));
                                	else
                                		tmp = Float64(-1.0 / sin(abs(B)));
                                	end
                                	return Float64(copysign(1.0, B) * tmp)
                                end
                                
                                code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 4.5e+20], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                
                                \mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
                                \mathbf{if}\;\left|B\right| \leq 4.5 \cdot 10^{+20}:\\
                                \;\;\;\;\frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{\left|B\right|}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{-1}{\sin \left(\left|B\right|\right)}\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if B < 4.5e20

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

                                      \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                    4. lower-unsound-/.f6485.4%

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

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                    6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}, F, \frac{-x}{\tan B}\right) \]
                                  6. Step-by-step derivation
                                    1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                    7. lower-pow.f6445.0%

                                      \[\leadsto \frac{\frac{F}{\sqrt{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B} \]
                                  10. Applied rewrites45.0%

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

                                  if 4.5e20 < B

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

                                      \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                    4. lower-unsound-/.f6485.4%

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

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sin B}{\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}}, F, \frac{-x}{\tan B}\right) \]
                                    6. sqr-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                    2. lower-sin.f6416.7%

                                      \[\leadsto \frac{-1}{\sin B} \]
                                  8. Applied rewrites16.7%

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

                                Alternative 18: 44.5% accurate, 4.4× speedup?

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

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(\frac{1}{F} + \frac{x}{F}\right)\right)}{B} \]
                                    5. lower-/.f6429.0%

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

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

                                  if -1e-58 < F < 7.7999999999999996e-47

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                  6. Step-by-step derivation
                                    1. lower-*.f6430.0%

                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                  7. Applied rewrites30.0%

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

                                  if 7.7999999999999996e-47 < F

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                    4. lower-/.f6429.1%

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

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

                                Alternative 19: 38.1% accurate, 4.4× speedup?

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

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

                                    \[\leadsto \frac{-1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  7. Step-by-step derivation
                                    1. lower-/.f6421.8%

                                      \[\leadsto \frac{-1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  8. Applied rewrites21.8%

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

                                  if -1e-58 < F < 7.7999999999999996e-47

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                  6. Step-by-step derivation
                                    1. lower-*.f6430.0%

                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                  7. Applied rewrites30.0%

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

                                  if 7.7999999999999996e-47 < F

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                    4. lower-/.f6429.1%

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

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

                                Alternative 20: 32.2% accurate, 4.8× speedup?

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

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

                                    \[\leadsto \frac{-1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  7. Step-by-step derivation
                                    1. lower-/.f6421.8%

                                      \[\leadsto \frac{-1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  8. Applied rewrites21.8%

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

                                  if -1e-58 < F < 7.7999999999999996e-47

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                  6. Step-by-step derivation
                                    1. lower-*.f6430.0%

                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                  7. Applied rewrites30.0%

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

                                  if 7.7999999999999996e-47 < F

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

                                    \[\leadsto \frac{1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  7. Step-by-step derivation
                                    1. lower-/.f6421.9%

                                      \[\leadsto \frac{1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  8. Applied rewrites21.9%

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

                                Alternative 21: 32.1% accurate, 5.6× speedup?

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

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

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

                                    \[\leadsto \frac{-1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  7. Step-by-step derivation
                                    1. lower-/.f6421.8%

                                      \[\leadsto \frac{-1}{F} \cdot \frac{F}{B} - \frac{x}{B} \]
                                  8. Applied rewrites21.8%

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

                                  if -1e-58 < F < 8.9999999999999999e136

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

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

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

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

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

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

                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                  6. Step-by-step derivation
                                    1. lower-*.f6430.0%

                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                  7. Applied rewrites30.0%

                                    \[\leadsto \frac{-1 \cdot x}{B} \]

                                  if 8.9999999999999999e136 < F

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                  3. Step-by-step derivation
                                    1. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    2. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    3. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites45.0%

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]
                                  5. Taylor expanded in F around -inf

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                  6. Step-by-step derivation
                                    1. lower-/.f6410.5%

                                      \[\leadsto \frac{-1}{B} \]
                                  7. Applied rewrites10.5%

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                  8. Taylor expanded in F around inf

                                    \[\leadsto \frac{1}{\color{blue}{B}} \]
                                  9. Step-by-step derivation
                                    1. lower-/.f6410.1%

                                      \[\leadsto \frac{1}{B} \]
                                  10. Applied rewrites10.1%

                                    \[\leadsto \frac{1}{\color{blue}{B}} \]
                                3. Recombined 3 regimes into one program.
                                4. Add Preprocessing

                                Alternative 22: 30.9% accurate, 7.9× speedup?

                                \[\begin{array}{l} t_0 := \frac{-1 \cdot x}{B}\\ \mathbf{if}\;x \leq -6.2 \cdot 10^{-99}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-186}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                (FPCore (F B x)
                                  :precision binary64
                                  (let* ((t_0 (/ (* -1.0 x) B)))
                                  (if (<= x -6.2e-99) t_0 (if (<= x 6e-186) (/ -1.0 B) t_0))))
                                double code(double F, double B, double x) {
                                	double t_0 = (-1.0 * x) / B;
                                	double tmp;
                                	if (x <= -6.2e-99) {
                                		tmp = t_0;
                                	} else if (x <= 6e-186) {
                                		tmp = -1.0 / B;
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(f, b, x)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: f
                                    real(8), intent (in) :: b
                                    real(8), intent (in) :: x
                                    real(8) :: t_0
                                    real(8) :: tmp
                                    t_0 = ((-1.0d0) * x) / b
                                    if (x <= (-6.2d-99)) then
                                        tmp = t_0
                                    else if (x <= 6d-186) then
                                        tmp = (-1.0d0) / b
                                    else
                                        tmp = t_0
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double F, double B, double x) {
                                	double t_0 = (-1.0 * x) / B;
                                	double tmp;
                                	if (x <= -6.2e-99) {
                                		tmp = t_0;
                                	} else if (x <= 6e-186) {
                                		tmp = -1.0 / B;
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                def code(F, B, x):
                                	t_0 = (-1.0 * x) / B
                                	tmp = 0
                                	if x <= -6.2e-99:
                                		tmp = t_0
                                	elif x <= 6e-186:
                                		tmp = -1.0 / B
                                	else:
                                		tmp = t_0
                                	return tmp
                                
                                function code(F, B, x)
                                	t_0 = Float64(Float64(-1.0 * x) / B)
                                	tmp = 0.0
                                	if (x <= -6.2e-99)
                                		tmp = t_0;
                                	elseif (x <= 6e-186)
                                		tmp = Float64(-1.0 / B);
                                	else
                                		tmp = t_0;
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(F, B, x)
                                	t_0 = (-1.0 * x) / B;
                                	tmp = 0.0;
                                	if (x <= -6.2e-99)
                                		tmp = t_0;
                                	elseif (x <= 6e-186)
                                		tmp = -1.0 / B;
                                	else
                                		tmp = t_0;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[x, -6.2e-99], t$95$0, If[LessEqual[x, 6e-186], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
                                
                                \begin{array}{l}
                                t_0 := \frac{-1 \cdot x}{B}\\
                                \mathbf{if}\;x \leq -6.2 \cdot 10^{-99}:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;x \leq 6 \cdot 10^{-186}:\\
                                \;\;\;\;\frac{-1}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < -6.1999999999999997e-99 or 6.0000000000000003e-186 < x

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                  3. Step-by-step derivation
                                    1. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    2. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    3. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites45.0%

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]
                                  5. Taylor expanded in F around 0

                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                  6. Step-by-step derivation
                                    1. lower-*.f6430.0%

                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                  7. Applied rewrites30.0%

                                    \[\leadsto \frac{-1 \cdot x}{B} \]

                                  if -6.1999999999999997e-99 < x < 6.0000000000000003e-186

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                  3. Step-by-step derivation
                                    1. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    2. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    3. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites45.0%

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]
                                  5. Taylor expanded in F around -inf

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                  6. Step-by-step derivation
                                    1. lower-/.f6410.5%

                                      \[\leadsto \frac{-1}{B} \]
                                  7. Applied rewrites10.5%

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                3. Recombined 2 regimes into one program.
                                4. Add Preprocessing

                                Alternative 23: 17.7% accurate, 14.2× speedup?

                                \[\begin{array}{l} \mathbf{if}\;F \leq 4.2 \cdot 10^{-175}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
                                (FPCore (F B x)
                                  :precision binary64
                                  (if (<= F 4.2e-175) (/ -1.0 B) (/ 1.0 B)))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= 4.2e-175) {
                                		tmp = -1.0 / B;
                                	} else {
                                		tmp = 1.0 / 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 <= 4.2d-175) then
                                        tmp = (-1.0d0) / b
                                    else
                                        tmp = 1.0d0 / b
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= 4.2e-175) {
                                		tmp = -1.0 / B;
                                	} else {
                                		tmp = 1.0 / B;
                                	}
                                	return tmp;
                                }
                                
                                def code(F, B, x):
                                	tmp = 0
                                	if F <= 4.2e-175:
                                		tmp = -1.0 / B
                                	else:
                                		tmp = 1.0 / B
                                	return tmp
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= 4.2e-175)
                                		tmp = Float64(-1.0 / B);
                                	else
                                		tmp = Float64(1.0 / B);
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(F, B, x)
                                	tmp = 0.0;
                                	if (F <= 4.2e-175)
                                		tmp = -1.0 / B;
                                	else
                                		tmp = 1.0 / B;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, 4.2e-175], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
                                
                                \begin{array}{l}
                                \mathbf{if}\;F \leq 4.2 \cdot 10^{-175}:\\
                                \;\;\;\;\frac{-1}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1}{B}\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if F < 4.2e-175

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                  3. Step-by-step derivation
                                    1. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    2. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    3. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites45.0%

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]
                                  5. Taylor expanded in F around -inf

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                  6. Step-by-step derivation
                                    1. lower-/.f6410.5%

                                      \[\leadsto \frac{-1}{B} \]
                                  7. Applied rewrites10.5%

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]

                                  if 4.2e-175 < F

                                  1. Initial program 76.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                  3. Step-by-step derivation
                                    1. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    2. metadata-evalN/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                    3. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites45.0%

                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]
                                  5. Taylor expanded in F around -inf

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                  6. Step-by-step derivation
                                    1. lower-/.f6410.5%

                                      \[\leadsto \frac{-1}{B} \]
                                  7. Applied rewrites10.5%

                                    \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                  8. Taylor expanded in F around inf

                                    \[\leadsto \frac{1}{\color{blue}{B}} \]
                                  9. Step-by-step derivation
                                    1. lower-/.f6410.1%

                                      \[\leadsto \frac{1}{B} \]
                                  10. Applied rewrites10.1%

                                    \[\leadsto \frac{1}{\color{blue}{B}} \]
                                3. Recombined 2 regimes into one program.
                                4. Add Preprocessing

                                Alternative 24: 10.5% accurate, 25.4× speedup?

                                \[\frac{-1}{B} \]
                                (FPCore (F B x)
                                  :precision binary64
                                  (/ -1.0 B))
                                double code(double F, double B, double x) {
                                	return -1.0 / B;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(f, b, x)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: f
                                    real(8), intent (in) :: b
                                    real(8), intent (in) :: x
                                    code = (-1.0d0) / b
                                end function
                                
                                public static double code(double F, double B, double x) {
                                	return -1.0 / B;
                                }
                                
                                def code(F, B, x):
                                	return -1.0 / B
                                
                                function code(F, B, x)
                                	return Float64(-1.0 / B)
                                end
                                
                                function tmp = code(F, B, x)
                                	tmp = -1.0 / B;
                                end
                                
                                code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                                
                                \frac{-1}{B}
                                
                                Derivation
                                1. Initial program 76.6%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Taylor expanded in B around 0

                                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                3. Step-by-step derivation
                                  1. metadata-evalN/A

                                    \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                  2. metadata-evalN/A

                                    \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                                  3. lower-/.f64N/A

                                    \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{\color{blue}{B}} \]
                                4. Applied rewrites45.0%

                                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]
                                5. Taylor expanded in F around -inf

                                  \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                6. Step-by-step derivation
                                  1. lower-/.f6410.5%

                                    \[\leadsto \frac{-1}{B} \]
                                7. Applied rewrites10.5%

                                  \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                8. Add Preprocessing

                                Reproduce

                                ?
                                herbie shell --seed 2025210 
                                (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))))))