VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.4% → 99.6%
Time: 7.3s
Alternatives: 24
Speedup: 2.2×

Specification

?
\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Sampling outcomes in binary64 precision:

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

\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Alternative 1: 99.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+17}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 51.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e17 < F < 1.15e24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e24 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+17}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+24}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right) + 2 \cdot x\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -400000000:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 51.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -4e8 < F < 2e24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e24 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -400000000:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -400000000:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 51.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -4e8 < F < 1.49999999999999997e24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.49999999999999997e24 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -400000000:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 90.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 54.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000009e-28 < F < 1.15e24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e24 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+24}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot {\left(\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}\\ t_1 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t\_1 + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\ \mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot t\_0}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+24}:\\ \;\;\;\;t\_1 + \frac{F}{B} \cdot \frac{1}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (sqrt (+ 2.0 (fma 2.0 x (* F F))))) (t_1 (* x (/ -1.0 (tan B)))))
   (if (<= F -1.35e+154)
     (+
      t_1
      (/
       -1.0
       (*
        B
        (+
         1.0
         (*
          (* B B)
          (- (* 0.008333333333333333 (* B B)) 0.16666666666666666))))))
     (if (<= F -9.8e-29)
       (+ (- (/ x B)) (/ F (* (sin B) t_0)))
       (if (<= F 1.15e+24)
         (+ t_1 (* (/ F B) (/ 1.0 t_0)))
         (/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = sqrt((2.0 + fma(2.0, x, (F * F))));
	double t_1 = x * (-1.0 / tan(B));
	double tmp;
	if (F <= -1.35e+154) {
		tmp = t_1 + (-1.0 / (B * (1.0 + ((B * B) * ((0.008333333333333333 * (B * B)) - 0.16666666666666666)))));
	} else if (F <= -9.8e-29) {
		tmp = -(x / B) + (F / (sin(B) * t_0));
	} else if (F <= 1.15e+24) {
		tmp = t_1 + ((F / B) * (1.0 / t_0));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	t_0 = sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))
	t_1 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (F <= -1.35e+154)
		tmp = Float64(t_1 + Float64(-1.0 / Float64(B * Float64(1.0 + Float64(Float64(B * B) * Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666))))));
	elseif (F <= -9.8e-29)
		tmp = Float64(Float64(-Float64(x / B)) + Float64(F / Float64(sin(B) * t_0)));
	elseif (F <= 1.15e+24)
		tmp = Float64(t_1 + Float64(Float64(F / B) * Float64(1.0 / t_0)));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35e+154], N[(t$95$1 + N[(-1.0 / N[(B * N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.8e-29], N[((-N[(x / B), $MachinePrecision]) + N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e+24], N[(t$95$1 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_1 + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\

\mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot t\_0}\\

\mathbf{elif}\;F \leq 1.15 \cdot 10^{+24}:\\
\;\;\;\;t\_1 + \frac{F}{B} \cdot \frac{1}{t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.35000000000000003e154

    1. Initial program 31.8%

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \color{blue}{\left(1 + {B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)\right)}} \]
    7. 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}{{B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)}\right)} \]
      2. lower-+.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}\right)\right)} \]
      9. lift-*.f6481.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)} \]
    8. Applied rewrites81.7%

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

    if -1.35000000000000003e154 < F < -9.7999999999999997e-29

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.7999999999999997e-29 < F < 1.15e24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e24 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\ \mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.0% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}\\ t_1 := x \cdot \frac{-1}{\tan B}\\ t_2 := -\frac{x}{B}\\ \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t\_1 + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\ \mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\ \;\;\;\;t\_2 + \frac{F}{\sin B \cdot t\_0}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+25}:\\ \;\;\;\;t\_1 + \frac{F}{B} \cdot \frac{1}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;t\_2 + {\sin B}^{-1}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))
        (t_1 (* x (/ -1.0 (tan B))))
        (t_2 (- (/ x B))))
   (if (<= F -1.35e+154)
     (+
      t_1
      (/
       -1.0
       (*
        B
        (+
         1.0
         (*
          (* B B)
          (- (* 0.008333333333333333 (* B B)) 0.16666666666666666))))))
     (if (<= F -9.8e-29)
       (+ t_2 (/ F (* (sin B) t_0)))
       (if (<= F 7.5e+25)
         (+ t_1 (* (/ F B) (/ 1.0 t_0)))
         (+ t_2 (pow (sin B) -1.0)))))))
double code(double F, double B, double x) {
	double t_0 = sqrt((2.0 + fma(2.0, x, (F * F))));
	double t_1 = x * (-1.0 / tan(B));
	double t_2 = -(x / B);
	double tmp;
	if (F <= -1.35e+154) {
		tmp = t_1 + (-1.0 / (B * (1.0 + ((B * B) * ((0.008333333333333333 * (B * B)) - 0.16666666666666666)))));
	} else if (F <= -9.8e-29) {
		tmp = t_2 + (F / (sin(B) * t_0));
	} else if (F <= 7.5e+25) {
		tmp = t_1 + ((F / B) * (1.0 / t_0));
	} else {
		tmp = t_2 + pow(sin(B), -1.0);
	}
	return tmp;
}
function code(F, B, x)
	t_0 = sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))
	t_1 = Float64(x * Float64(-1.0 / tan(B)))
	t_2 = Float64(-Float64(x / B))
	tmp = 0.0
	if (F <= -1.35e+154)
		tmp = Float64(t_1 + Float64(-1.0 / Float64(B * Float64(1.0 + Float64(Float64(B * B) * Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666))))));
	elseif (F <= -9.8e-29)
		tmp = Float64(t_2 + Float64(F / Float64(sin(B) * t_0)));
	elseif (F <= 7.5e+25)
		tmp = Float64(t_1 + Float64(Float64(F / B) * Float64(1.0 / t_0)));
	else
		tmp = Float64(t_2 + (sin(B) ^ -1.0));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.35e+154], N[(t$95$1 + N[(-1.0 / N[(B * N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.8e-29], N[(t$95$2 + N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e+25], N[(t$95$1 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
t_2 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_1 + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\

\mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\
\;\;\;\;t\_2 + \frac{F}{\sin B \cdot t\_0}\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{+25}:\\
\;\;\;\;t\_1 + \frac{F}{B} \cdot \frac{1}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;t\_2 + {\sin B}^{-1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.35000000000000003e154

    1. Initial program 31.8%

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \color{blue}{\left(1 + {B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)\right)}} \]
    7. 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}{{B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)}\right)} \]
      2. lower-+.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}\right)\right)} \]
      9. lift-*.f6481.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)} \]
    8. Applied rewrites81.7%

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

    if -1.35000000000000003e154 < F < -9.7999999999999997e-29

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.7999999999999997e-29 < F < 7.49999999999999993e25

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999993e25 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    9. Taylor expanded in F around inf

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    10. Step-by-step derivation
      1. inv-powN/A

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

        \[\leadsto \left(-\frac{x}{B}\right) + {\sin B}^{\color{blue}{-1}} \]
      3. lift-sin.f6480.9

        \[\leadsto \left(-\frac{x}{B}\right) + {\sin B}^{-1} \]
    11. Applied rewrites80.9%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{{\sin B}^{-1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification87.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\ \mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+25}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 90.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 54.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000009e-28 < F < 1.15e24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e24 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 90.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\

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

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


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

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000009e-28 < F < 1.15e24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e24 < F

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.5% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}\\ t_1 := x \cdot \frac{-1}{\tan B}\\ t_2 := \left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot t\_0}\\ \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t\_1 + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\ \mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-61}:\\ \;\;\;\;t\_1 + \frac{F}{B} \cdot \frac{1}{t\_0}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+159}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))
        (t_1 (* x (/ -1.0 (tan B))))
        (t_2 (+ (- (/ x B)) (/ F (* (sin B) t_0)))))
   (if (<= F -1.35e+154)
     (+
      t_1
      (/
       -1.0
       (*
        B
        (+
         1.0
         (*
          (* B B)
          (- (* 0.008333333333333333 (* B B)) 0.16666666666666666))))))
     (if (<= F -9.8e-29)
       t_2
       (if (<= F 8.2e-61)
         (+ t_1 (* (/ F B) (/ 1.0 t_0)))
         (if (<= F 2.7e+159)
           t_2
           (/ (- (+ 1.0 (* -0.5 (/ (+ 2.0 (* 2.0 x)) (* F F)))) x) B)))))))
double code(double F, double B, double x) {
	double t_0 = sqrt((2.0 + fma(2.0, x, (F * F))));
	double t_1 = x * (-1.0 / tan(B));
	double t_2 = -(x / B) + (F / (sin(B) * t_0));
	double tmp;
	if (F <= -1.35e+154) {
		tmp = t_1 + (-1.0 / (B * (1.0 + ((B * B) * ((0.008333333333333333 * (B * B)) - 0.16666666666666666)))));
	} else if (F <= -9.8e-29) {
		tmp = t_2;
	} else if (F <= 8.2e-61) {
		tmp = t_1 + ((F / B) * (1.0 / t_0));
	} else if (F <= 2.7e+159) {
		tmp = t_2;
	} else {
		tmp = ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) - x) / B;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))
	t_1 = Float64(x * Float64(-1.0 / tan(B)))
	t_2 = Float64(Float64(-Float64(x / B)) + Float64(F / Float64(sin(B) * t_0)))
	tmp = 0.0
	if (F <= -1.35e+154)
		tmp = Float64(t_1 + Float64(-1.0 / Float64(B * Float64(1.0 + Float64(Float64(B * B) * Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666))))));
	elseif (F <= -9.8e-29)
		tmp = t_2;
	elseif (F <= 8.2e-61)
		tmp = Float64(t_1 + Float64(Float64(F / B) * Float64(1.0 / t_0)));
	elseif (F <= 2.7e+159)
		tmp = t_2;
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(F * F)))) - x) / B);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[(x / B), $MachinePrecision]) + N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35e+154], N[(t$95$1 + N[(-1.0 / N[(B * N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.8e-29], t$95$2, If[LessEqual[F, 8.2e-61], N[(t$95$1 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e+159], t$95$2, N[(N[(N[(1.0 + N[(-0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
t_2 := \left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot t\_0}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_1 + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\

\mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-61}:\\
\;\;\;\;t\_1 + \frac{F}{B} \cdot \frac{1}{t\_0}\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{+159}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.35000000000000003e154

    1. Initial program 31.8%

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \color{blue}{\left(1 + {B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)\right)}} \]
    7. 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}{{B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)}\right)} \]
      2. lower-+.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}\right)\right)} \]
      9. lift-*.f6481.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)} \]
    8. Applied rewrites81.7%

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

    if -1.35000000000000003e154 < F < -9.7999999999999997e-29 or 8.19999999999999998e-61 < F < 2.70000000000000008e159

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
      11. lift-*.f6473.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.7999999999999997e-29 < F < 8.19999999999999998e-61

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.70000000000000008e159 < F

    1. Initial program 27.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
      7. lift-*.f6461.8

        \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
    8. Applied rewrites61.8%

      \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\ \mathbf{elif}\;F \leq -9.8 \cdot 10^{-29}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-61}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+159}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 73.7% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{-99}:\\ \;\;\;\;t\_0 + \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-39}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B)))))
   (if (<= x -2.5e-99)
     (+ t_0 (/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (* B B))))))
     (if (<= x 9e-39)
       (+ (- (/ x B)) (* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (* F F))))))
       (+ t_0 (/ -1.0 B))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double tmp;
	if (x <= -2.5e-99) {
		tmp = t_0 + (-1.0 / (B * (1.0 + (-0.16666666666666666 * (B * B)))));
	} else if (x <= 9e-39) {
		tmp = -(x / B) + ((F / sin(B)) * (1.0 / sqrt((2.0 + (F * F)))));
	} else {
		tmp = t_0 + (-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) :: t_0
    real(8) :: tmp
    t_0 = x * ((-1.0d0) / tan(b))
    if (x <= (-2.5d-99)) then
        tmp = t_0 + ((-1.0d0) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b * b)))))
    else if (x <= 9d-39) then
        tmp = -(x / b) + ((f / sin(b)) * (1.0d0 / sqrt((2.0d0 + (f * f)))))
    else
        tmp = t_0 + ((-1.0d0) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double tmp;
	if (x <= -2.5e-99) {
		tmp = t_0 + (-1.0 / (B * (1.0 + (-0.16666666666666666 * (B * B)))));
	} else if (x <= 9e-39) {
		tmp = -(x / B) + ((F / Math.sin(B)) * (1.0 / Math.sqrt((2.0 + (F * F)))));
	} else {
		tmp = t_0 + (-1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	tmp = 0
	if x <= -2.5e-99:
		tmp = t_0 + (-1.0 / (B * (1.0 + (-0.16666666666666666 * (B * B)))))
	elif x <= 9e-39:
		tmp = -(x / B) + ((F / math.sin(B)) * (1.0 / math.sqrt((2.0 + (F * F)))))
	else:
		tmp = t_0 + (-1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (x <= -2.5e-99)
		tmp = Float64(t_0 + Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * B))))));
	elseif (x <= 9e-39)
		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + Float64(F * F))))));
	else
		tmp = Float64(t_0 + Float64(-1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	tmp = 0.0;
	if (x <= -2.5e-99)
		tmp = t_0 + (-1.0 / (B * (1.0 + (-0.16666666666666666 * (B * B)))));
	elseif (x <= 9e-39)
		tmp = -(x / B) + ((F / sin(B)) * (1.0 / sqrt((2.0 + (F * F)))));
	else
		tmp = t_0 + (-1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e-99], N[(t$95$0 + N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-39], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-99}:\\
\;\;\;\;t\_0 + \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\

\mathbf{elif}\;x \leq 9 \cdot 10^{-39}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.49999999999999985e-99

    1. Initial program 66.0%

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. 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)}} \]
    7. 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. pow2N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot \left(B \cdot B\right)\right)} \]
      5. lift-*.f6471.1

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

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

    if -2.49999999999999985e-99 < x < 9.0000000000000002e-39

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
      11. lift-*.f6465.2

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}} \]
      2. lift-*.f6465.2

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}} \]
    14. Applied rewrites65.2%

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

    if 9.0000000000000002e-39 < x

    1. Initial program 80.7%

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification76.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-99}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-39}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 11: 76.8% accurate, 2.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.018 \lor \neg \left(x \leq 4 \cdot 10^{-32}\right):\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (or (<= x -0.018) (not (<= x 4e-32)))
       (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
       (+ (- (/ x B)) (/ F (* (sin B) (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))))
    double code(double F, double B, double x) {
    	double tmp;
    	if ((x <= -0.018) || !(x <= 4e-32)) {
    		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
    	} else {
    		tmp = -(x / B) + (F / (sin(B) * sqrt((2.0 + fma(2.0, x, (F * F))))));
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if ((x <= -0.018) || !(x <= 4e-32))
    		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B));
    	else
    		tmp = Float64(Float64(-Float64(x / B)) + Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[Or[LessEqual[x, -0.018], N[Not[LessEqual[x, 4e-32]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -0.018 \lor \neg \left(x \leq 4 \cdot 10^{-32}\right):\\
    \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -0.0179999999999999986 or 4.00000000000000022e-32 < x

      1. Initial program 79.8%

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

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

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

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

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

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

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

        if -0.0179999999999999986 < x < 4.00000000000000022e-32

        1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
          11. lift-*.f6459.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.018 \lor \neg \left(x \leq 4 \cdot 10^{-32}\right):\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \end{array} \]
      10. Add Preprocessing

      Alternative 12: 56.2% accurate, 2.4× speedup?

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

        1. Initial program 69.0%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.19999999999999996 < B

        1. Initial program 90.9%

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
        6. 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)}} \]
        7. 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. pow2N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot \left(B \cdot B\right)\right)} \]
          5. lift-*.f6461.5

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification60.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.2:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666, F \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 13: 55.5% accurate, 2.7× speedup?

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

        1. Initial program 69.0%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.19999999999999996 < B

        1. Initial program 90.9%

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification59.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.2:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666, F \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 14: 57.9% accurate, 2.7× speedup?

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

          1. Initial program 53.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. Add Preprocessing
          3. Taylor expanded in F around -inf

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

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

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

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

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

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

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

          if -2.9000000000000001e-25 < F < 2.70000000000000008e159

          1. Initial program 94.8%

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

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

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

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

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

              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \frac{-1}{F}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B} \]
          8. Applied rewrites54.2%

            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \frac{-1}{F}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B} \]
          9. Step-by-step derivation
            1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\mathsf{fma}\left(\frac{1}{3} \cdot x, B \cdot B, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F\right) - x}{B} \]
          12. Step-by-step derivation
            1. lift-*.f6455.7

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

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

          if 2.70000000000000008e159 < F

          1. Initial program 27.9%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
            7. lift-*.f6461.8

              \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
          8. Applied rewrites61.8%

            \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
        3. Recombined 3 regimes into one program.
        4. Final simplification64.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+159}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333 \cdot x, B \cdot B, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 15: 50.4% accurate, 4.4× speedup?

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

          1. Initial program 53.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. Add Preprocessing
          3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
            9. lift-*.f6456.9

              \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
          8. Applied rewrites56.9%

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

            \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]
          10. Step-by-step derivation
            1. Applied rewrites59.5%

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

            if -2.9000000000000001e-25 < F < 2.70000000000000008e159

            1. Initial program 94.8%

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

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

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

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

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

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \frac{-1}{F}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B} \]
            8. Applied rewrites54.2%

              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \frac{-1}{F}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B} \]
            9. Step-by-step derivation
              1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\mathsf{fma}\left(\frac{1}{3} \cdot x, B \cdot B, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F\right) - x}{B} \]
            12. Step-by-step derivation
              1. lift-*.f6455.7

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

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

            if 2.70000000000000008e159 < F

            1. Initial program 27.9%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
              7. lift-*.f6461.8

                \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
            8. Applied rewrites61.8%

              \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
          11. Recombined 3 regimes into one program.
          12. Final simplification57.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+159}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333 \cdot x, B \cdot B, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\ \end{array} \]
          13. Add Preprocessing

          Alternative 16: 50.3% accurate, 4.6× speedup?

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

            1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
              9. lift-*.f6456.2

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

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

              \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]
            10. Step-by-step derivation
              1. Applied rewrites58.8%

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

              if -3.80000000000000009e-28 < F < 6.40000000000000007e56

              1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                10. lift-*.f6456.8

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

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

              if 6.40000000000000007e56 < F

              1. Initial program 47.1%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                6. lift-*.f6456.9

                  \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)\right) - x}{B} \]
              8. Applied rewrites56.9%

                \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)\right) - x}{B} \]
            11. Recombined 3 regimes into one program.
            12. Final simplification57.4%

              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{+56}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \left(B \cdot B\right) \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \end{array} \]
            13. Add Preprocessing

            Alternative 17: 50.4% accurate, 5.5× speedup?

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

              1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                9. lift-*.f6456.2

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

                \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
              9. Taylor expanded in x around 0

                \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]
              10. Step-by-step derivation
                1. Applied rewrites58.8%

                  \[\leadsto \frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]

                if -3.80000000000000009e-28 < F < 1.8999999999999998e94

                1. Initial program 98.7%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                5. Applied rewrites56.1%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                6. Step-by-step derivation
                  1. lift-pow.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  2. lift-+.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  3. lift-*.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  4. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  5. unpow-1N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  6. lower-/.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  7. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  8. lift-*.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  9. lift-+.f6456.1

                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F - x}{B} \]
                7. Applied rewrites56.1%

                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F - x}{B} \]

                if 1.8999999999999998e94 < F

                1. Initial program 39.5%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{\color{blue}{B}} \]
                5. Applied rewrites35.7%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B}} \]
                6. Taylor expanded in F around inf

                  \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                7. Step-by-step derivation
                  1. lower-+.f64N/A

                    \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                  2. lower-*.f64N/A

                    \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                  3. pow2N/A

                    \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                  5. lower-+.f64N/A

                    \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                  6. lift-*.f6458.6

                    \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)\right) - x}{B} \]
                8. Applied rewrites58.6%

                  \[\leadsto \frac{\left(1 + \left(B \cdot B\right) \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)\right) - x}{B} \]
              11. Recombined 3 regimes into one program.
              12. Final simplification57.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{+94}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \left(B \cdot B\right) \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \end{array} \]
              13. Add Preprocessing

              Alternative 18: 43.8% accurate, 6.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.2:\\ \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= F -2.9e-25)
                 (/ (- (- (* 0.5 (/ 2.0 (* F F))) 1.0) x) B)
                 (if (<= F 1.2)
                   (/ (* x (- (* 0.3333333333333333 (* B B)) 1.0)) B)
                   (/ (- (+ 1.0 (* -0.5 (/ (+ 2.0 (* 2.0 x)) (* F F)))) x) B))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (F <= -2.9e-25) {
              		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B;
              	} else if (F <= 1.2) {
              		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
              	} else {
              		tmp = ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) - x) / B;
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(f, b, x)
              use fmin_fmax_functions
                  real(8), intent (in) :: f
                  real(8), intent (in) :: b
                  real(8), intent (in) :: x
                  real(8) :: tmp
                  if (f <= (-2.9d-25)) then
                      tmp = (((0.5d0 * (2.0d0 / (f * f))) - 1.0d0) - x) / b
                  else if (f <= 1.2d0) then
                      tmp = (x * ((0.3333333333333333d0 * (b * b)) - 1.0d0)) / b
                  else
                      tmp = ((1.0d0 + ((-0.5d0) * ((2.0d0 + (2.0d0 * x)) / (f * f)))) - x) / b
                  end if
                  code = tmp
              end function
              
              public static double code(double F, double B, double x) {
              	double tmp;
              	if (F <= -2.9e-25) {
              		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B;
              	} else if (F <= 1.2) {
              		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
              	} else {
              		tmp = ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) - x) / B;
              	}
              	return tmp;
              }
              
              def code(F, B, x):
              	tmp = 0
              	if F <= -2.9e-25:
              		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B
              	elif F <= 1.2:
              		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B
              	else:
              		tmp = ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) - x) / B
              	return tmp
              
              function code(F, B, x)
              	tmp = 0.0
              	if (F <= -2.9e-25)
              		tmp = Float64(Float64(Float64(Float64(0.5 * Float64(2.0 / Float64(F * F))) - 1.0) - x) / B);
              	elseif (F <= 1.2)
              		tmp = Float64(Float64(x * Float64(Float64(0.3333333333333333 * Float64(B * B)) - 1.0)) / B);
              	else
              		tmp = Float64(Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(F * F)))) - x) / B);
              	end
              	return tmp
              end
              
              function tmp_2 = code(F, B, x)
              	tmp = 0.0;
              	if (F <= -2.9e-25)
              		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B;
              	elseif (F <= 1.2)
              		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
              	else
              		tmp = ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) - x) / B;
              	end
              	tmp_2 = tmp;
              end
              
              code[F_, B_, x_] := If[LessEqual[F, -2.9e-25], N[(N[(N[(N[(0.5 * N[(2.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.2], N[(N[(x * N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 + N[(-0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\
              \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\
              
              \mathbf{elif}\;F \leq 1.2:\\
              \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if F < -2.9000000000000001e-25

                1. Initial program 53.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. Add Preprocessing
                3. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                5. Applied rewrites41.0%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                6. Taylor expanded in F around -inf

                  \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                7. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  2. lower--.f64N/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  3. lower-*.f64N/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  4. metadata-evalN/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  5. lower-/.f64N/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  6. lower-+.f64N/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  7. lower-*.f64N/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  8. pow2N/A

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                  9. lift-*.f6456.9

                    \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                8. Applied rewrites56.9%

                  \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                9. Taylor expanded in x around 0

                  \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]
                10. Step-by-step derivation
                  1. Applied rewrites59.5%

                    \[\leadsto \frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]

                  if -2.9000000000000001e-25 < F < 1.19999999999999996

                  1. Initial program 99.4%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in B around 0

                    \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{\color{blue}{B}} \]
                  5. Applied rewrites56.0%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B}} \]
                  6. Taylor expanded in x around inf

                    \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                  7. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                    2. lower--.f64N/A

                      \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                    3. lower-*.f64N/A

                      \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                    4. pow2N/A

                      \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot \left(B \cdot B\right) - 1\right)}{B} \]
                    5. lift-*.f6439.7

                      \[\leadsto \frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B} \]
                  8. Applied rewrites39.7%

                    \[\leadsto \frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B} \]

                  if 1.19999999999999996 < F

                  1. Initial program 53.5%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in B around 0

                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                  5. Applied rewrites40.8%

                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                  6. Taylor expanded in F around inf

                    \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                  7. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                    2. lower-*.f64N/A

                      \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                    3. lower-/.f64N/A

                      \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                    4. lower-+.f64N/A

                      \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                    5. lower-*.f64N/A

                      \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                    6. pow2N/A

                      \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
                    7. lift-*.f6457.8

                      \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
                  8. Applied rewrites57.8%

                    \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
                11. Recombined 3 regimes into one program.
                12. Final simplification50.2%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.2:\\ \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\ \end{array} \]
                13. Add Preprocessing

                Alternative 19: 43.5% accurate, 8.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-110}:\\ \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -2.9e-25)
                   (/ (- (- (* 0.5 (/ 2.0 (* F F))) 1.0) x) B)
                   (if (<= F 1.1e-110)
                     (/ (* x (- (* 0.3333333333333333 (* B B)) 1.0)) B)
                     (/ (- 1.0 x) B))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -2.9e-25) {
                		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B;
                	} else if (F <= 1.1e-110) {
                		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
                	} else {
                		tmp = (1.0 - x) / B;
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(f, b, x)
                use fmin_fmax_functions
                    real(8), intent (in) :: f
                    real(8), intent (in) :: b
                    real(8), intent (in) :: x
                    real(8) :: tmp
                    if (f <= (-2.9d-25)) then
                        tmp = (((0.5d0 * (2.0d0 / (f * f))) - 1.0d0) - x) / b
                    else if (f <= 1.1d-110) then
                        tmp = (x * ((0.3333333333333333d0 * (b * b)) - 1.0d0)) / b
                    else
                        tmp = (1.0d0 - x) / b
                    end if
                    code = tmp
                end function
                
                public static double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -2.9e-25) {
                		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B;
                	} else if (F <= 1.1e-110) {
                		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
                	} else {
                		tmp = (1.0 - x) / B;
                	}
                	return tmp;
                }
                
                def code(F, B, x):
                	tmp = 0
                	if F <= -2.9e-25:
                		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B
                	elif F <= 1.1e-110:
                		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B
                	else:
                		tmp = (1.0 - x) / B
                	return tmp
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -2.9e-25)
                		tmp = Float64(Float64(Float64(Float64(0.5 * Float64(2.0 / Float64(F * F))) - 1.0) - x) / B);
                	elseif (F <= 1.1e-110)
                		tmp = Float64(Float64(x * Float64(Float64(0.3333333333333333 * Float64(B * B)) - 1.0)) / B);
                	else
                		tmp = Float64(Float64(1.0 - x) / B);
                	end
                	return tmp
                end
                
                function tmp_2 = code(F, B, x)
                	tmp = 0.0;
                	if (F <= -2.9e-25)
                		tmp = (((0.5 * (2.0 / (F * F))) - 1.0) - x) / B;
                	elseif (F <= 1.1e-110)
                		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
                	else
                		tmp = (1.0 - x) / B;
                	end
                	tmp_2 = tmp;
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -2.9e-25], N[(N[(N[(N[(0.5 * N[(2.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.1e-110], N[(N[(x * N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\
                \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\
                
                \mathbf{elif}\;F \leq 1.1 \cdot 10^{-110}:\\
                \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1 - x}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -2.9000000000000001e-25

                  1. Initial program 53.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. Add Preprocessing
                  3. Taylor expanded in B around 0

                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                  5. Applied rewrites41.0%

                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                  6. Taylor expanded in F around -inf

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  7. Step-by-step derivation
                    1. metadata-evalN/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    2. lower--.f64N/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    3. lower-*.f64N/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    4. metadata-evalN/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    5. lower-/.f64N/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    6. lower-+.f64N/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    7. lower-*.f64N/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    8. pow2N/A

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                    9. lift-*.f6456.9

                      \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                  8. Applied rewrites56.9%

                    \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                  9. Taylor expanded in x around 0

                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]
                  10. Step-by-step derivation
                    1. Applied rewrites59.5%

                      \[\leadsto \frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B} \]

                    if -2.9000000000000001e-25 < F < 1.1e-110

                    1. Initial program 99.4%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in B around 0

                      \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{\color{blue}{B}} \]
                    5. Applied rewrites53.6%

                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B}} \]
                    6. Taylor expanded in x around inf

                      \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                    7. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                      2. lower--.f64N/A

                        \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                      3. lower-*.f64N/A

                        \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                      4. pow2N/A

                        \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot \left(B \cdot B\right) - 1\right)}{B} \]
                      5. lift-*.f6443.3

                        \[\leadsto \frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B} \]
                    8. Applied rewrites43.3%

                      \[\leadsto \frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B} \]

                    if 1.1e-110 < F

                    1. Initial program 66.1%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in B around 0

                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                    5. Applied rewrites47.5%

                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                    6. Taylor expanded in F around inf

                      \[\leadsto \frac{1 - x}{B} \]
                    7. Step-by-step derivation
                      1. Applied rewrites49.2%

                        \[\leadsto \frac{1 - x}{B} \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification50.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-25}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-110}:\\ \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 20: 43.5% accurate, 8.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -31000:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-110}:\\ \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -31000.0)
                       (- (/ -1.0 B) (/ x B))
                       (if (<= F 1.1e-110)
                         (/ (* x (- (* 0.3333333333333333 (* B B)) 1.0)) B)
                         (/ (- 1.0 x) B))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -31000.0) {
                    		tmp = (-1.0 / B) - (x / B);
                    	} else if (F <= 1.1e-110) {
                    		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
                    	} else {
                    		tmp = (1.0 - x) / B;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(f, b, x)
                    use fmin_fmax_functions
                        real(8), intent (in) :: f
                        real(8), intent (in) :: b
                        real(8), intent (in) :: x
                        real(8) :: tmp
                        if (f <= (-31000.0d0)) then
                            tmp = ((-1.0d0) / b) - (x / b)
                        else if (f <= 1.1d-110) then
                            tmp = (x * ((0.3333333333333333d0 * (b * b)) - 1.0d0)) / b
                        else
                            tmp = (1.0d0 - x) / b
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -31000.0) {
                    		tmp = (-1.0 / B) - (x / B);
                    	} else if (F <= 1.1e-110) {
                    		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
                    	} else {
                    		tmp = (1.0 - x) / B;
                    	}
                    	return tmp;
                    }
                    
                    def code(F, B, x):
                    	tmp = 0
                    	if F <= -31000.0:
                    		tmp = (-1.0 / B) - (x / B)
                    	elif F <= 1.1e-110:
                    		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B
                    	else:
                    		tmp = (1.0 - x) / B
                    	return tmp
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -31000.0)
                    		tmp = Float64(Float64(-1.0 / B) - Float64(x / B));
                    	elseif (F <= 1.1e-110)
                    		tmp = Float64(Float64(x * Float64(Float64(0.3333333333333333 * Float64(B * B)) - 1.0)) / B);
                    	else
                    		tmp = Float64(Float64(1.0 - x) / B);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(F, B, x)
                    	tmp = 0.0;
                    	if (F <= -31000.0)
                    		tmp = (-1.0 / B) - (x / B);
                    	elseif (F <= 1.1e-110)
                    		tmp = (x * ((0.3333333333333333 * (B * B)) - 1.0)) / B;
                    	else
                    		tmp = (1.0 - x) / B;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -31000.0], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-110], N[(N[(x * N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -31000:\\
                    \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\
                    
                    \mathbf{elif}\;F \leq 1.1 \cdot 10^{-110}:\\
                    \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1 - x}{B}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -31000

                      1. Initial program 51.0%

                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in B around 0

                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                      5. Applied rewrites40.4%

                        \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                      6. Taylor expanded in F around -inf

                        \[\leadsto \frac{-1 - x}{B} \]
                      7. Step-by-step derivation
                        1. Applied rewrites59.9%

                          \[\leadsto \frac{-1 - x}{B} \]
                        2. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \frac{-1 - x}{\color{blue}{B}} \]
                          2. lift--.f64N/A

                            \[\leadsto \frac{-1 - x}{B} \]
                          3. div-subN/A

                            \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{B}} \]
                          4. lower--.f64N/A

                            \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{B}} \]
                          5. lower-/.f64N/A

                            \[\leadsto \frac{-1}{B} - \frac{\color{blue}{x}}{B} \]
                          6. lift-/.f6459.9

                            \[\leadsto \frac{-1}{B} - \frac{x}{\color{blue}{B}} \]
                        3. Applied rewrites59.9%

                          \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{B}} \]

                        if -31000 < F < 1.1e-110

                        1. Initial program 99.4%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{\color{blue}{B}} \]
                        5. Applied rewrites53.5%

                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}, 0.3333333333333333 \cdot x\right), B \cdot B, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F\right) - x}{B}} \]
                        6. Taylor expanded in x around inf

                          \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                        7. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                          2. lower--.f64N/A

                            \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                          3. lower-*.f64N/A

                            \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                          4. pow2N/A

                            \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot \left(B \cdot B\right) - 1\right)}{B} \]
                          5. lift-*.f6443.6

                            \[\leadsto \frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B} \]
                        8. Applied rewrites43.6%

                          \[\leadsto \frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B} \]

                        if 1.1e-110 < F

                        1. Initial program 66.1%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                        5. Applied rewrites47.5%

                          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                        6. Taylor expanded in F around inf

                          \[\leadsto \frac{1 - x}{B} \]
                        7. Step-by-step derivation
                          1. Applied rewrites49.2%

                            \[\leadsto \frac{1 - x}{B} \]
                        8. Recombined 3 regimes into one program.
                        9. Final simplification50.2%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -31000:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-110}:\\ \;\;\;\;\frac{x \cdot \left(0.3333333333333333 \cdot \left(B \cdot B\right) - 1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 21: 43.9% accurate, 11.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-75}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (<= F -1.15e-38)
                           (- (/ -1.0 B) (/ x B))
                           (if (<= F 7.6e-75) (/ (- x) B) (/ (- 1.0 x) B))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -1.15e-38) {
                        		tmp = (-1.0 / B) - (x / B);
                        	} else if (F <= 7.6e-75) {
                        		tmp = -x / B;
                        	} else {
                        		tmp = (1.0 - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(f, b, x)
                        use fmin_fmax_functions
                            real(8), intent (in) :: f
                            real(8), intent (in) :: b
                            real(8), intent (in) :: x
                            real(8) :: tmp
                            if (f <= (-1.15d-38)) then
                                tmp = ((-1.0d0) / b) - (x / b)
                            else if (f <= 7.6d-75) then
                                tmp = -x / b
                            else
                                tmp = (1.0d0 - x) / b
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -1.15e-38) {
                        		tmp = (-1.0 / B) - (x / B);
                        	} else if (F <= 7.6e-75) {
                        		tmp = -x / B;
                        	} else {
                        		tmp = (1.0 - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        def code(F, B, x):
                        	tmp = 0
                        	if F <= -1.15e-38:
                        		tmp = (-1.0 / B) - (x / B)
                        	elif F <= 7.6e-75:
                        		tmp = -x / B
                        	else:
                        		tmp = (1.0 - x) / B
                        	return tmp
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if (F <= -1.15e-38)
                        		tmp = Float64(Float64(-1.0 / B) - Float64(x / B));
                        	elseif (F <= 7.6e-75)
                        		tmp = Float64(Float64(-x) / B);
                        	else
                        		tmp = Float64(Float64(1.0 - x) / B);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(F, B, x)
                        	tmp = 0.0;
                        	if (F <= -1.15e-38)
                        		tmp = (-1.0 / B) - (x / B);
                        	elseif (F <= 7.6e-75)
                        		tmp = -x / B;
                        	else
                        		tmp = (1.0 - x) / B;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[F_, B_, x_] := If[LessEqual[F, -1.15e-38], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.6e-75], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;F \leq -1.15 \cdot 10^{-38}:\\
                        \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\
                        
                        \mathbf{elif}\;F \leq 7.6 \cdot 10^{-75}:\\
                        \;\;\;\;\frac{-x}{B}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{1 - x}{B}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if F < -1.15000000000000001e-38

                          1. Initial program 56.4%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Add Preprocessing
                          3. Taylor expanded in B around 0

                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                          5. Applied rewrites41.0%

                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                          6. Taylor expanded in F around -inf

                            \[\leadsto \frac{-1 - x}{B} \]
                          7. Step-by-step derivation
                            1. Applied rewrites57.2%

                              \[\leadsto \frac{-1 - x}{B} \]
                            2. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto \frac{-1 - x}{\color{blue}{B}} \]
                              2. lift--.f64N/A

                                \[\leadsto \frac{-1 - x}{B} \]
                              3. div-subN/A

                                \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{B}} \]
                              4. lower--.f64N/A

                                \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{B}} \]
                              5. lower-/.f64N/A

                                \[\leadsto \frac{-1}{B} - \frac{\color{blue}{x}}{B} \]
                              6. lift-/.f6457.2

                                \[\leadsto \frac{-1}{B} - \frac{x}{\color{blue}{B}} \]
                            3. Applied rewrites57.2%

                              \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{B}} \]

                            if -1.15000000000000001e-38 < F < 7.59999999999999987e-75

                            1. Initial program 99.4%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Add Preprocessing
                            3. Taylor expanded in B around 0

                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                            5. Applied rewrites56.2%

                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                            6. Taylor expanded in F around 0

                              \[\leadsto \frac{-1 \cdot x}{B} \]
                            7. Step-by-step derivation
                              1. lower-*.f6442.5

                                \[\leadsto \frac{-1 \cdot x}{B} \]
                            8. Applied rewrites42.5%

                              \[\leadsto \frac{-1 \cdot x}{B} \]

                            if 7.59999999999999987e-75 < F

                            1. Initial program 61.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. Add Preprocessing
                            3. Taylor expanded in B around 0

                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                            5. Applied rewrites43.9%

                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                            6. Taylor expanded in F around inf

                              \[\leadsto \frac{1 - x}{B} \]
                            7. Step-by-step derivation
                              1. Applied rewrites51.7%

                                \[\leadsto \frac{1 - x}{B} \]
                            8. Recombined 3 regimes into one program.
                            9. Final simplification50.0%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-75}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                            10. Add Preprocessing

                            Alternative 22: 43.9% accurate, 13.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-75}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -1.15e-38)
                               (/ (- -1.0 x) B)
                               (if (<= F 7.6e-75) (/ (- x) B) (/ (- 1.0 x) B))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -1.15e-38) {
                            		tmp = (-1.0 - x) / B;
                            	} else if (F <= 7.6e-75) {
                            		tmp = -x / B;
                            	} else {
                            		tmp = (1.0 - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(f, b, x)
                            use fmin_fmax_functions
                                real(8), intent (in) :: f
                                real(8), intent (in) :: b
                                real(8), intent (in) :: x
                                real(8) :: tmp
                                if (f <= (-1.15d-38)) then
                                    tmp = ((-1.0d0) - x) / b
                                else if (f <= 7.6d-75) then
                                    tmp = -x / b
                                else
                                    tmp = (1.0d0 - x) / b
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -1.15e-38) {
                            		tmp = (-1.0 - x) / B;
                            	} else if (F <= 7.6e-75) {
                            		tmp = -x / B;
                            	} else {
                            		tmp = (1.0 - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            def code(F, B, x):
                            	tmp = 0
                            	if F <= -1.15e-38:
                            		tmp = (-1.0 - x) / B
                            	elif F <= 7.6e-75:
                            		tmp = -x / B
                            	else:
                            		tmp = (1.0 - x) / B
                            	return tmp
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -1.15e-38)
                            		tmp = Float64(Float64(-1.0 - x) / B);
                            	elseif (F <= 7.6e-75)
                            		tmp = Float64(Float64(-x) / B);
                            	else
                            		tmp = Float64(Float64(1.0 - x) / B);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(F, B, x)
                            	tmp = 0.0;
                            	if (F <= -1.15e-38)
                            		tmp = (-1.0 - x) / B;
                            	elseif (F <= 7.6e-75)
                            		tmp = -x / B;
                            	else
                            		tmp = (1.0 - x) / B;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -1.15e-38], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.6e-75], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -1.15 \cdot 10^{-38}:\\
                            \;\;\;\;\frac{-1 - x}{B}\\
                            
                            \mathbf{elif}\;F \leq 7.6 \cdot 10^{-75}:\\
                            \;\;\;\;\frac{-x}{B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{1 - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -1.15000000000000001e-38

                              1. Initial program 56.4%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              4. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                              5. Applied rewrites41.0%

                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                              6. Taylor expanded in F around -inf

                                \[\leadsto \frac{-1 - x}{B} \]
                              7. Step-by-step derivation
                                1. Applied rewrites57.2%

                                  \[\leadsto \frac{-1 - x}{B} \]

                                if -1.15000000000000001e-38 < F < 7.59999999999999987e-75

                                1. Initial program 99.4%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in B around 0

                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                5. Applied rewrites56.2%

                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                6. Taylor expanded in F around 0

                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                7. Step-by-step derivation
                                  1. lower-*.f6442.5

                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                8. Applied rewrites42.5%

                                  \[\leadsto \frac{-1 \cdot x}{B} \]

                                if 7.59999999999999987e-75 < F

                                1. Initial program 61.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. Add Preprocessing
                                3. Taylor expanded in B around 0

                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                5. Applied rewrites43.9%

                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                6. Taylor expanded in F around inf

                                  \[\leadsto \frac{1 - x}{B} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites51.7%

                                    \[\leadsto \frac{1 - x}{B} \]
                                8. Recombined 3 regimes into one program.
                                9. Final simplification50.0%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-75}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                10. Add Preprocessing

                                Alternative 23: 37.5% accurate, 17.5× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 8.5 \cdot 10^{-292}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= F 8.5e-292) (/ (- -1.0 x) B) (/ (- 1.0 x) B)))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= 8.5e-292) {
                                		tmp = (-1.0 - x) / B;
                                	} else {
                                		tmp = (1.0 - x) / B;
                                	}
                                	return tmp;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(f, b, x)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: f
                                    real(8), intent (in) :: b
                                    real(8), intent (in) :: x
                                    real(8) :: tmp
                                    if (f <= 8.5d-292) then
                                        tmp = ((-1.0d0) - x) / b
                                    else
                                        tmp = (1.0d0 - x) / b
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= 8.5e-292) {
                                		tmp = (-1.0 - x) / B;
                                	} else {
                                		tmp = (1.0 - x) / B;
                                	}
                                	return tmp;
                                }
                                
                                def code(F, B, x):
                                	tmp = 0
                                	if F <= 8.5e-292:
                                		tmp = (-1.0 - x) / B
                                	else:
                                		tmp = (1.0 - x) / B
                                	return tmp
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= 8.5e-292)
                                		tmp = Float64(Float64(-1.0 - x) / B);
                                	else
                                		tmp = Float64(Float64(1.0 - x) / B);
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(F, B, x)
                                	tmp = 0.0;
                                	if (F <= 8.5e-292)
                                		tmp = (-1.0 - x) / B;
                                	else
                                		tmp = (1.0 - x) / B;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, 8.5e-292], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;F \leq 8.5 \cdot 10^{-292}:\\
                                \;\;\;\;\frac{-1 - x}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1 - x}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if F < 8.50000000000000066e-292

                                  1. Initial program 73.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. Add Preprocessing
                                  3. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                  4. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                  5. Applied rewrites50.1%

                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                  6. Taylor expanded in F around -inf

                                    \[\leadsto \frac{-1 - x}{B} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites46.6%

                                      \[\leadsto \frac{-1 - x}{B} \]

                                    if 8.50000000000000066e-292 < F

                                    1. Initial program 74.3%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in B around 0

                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                    5. Applied rewrites44.6%

                                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                    6. Taylor expanded in F around inf

                                      \[\leadsto \frac{1 - x}{B} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites40.4%

                                        \[\leadsto \frac{1 - x}{B} \]
                                    8. Recombined 2 regimes into one program.
                                    9. Final simplification43.7%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 8.5 \cdot 10^{-292}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 24: 30.0% accurate, 24.5× speedup?

                                    \[\begin{array}{l} \\ \frac{-1 - x}{B} \end{array} \]
                                    (FPCore (F B x) :precision binary64 (/ (- -1.0 x) B))
                                    double code(double F, double B, double x) {
                                    	return (-1.0 - x) / B;
                                    }
                                    
                                    module fmin_fmax_functions
                                        implicit none
                                        private
                                        public fmax
                                        public fmin
                                    
                                        interface fmax
                                            module procedure fmax88
                                            module procedure fmax44
                                            module procedure fmax84
                                            module procedure fmax48
                                        end interface
                                        interface fmin
                                            module procedure fmin88
                                            module procedure fmin44
                                            module procedure fmin84
                                            module procedure fmin48
                                        end interface
                                    contains
                                        real(8) function fmax88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmax44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmax84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmax48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmin44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmin48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                        end function
                                    end module
                                    
                                    real(8) function code(f, b, x)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: f
                                        real(8), intent (in) :: b
                                        real(8), intent (in) :: x
                                        code = ((-1.0d0) - x) / b
                                    end function
                                    
                                    public static double code(double F, double B, double x) {
                                    	return (-1.0 - x) / B;
                                    }
                                    
                                    def code(F, B, x):
                                    	return (-1.0 - x) / B
                                    
                                    function code(F, B, x)
                                    	return Float64(Float64(-1.0 - x) / B)
                                    end
                                    
                                    function tmp = code(F, B, x)
                                    	tmp = (-1.0 - x) / B;
                                    end
                                    
                                    code[F_, B_, x_] := N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \frac{-1 - x}{B}
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 74.0%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in B around 0

                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                    5. Applied rewrites47.5%

                                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                    6. Taylor expanded in F around -inf

                                      \[\leadsto \frac{-1 - x}{B} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites35.0%

                                        \[\leadsto \frac{-1 - x}{B} \]
                                      2. Final simplification35.0%

                                        \[\leadsto \frac{-1 - x}{B} \]
                                      3. Add Preprocessing

                                      Reproduce

                                      ?
                                      herbie shell --seed 2025051 
                                      (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))))))