VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.5% → 90.4%
Time: 6.1s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 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.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 90.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := F \cdot \sin B\\
\mathbf{if}\;F \leq -7.1 \cdot 10^{+127}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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

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


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -7.0999999999999996e127 < F < 3.2e12

    1. Initial program 76.5%

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

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

    if 3.2e12 < F

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
    3. Applied rewrites46.8%

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

Alternative 2: 84.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-0.5\right)}, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \frac{1}{F}, t\_0\right)\\


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -7.0999999999999996e127 < F < 1e137

    1. Initial program 76.5%

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

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

    if 1e137 < F

    1. Initial program 76.5%

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

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

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

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

Alternative 3: 82.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq -5.8 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-0.5\right)}, -\frac{x}{B \cdot \left(1 + 0.3333333333333333 \cdot {B}^{2}\right)}\right)\\

\mathbf{elif}\;F \leq 1.85:\\
\;\;\;\;\mathsf{fma}\left(t\_1, {\left(2 + 2 \cdot x\right)}^{-0.5}, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \frac{1}{F}, t\_0\right)\\


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -1.12e125 < F < -5.7999999999999995e-7

    1. Initial program 76.5%

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

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

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

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

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

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

    if -5.7999999999999995e-7 < F < 1.8500000000000001

    1. Initial program 76.5%

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

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

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

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

    if 1.8500000000000001 < F

    1. Initial program 76.5%

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

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

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

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

Alternative 4: 74.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{if}\;x \leq -4400:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-47}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \left(F \cdot \frac{1}{\sin B}\right) \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* -1.0 (/ (* x (cos B)) (sin B)))))
   (if (<= x -4400.0)
     t_0
     (if (<= x 2.1e-47)
       (+
        (- (/ x B))
        (*
         (* F (/ 1.0 (sin B)))
         (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
       t_0))))
double code(double F, double B, double x) {
	double t_0 = -1.0 * ((x * cos(B)) / sin(B));
	double tmp;
	if (x <= -4400.0) {
		tmp = t_0;
	} else if (x <= 2.1e-47) {
		tmp = -(x / B) + ((F * (1.0 / sin(B))) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-1.0d0) * ((x * cos(b)) / sin(b))
    if (x <= (-4400.0d0)) then
        tmp = t_0
    else if (x <= 2.1d-47) then
        tmp = -(x / b) + ((f * (1.0d0 / sin(b))) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -1.0 * ((x * Math.cos(B)) / Math.sin(B));
	double tmp;
	if (x <= -4400.0) {
		tmp = t_0;
	} else if (x <= 2.1e-47) {
		tmp = -(x / B) + ((F * (1.0 / Math.sin(B))) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -1.0 * ((x * math.cos(B)) / math.sin(B))
	tmp = 0
	if x <= -4400.0:
		tmp = t_0
	elif x <= 2.1e-47:
		tmp = -(x / B) + ((F * (1.0 / math.sin(B))) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B)))
	tmp = 0.0
	if (x <= -4400.0)
		tmp = t_0;
	elseif (x <= 2.1e-47)
		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sin(B))) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -1.0 * ((x * cos(B)) / sin(B));
	tmp = 0.0;
	if (x <= -4400.0)
		tmp = t_0;
	elseif (x <= 2.1e-47)
		tmp = -(x / B) + ((F * (1.0 / sin(B))) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4400.0], t$95$0, If[LessEqual[x, 2.1e-47], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sin[B], $MachinePrecision]), $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], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{if}\;x \leq -4400:\\
\;\;\;\;t\_0\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4400 or 2.1000000000000001e-47 < x

    1. Initial program 76.5%

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

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

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

    if -4400 < x < 2.1000000000000001e-47

    1. Initial program 76.5%

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

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

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

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

Alternative 5: 74.6% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{if}\;x \leq -4400:\\
\;\;\;\;t\_0\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4400 or 2.1000000000000001e-47 < x

    1. Initial program 76.5%

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

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

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

    if -4400 < x < 2.1000000000000001e-47

    1. Initial program 76.5%

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

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

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

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

Alternative 6: 62.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+126}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -1.3e126 < F < 4.1999999999999997e141

    1. Initial program 76.5%

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

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

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

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

    if 4.1999999999999997e141 < F

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    3. Applied rewrites16.9%

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

Alternative 7: 53.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{+120}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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

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


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -9.5e120 < F < 1.45e52

    1. Initial program 76.5%

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

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

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

    if 1.45e52 < F

    1. Initial program 76.5%

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

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

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

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

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

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

Alternative 8: 52.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -540000:\\
\;\;\;\;\frac{-1}{\sin B}\\

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

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


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -5.4e5 < F < 4.5e-10

    1. Initial program 76.5%

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

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

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

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

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

    if 4.5e-10 < F

    1. Initial program 76.5%

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

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

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

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

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

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

Alternative 9: 46.7% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 9.8 \cdot 10^{-82}:\\ \;\;\;\;-1 \cdot \frac{x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, \frac{1}{F}, -\frac{x}{B}\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.2e-9)
   (/ -1.0 (sin B))
   (if (<= F 9.8e-82)
     (* -1.0 (/ x (sin B)))
     (fma (/ F (sin B)) (/ 1.0 F) (- (/ x B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.2e-9) {
		tmp = -1.0 / sin(B);
	} else if (F <= 9.8e-82) {
		tmp = -1.0 * (x / sin(B));
	} else {
		tmp = fma((F / sin(B)), (1.0 / F), -(x / B));
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.2e-9)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 9.8e-82)
		tmp = Float64(-1.0 * Float64(x / sin(B)));
	else
		tmp = fma(Float64(F / sin(B)), Float64(1.0 / F), Float64(-Float64(x / B)));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-9], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.8e-82], N[(-1.0 * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 9.8 \cdot 10^{-82}:\\
\;\;\;\;-1 \cdot \frac{x}{\sin B}\\

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


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -3.20000000000000012e-9 < F < 9.8000000000000006e-82

    1. Initial program 76.5%

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

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

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

      \[\leadsto -1 \cdot \frac{x}{\sin \color{blue}{B}} \]
    5. Applied rewrites32.2%

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

    if 9.8000000000000006e-82 < F

    1. Initial program 76.5%

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

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

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

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

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

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

Alternative 10: 46.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-7}:\\ \;\;\;\;-1 \cdot \frac{x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.2e-9)
   (/ -1.0 (sin B))
   (if (<= F 3.7e-7) (* -1.0 (/ x (sin B))) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.2e-9) {
		tmp = -1.0 / sin(B);
	} else if (F <= 3.7e-7) {
		tmp = -1.0 * (x / sin(B));
	} else {
		tmp = 1.0 / sin(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 <= (-3.2d-9)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 3.7d-7) then
        tmp = (-1.0d0) * (x / sin(b))
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.2e-9) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 3.7e-7) {
		tmp = -1.0 * (x / Math.sin(B));
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3.2e-9:
		tmp = -1.0 / math.sin(B)
	elif F <= 3.7e-7:
		tmp = -1.0 * (x / math.sin(B))
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.2e-9)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 3.7e-7)
		tmp = Float64(-1.0 * Float64(x / sin(B)));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3.2e-9)
		tmp = -1.0 / sin(B);
	elseif (F <= 3.7e-7)
		tmp = -1.0 * (x / sin(B));
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-9], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.7e-7], N[(-1.0 * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;-1 \cdot \frac{x}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -3.20000000000000012e-9 < F < 3.70000000000000004e-7

    1. Initial program 76.5%

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

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

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

      \[\leadsto -1 \cdot \frac{x}{\sin \color{blue}{B}} \]
    5. Applied rewrites32.2%

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

    if 3.70000000000000004e-7 < F

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    3. Applied rewrites16.9%

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

Alternative 11: 45.6% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 0.014:\\ \;\;\;\;-1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.8e-7)
   (/ -1.0 (sin B))
   (if (<= F 0.014)
     (*
      -1.0
      (/ (+ x (* (pow B 2.0) (- (* -0.5 x) (* -0.16666666666666666 x)))) B))
     (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.8e-7) {
		tmp = -1.0 / sin(B);
	} else if (F <= 0.014) {
		tmp = -1.0 * ((x + (pow(B, 2.0) * ((-0.5 * x) - (-0.16666666666666666 * x)))) / B);
	} else {
		tmp = 1.0 / sin(B);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-5.8d-7)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 0.014d0) then
        tmp = (-1.0d0) * ((x + ((b ** 2.0d0) * (((-0.5d0) * x) - ((-0.16666666666666666d0) * x)))) / b)
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.8e-7) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 0.014) {
		tmp = -1.0 * ((x + (Math.pow(B, 2.0) * ((-0.5 * x) - (-0.16666666666666666 * x)))) / B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.8e-7:
		tmp = -1.0 / math.sin(B)
	elif F <= 0.014:
		tmp = -1.0 * ((x + (math.pow(B, 2.0) * ((-0.5 * x) - (-0.16666666666666666 * x)))) / B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.8e-7)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 0.014)
		tmp = Float64(-1.0 * Float64(Float64(x + Float64((B ^ 2.0) * Float64(Float64(-0.5 * x) - Float64(-0.16666666666666666 * x)))) / B));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.8e-7)
		tmp = -1.0 / sin(B);
	elseif (F <= 0.014)
		tmp = -1.0 * ((x + ((B ^ 2.0) * ((-0.5 * x) - (-0.16666666666666666 * x)))) / B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.8e-7], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.014], N[(-1.0 * N[(N[(x + N[(N[Power[B, 2.0], $MachinePrecision] * N[(N[(-0.5 * x), $MachinePrecision] - N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 0.014:\\
\;\;\;\;-1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -5.7999999999999995e-7 < F < 0.0140000000000000003

    1. Initial program 76.5%

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

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

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

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

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

    if 0.0140000000000000003 < F

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    3. Applied rewrites16.9%

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

Alternative 12: 45.5% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-7}:\\ \;\;\;\;-1 \cdot \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e-9)
   (/ -1.0 (sin B))
   (if (<= F 3.7e-7) (* -1.0 (/ x B)) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-9) {
		tmp = -1.0 / sin(B);
	} else if (F <= 3.7e-7) {
		tmp = -1.0 * (x / B);
	} else {
		tmp = 1.0 / sin(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 <= (-3d-9)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 3.7d-7) then
        tmp = (-1.0d0) * (x / b)
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-9) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 3.7e-7) {
		tmp = -1.0 * (x / B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e-9:
		tmp = -1.0 / math.sin(B)
	elif F <= 3.7e-7:
		tmp = -1.0 * (x / B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e-9)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 3.7e-7)
		tmp = Float64(-1.0 * Float64(x / B));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3e-9)
		tmp = -1.0 / sin(B);
	elseif (F <= 3.7e-7)
		tmp = -1.0 * (x / B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e-9], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.7e-7], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -2.99999999999999998e-9 < F < 3.70000000000000004e-7

    1. Initial program 76.5%

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

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

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

      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{B} \]
    5. Applied rewrites30.0%

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

      \[\leadsto -1 \cdot \frac{x}{B} \]
    7. Applied rewrites30.0%

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

    if 3.70000000000000004e-7 < F

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    3. Applied rewrites16.9%

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

Alternative 13: 37.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e-9) (/ -1.0 (sin B)) (* -1.0 (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-9) {
		tmp = -1.0 / sin(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 <= (-3d-9)) then
        tmp = (-1.0d0) / sin(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 <= -3e-9) {
		tmp = -1.0 / Math.sin(B);
	} else {
		tmp = -1.0 * (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e-9:
		tmp = -1.0 / math.sin(B)
	else:
		tmp = -1.0 * (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e-9)
		tmp = Float64(-1.0 / sin(B));
	else
		tmp = Float64(-1.0 * Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3e-9)
		tmp = -1.0 / sin(B);
	else
		tmp = -1.0 * (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e-9], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -2.99999999999999998e-9

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

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

    if -2.99999999999999998e-9 < F

    1. Initial program 76.5%

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

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

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

      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{B} \]
    5. Applied rewrites30.0%

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

      \[\leadsto -1 \cdot \frac{x}{B} \]
    7. Applied rewrites30.0%

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

Alternative 14: 30.7% accurate, 3.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+14}:\\ \;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e+14)
   (/ (- (* -0.16666666666666666 (pow B 2.0)) 1.0) B)
   (* -1.0 (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e+14) {
		tmp = ((-0.16666666666666666 * pow(B, 2.0)) - 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 <= (-3d+14)) then
        tmp = (((-0.16666666666666666d0) * (b ** 2.0d0)) - 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 <= -3e+14) {
		tmp = ((-0.16666666666666666 * Math.pow(B, 2.0)) - 1.0) / B;
	} else {
		tmp = -1.0 * (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e+14:
		tmp = ((-0.16666666666666666 * math.pow(B, 2.0)) - 1.0) / B
	else:
		tmp = -1.0 * (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e+14)
		tmp = Float64(Float64(Float64(-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B);
	else
		tmp = Float64(-1.0 * Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3e+14)
		tmp = ((-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B;
	else
		tmp = -1.0 * (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e+14], N[(N[(N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{+14}:\\
\;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\

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


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0

      \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{\color{blue}{B}} \]
    5. Applied rewrites9.9%

      \[\leadsto \frac{-0.16666666666666666 \cdot {B}^{2} - 1}{\color{blue}{B}} \]

    if -3e14 < F

    1. Initial program 76.5%

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

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

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

      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{B} \]
    5. Applied rewrites30.0%

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

      \[\leadsto -1 \cdot \frac{x}{B} \]
    7. Applied rewrites30.0%

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

Alternative 15: 30.6% accurate, 10.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+14}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e+14) (/ -1.0 B) (* -1.0 (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e+14) {
		tmp = -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 <= (-3d+14)) then
        tmp = (-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 <= -3e+14) {
		tmp = -1.0 / B;
	} else {
		tmp = -1.0 * (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e+14:
		tmp = -1.0 / B
	else:
		tmp = -1.0 * (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e+14)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(-1.0 * Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3e+14)
		tmp = -1.0 / B;
	else
		tmp = -1.0 * (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e+14], N[(-1.0 / B), $MachinePrecision], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1}{B}\\

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


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

    1. Initial program 76.5%

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    3. Applied rewrites16.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0

      \[\leadsto \frac{-1}{B} \]
    5. Applied rewrites10.2%

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

    if -3e14 < F

    1. Initial program 76.5%

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

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

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

      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{B} \]
    5. Applied rewrites30.0%

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

      \[\leadsto -1 \cdot \frac{x}{B} \]
    7. Applied rewrites30.0%

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

Alternative 16: 10.2% accurate, 26.5× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 76.5%

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

    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
  3. Applied rewrites16.9%

    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
  4. Taylor expanded in B around 0

    \[\leadsto \frac{-1}{B} \]
  5. Applied rewrites10.2%

    \[\leadsto \frac{-1}{B} \]
  6. Add Preprocessing

Alternative 17: 2.9% accurate, 29.2× speedup?

\[\begin{array}{l} \\ -0.16666666666666666 \cdot B \end{array} \]
(FPCore (F B x) :precision binary64 (* -0.16666666666666666 B))
double code(double F, double B, double x) {
	return -0.16666666666666666 * 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 = (-0.16666666666666666d0) * b
end function
public static double code(double F, double B, double x) {
	return -0.16666666666666666 * B;
}
def code(F, B, x):
	return -0.16666666666666666 * B
function code(F, B, x)
	return Float64(-0.16666666666666666 * B)
end
function tmp = code(F, B, x)
	tmp = -0.16666666666666666 * B;
end
code[F_, B_, x_] := N[(-0.16666666666666666 * B), $MachinePrecision]
\begin{array}{l}

\\
-0.16666666666666666 \cdot B
\end{array}
Derivation
  1. Initial program 76.5%

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

    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
  3. Applied rewrites16.9%

    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
  4. Taylor expanded in B around 0

    \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{\color{blue}{B}} \]
  5. Applied rewrites9.9%

    \[\leadsto \frac{-0.16666666666666666 \cdot {B}^{2} - 1}{\color{blue}{B}} \]
  6. Taylor expanded in B around inf

    \[\leadsto \frac{-1}{6} \cdot B \]
  7. Applied rewrites2.9%

    \[\leadsto -0.16666666666666666 \cdot B \]
  8. Add Preprocessing

Reproduce

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