Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 8.3s
Alternatives: 16
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((-eh * tan(t)) / ew))
    code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
	return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((-eh * math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\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 16 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: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((-eh * tan(t)) / ew))
    code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
	return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((-eh * math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \frac{\tan t}{ew}\\ \left|\mathsf{fma}\left(\tanh \sinh^{-1} t\_1 \cdot \sin t, eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} t\_1\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* eh (/ (tan t) ew))))
   (fabs
    (fma
     (* (tanh (asinh t_1)) (sin t))
     eh
     (* (* (cos t) ew) (cos (atan t_1)))))))
double code(double eh, double ew, double t) {
	double t_1 = eh * (tan(t) / ew);
	return fabs(fma((tanh(asinh(t_1)) * sin(t)), eh, ((cos(t) * ew) * cos(atan(t_1)))));
}
function code(eh, ew, t)
	t_1 = Float64(eh * Float64(tan(t) / ew))
	return abs(fma(Float64(tanh(asinh(t_1)) * sin(t)), eh, Float64(Float64(cos(t) * ew) * cos(atan(t_1)))))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * eh + N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := eh \cdot \frac{\tan t}{ew}\\
\left|\mathsf{fma}\left(\tanh \sinh^{-1} t\_1 \cdot \sin t, eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} t\_1\right)\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
    2. lift-*.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \color{blue}{\left(eh \cdot \sin t\right)} \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    3. associate-*l*N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    4. *-commutativeN/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \color{blue}{\left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot eh}\right| \]
    5. lower-*.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \color{blue}{\left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot eh}\right| \]
  3. Applied rewrites99.8%

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \color{blue}{\left(\tanh \sinh^{-1} \left(\frac{-eh}{ew} \cdot \tan t\right) \cdot \sin t\right) \cdot eh}\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh, \sin t, \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right)\right|} \]
  5. Step-by-step derivation
    1. lift-fma.f64N/A

      \[\leadsto \left|\color{blue}{\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \sin t + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t}\right| \]
    2. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right)} \cdot \sin t + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    3. associate-*l*N/A

      \[\leadsto \left|\color{blue}{\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(eh \cdot \sin t\right)} + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    4. *-commutativeN/A

      \[\leadsto \left|\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \color{blue}{\left(\sin t \cdot eh\right)} + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    5. associate-*r*N/A

      \[\leadsto \left|\color{blue}{\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \sin t\right) \cdot eh} + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    6. lift-tanh.f64N/A

      \[\leadsto \left|\left(\color{blue}{\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \cdot \sin t\right) \cdot eh + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    7. lift-asinh.f64N/A

      \[\leadsto \left|\left(\tanh \color{blue}{\sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \cdot \sin t\right) \cdot eh + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    8. tanh-asinhN/A

      \[\leadsto \left|\left(\color{blue}{\frac{\frac{\tan t}{ew} \cdot eh}{\sqrt{1 + \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}}} \cdot \sin t\right) \cdot eh + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    9. sin-atan-revN/A

      \[\leadsto \left|\left(\color{blue}{\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \cdot \sin t\right) \cdot eh + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    10. lift-atan.f64N/A

      \[\leadsto \left|\left(\sin \color{blue}{\tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \cdot \sin t\right) \cdot eh + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
    11. lift-sin.f64N/A

      \[\leadsto \left|\left(\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \color{blue}{\sin t}\right) \cdot eh + \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot ew\right) \cdot \cos t\right| \]
  6. Applied rewrites99.8%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\tanh \sinh^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \sin t, eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)}\right| \]
  7. Add Preprocessing

Alternative 2: 68.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_3 := t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2\\ t_4 := \frac{\tan t}{ew}\\ t_5 := t\_4 \cdot eh\\ \mathbf{if}\;t\_3 \leq -4 \cdot 10^{+23}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-199}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_4 \cdot \left(eh \cdot eh\right), ew\right)}{\cosh \sinh^{-1} t\_5}\right|\\ \mathbf{elif}\;t\_3 \leq 10^{+149}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\cos t, ew, \frac{\left(\sin t \cdot eh\right) \cdot \left(eh \cdot \tan t\right)}{ew}\right)}{\sqrt{1 + {t\_5}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* ew (cos t)))
        (t_2 (atan (/ (* (- eh) (tan t)) ew)))
        (t_3 (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))))
        (t_4 (/ (tan t) ew))
        (t_5 (* t_4 eh)))
   (if (<= t_3 -4e+23)
     (fabs t_1)
     (if (<= t_3 2e-199)
       (fabs (/ (fma (sin t) (* t_4 (* eh eh)) ew) (cosh (asinh t_5))))
       (if (<= t_3 1e+149)
         (/
          (fma (cos t) ew (/ (* (* (sin t) eh) (* eh (tan t))) ew))
          (sqrt (+ 1.0 (pow t_5 2.0))))
         t_1)))))
double code(double eh, double ew, double t) {
	double t_1 = ew * cos(t);
	double t_2 = atan(((-eh * tan(t)) / ew));
	double t_3 = (t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2));
	double t_4 = tan(t) / ew;
	double t_5 = t_4 * eh;
	double tmp;
	if (t_3 <= -4e+23) {
		tmp = fabs(t_1);
	} else if (t_3 <= 2e-199) {
		tmp = fabs((fma(sin(t), (t_4 * (eh * eh)), ew) / cosh(asinh(t_5))));
	} else if (t_3 <= 1e+149) {
		tmp = fma(cos(t), ew, (((sin(t) * eh) * (eh * tan(t))) / ew)) / sqrt((1.0 + pow(t_5, 2.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(ew * cos(t))
	t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	t_3 = Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2)))
	t_4 = Float64(tan(t) / ew)
	t_5 = Float64(t_4 * eh)
	tmp = 0.0
	if (t_3 <= -4e+23)
		tmp = abs(t_1);
	elseif (t_3 <= 2e-199)
		tmp = abs(Float64(fma(sin(t), Float64(t_4 * Float64(eh * eh)), ew) / cosh(asinh(t_5))));
	elseif (t_3 <= 1e+149)
		tmp = Float64(fma(cos(t), ew, Float64(Float64(Float64(sin(t) * eh) * Float64(eh * tan(t))) / ew)) / sqrt(Float64(1.0 + (t_5 ^ 2.0))));
	else
		tmp = t_1;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * eh), $MachinePrecision]}, If[LessEqual[t$95$3, -4e+23], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[t$95$3, 2e-199], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$4 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 1e+149], N[(N[(N[Cos[t], $MachinePrecision] * ew + N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[t$95$5, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
t_3 := t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2\\
t_4 := \frac{\tan t}{ew}\\
t_5 := t\_4 \cdot eh\\
\mathbf{if}\;t\_3 \leq -4 \cdot 10^{+23}:\\
\;\;\;\;\left|t\_1\right|\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-199}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_4 \cdot \left(eh \cdot eh\right), ew\right)}{\cosh \sinh^{-1} t\_5}\right|\\

\mathbf{elif}\;t\_3 \leq 10^{+149}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos t, ew, \frac{\left(\sin t \cdot eh\right) \cdot \left(eh \cdot \tan t\right)}{ew}\right)}{\sqrt{1 + {t\_5}^{2}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.9999999999999997e23

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Applied rewrites60.2%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
    3. Taylor expanded in eh around 0

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
      2. lift-cos.f6462.7

        \[\leadsto \left|ew \cdot \cos t\right| \]
    5. Applied rewrites62.7%

      \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

    if -3.9999999999999997e23 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < 1.99999999999999996e-199

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Applied rewrites83.6%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
    3. Taylor expanded in t around 0

      \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \color{blue}{ew}\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right| \]
    4. Step-by-step derivation
      1. Applied rewrites67.5%

        \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \color{blue}{ew}\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right| \]

      if 1.99999999999999996e-199 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < 1.00000000000000005e149

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Applied rewrites78.1%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
      3. Applied rewrites72.7%

        \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \color{blue}{\left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        3. lift-*.f64N/A

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

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \color{blue}{\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right)}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        5. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)} \cdot eh\right)\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        6. *-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \color{blue}{\left(eh \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        7. associate-*l*N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \color{blue}{\left(\sin t \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \color{blue}{\left(\sin t \cdot eh\right)} \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        9. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \left(\sin t \cdot eh\right) \cdot \color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        10. lift-/.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \left(\sin t \cdot eh\right) \cdot \left(\color{blue}{\frac{\tan t}{ew}} \cdot eh\right)\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        11. associate-*l/N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \left(\sin t \cdot eh\right) \cdot \color{blue}{\frac{\tan t \cdot eh}{ew}}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        12. associate-*r/N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \color{blue}{\frac{\left(\sin t \cdot eh\right) \cdot \left(\tan t \cdot eh\right)}{ew}}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        13. lower-/.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \color{blue}{\frac{\left(\sin t \cdot eh\right) \cdot \left(\tan t \cdot eh\right)}{ew}}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        14. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \frac{\color{blue}{\left(\sin t \cdot eh\right) \cdot \left(\tan t \cdot eh\right)}}{ew}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        15. *-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \frac{\left(\sin t \cdot eh\right) \cdot \color{blue}{\left(eh \cdot \tan t\right)}}{ew}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        16. lower-*.f6479.4

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \frac{\left(\sin t \cdot eh\right) \cdot \color{blue}{\left(eh \cdot \tan t\right)}}{ew}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
      5. Applied rewrites79.4%

        \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \color{blue}{\frac{\left(\sin t \cdot eh\right) \cdot \left(eh \cdot \tan t\right)}{ew}}\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]

      if 1.00000000000000005e149 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Applied rewrites53.7%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
      3. Applied rewrites68.9%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right)}^{2}} \]
      4. Taylor expanded in eh around 0

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto ew \cdot \color{blue}{\cos t} \]
        2. lift-cos.f6464.2

          \[\leadsto ew \cdot \cos t \]
      6. Applied rewrites64.2%

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
    5. Recombined 4 regimes into one program.
    6. Add Preprocessing

    Alternative 3: 72.8% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos t \cdot ew\\ t_2 := ew \cdot \cos t\\ t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_4 := t\_2 \cdot \cos t\_3 - \left(eh \cdot \sin t\right) \cdot \sin t\_3\\ t_5 := \frac{\tan t}{ew}\\ t_6 := t\_5 \cdot eh\\ \mathbf{if}\;t\_4 \leq -4 \cdot 10^{+51}:\\ \;\;\;\;\left|t\_2\right|\\ \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-268}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_5 \cdot \left(eh \cdot eh\right), t\_1\right)}{\sqrt{\mathsf{fma}\left(t\_6, t\_6, 1\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot t\_5, t\_1\right)}{\sqrt{1 + {t\_6}^{2}}}\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (cos t) ew))
            (t_2 (* ew (cos t)))
            (t_3 (atan (/ (* (- eh) (tan t)) ew)))
            (t_4 (- (* t_2 (cos t_3)) (* (* eh (sin t)) (sin t_3))))
            (t_5 (/ (tan t) ew))
            (t_6 (* t_5 eh)))
       (if (<= t_4 -4e+51)
         (fabs t_2)
         (if (<= t_4 -5e-268)
           (fabs (/ (fma (sin t) (* t_5 (* eh eh)) t_1) (sqrt (fma t_6 t_6 1.0))))
           (/ (fma (* (sin t) eh) (* eh t_5) t_1) (sqrt (+ 1.0 (pow t_6 2.0))))))))
    double code(double eh, double ew, double t) {
    	double t_1 = cos(t) * ew;
    	double t_2 = ew * cos(t);
    	double t_3 = atan(((-eh * tan(t)) / ew));
    	double t_4 = (t_2 * cos(t_3)) - ((eh * sin(t)) * sin(t_3));
    	double t_5 = tan(t) / ew;
    	double t_6 = t_5 * eh;
    	double tmp;
    	if (t_4 <= -4e+51) {
    		tmp = fabs(t_2);
    	} else if (t_4 <= -5e-268) {
    		tmp = fabs((fma(sin(t), (t_5 * (eh * eh)), t_1) / sqrt(fma(t_6, t_6, 1.0))));
    	} else {
    		tmp = fma((sin(t) * eh), (eh * t_5), t_1) / sqrt((1.0 + pow(t_6, 2.0)));
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(cos(t) * ew)
    	t_2 = Float64(ew * cos(t))
    	t_3 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
    	t_4 = Float64(Float64(t_2 * cos(t_3)) - Float64(Float64(eh * sin(t)) * sin(t_3)))
    	t_5 = Float64(tan(t) / ew)
    	t_6 = Float64(t_5 * eh)
    	tmp = 0.0
    	if (t_4 <= -4e+51)
    		tmp = abs(t_2);
    	elseif (t_4 <= -5e-268)
    		tmp = abs(Float64(fma(sin(t), Float64(t_5 * Float64(eh * eh)), t_1) / sqrt(fma(t_6, t_6, 1.0))));
    	else
    		tmp = Float64(fma(Float64(sin(t) * eh), Float64(eh * t_5), t_1) / sqrt(Float64(1.0 + (t_6 ^ 2.0))));
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 * eh), $MachinePrecision]}, If[LessEqual[t$95$4, -4e+51], N[Abs[t$95$2], $MachinePrecision], If[LessEqual[t$95$4, -5e-268], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$5 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] / N[Sqrt[N[(t$95$6 * t$95$6 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[(eh * t$95$5), $MachinePrecision] + t$95$1), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[t$95$6, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \cos t \cdot ew\\
    t_2 := ew \cdot \cos t\\
    t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
    t_4 := t\_2 \cdot \cos t\_3 - \left(eh \cdot \sin t\right) \cdot \sin t\_3\\
    t_5 := \frac{\tan t}{ew}\\
    t_6 := t\_5 \cdot eh\\
    \mathbf{if}\;t\_4 \leq -4 \cdot 10^{+51}:\\
    \;\;\;\;\left|t\_2\right|\\
    
    \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-268}:\\
    \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_5 \cdot \left(eh \cdot eh\right), t\_1\right)}{\sqrt{\mathsf{fma}\left(t\_6, t\_6, 1\right)}}\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot t\_5, t\_1\right)}{\sqrt{1 + {t\_6}^{2}}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4e51

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Applied rewrites59.2%

        \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
      3. Taylor expanded in eh around 0

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
        2. lift-cos.f6463.0

          \[\leadsto \left|ew \cdot \cos t\right| \]
      5. Applied rewrites63.0%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

      if -4e51 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.9999999999999999e-268

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Applied rewrites82.2%

        \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
      3. Step-by-step derivation
        1. lift-cosh.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\color{blue}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
        2. lift-asinh.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \color{blue}{\sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
        3. lift-*.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)}}\right| \]
        4. lift-/.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\color{blue}{\frac{\tan t}{ew}} \cdot eh\right)}\right| \]
        5. lift-tan.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\color{blue}{\tan t}}{ew} \cdot eh\right)}\right| \]
        6. cosh-asinhN/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\color{blue}{\sqrt{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + 1}}}\right| \]
        7. lower-sqrt.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\color{blue}{\sqrt{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + 1}}}\right| \]
        8. lower-fma.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \frac{\tan t}{ew} \cdot eh, 1\right)}}}\right| \]
        9. lift-tan.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(\frac{\color{blue}{\tan t}}{ew} \cdot eh, \frac{\tan t}{ew} \cdot eh, 1\right)}}\right| \]
        10. lift-/.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew}} \cdot eh, \frac{\tan t}{ew} \cdot eh, 1\right)}}\right| \]
        11. lift-*.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew} \cdot eh}, \frac{\tan t}{ew} \cdot eh, 1\right)}}\right| \]
        12. lift-tan.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \frac{\color{blue}{\tan t}}{ew} \cdot eh, 1\right)}}\right| \]
        13. lift-/.f64N/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \color{blue}{\frac{\tan t}{ew}} \cdot eh, 1\right)}}\right| \]
        14. lift-*.f6477.2

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \color{blue}{\frac{\tan t}{ew} \cdot eh}, 1\right)}}\right| \]
      4. Applied rewrites77.2%

        \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \frac{\tan t}{ew} \cdot eh, 1\right)}}}\right| \]

      if -4.9999999999999999e-268 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Applied rewrites68.1%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
      3. Applied rewrites64.9%

        \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
      4. Step-by-step derivation
        1. lift-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        3. +-commutativeN/A

          \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        5. lift-*.f64N/A

          \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        6. lift-*.f64N/A

          \[\leadsto \frac{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \color{blue}{\left(eh \cdot eh\right)}\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        7. associate-*r*N/A

          \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\sin t \cdot \left(\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\sin t \cdot \color{blue}{\left(eh \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        10. associate-*l*N/A

          \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        11. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        12. lower-fma.f6476.9

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, \frac{\tan t}{ew} \cdot eh, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        13. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{\frac{\tan t}{ew} \cdot eh}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        14. *-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        15. lower-*.f6476.9

          \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
      5. Applied rewrites76.9%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot \frac{\tan t}{ew}, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 4: 70.6% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_3 := t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2\\ t_4 := \frac{\tan t}{ew}\\ t_5 := t\_4 \cdot eh\\ \mathbf{if}\;t\_3 \leq -4 \cdot 10^{+23}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-268}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_4 \cdot \left(eh \cdot eh\right), ew\right)}{\cosh \sinh^{-1} t\_5}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot t\_4, \cos t \cdot ew\right)}{\sqrt{1 + {t\_5}^{2}}}\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* ew (cos t)))
            (t_2 (atan (/ (* (- eh) (tan t)) ew)))
            (t_3 (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))))
            (t_4 (/ (tan t) ew))
            (t_5 (* t_4 eh)))
       (if (<= t_3 -4e+23)
         (fabs t_1)
         (if (<= t_3 -5e-268)
           (fabs (/ (fma (sin t) (* t_4 (* eh eh)) ew) (cosh (asinh t_5))))
           (/
            (fma (* (sin t) eh) (* eh t_4) (* (cos t) ew))
            (sqrt (+ 1.0 (pow t_5 2.0))))))))
    double code(double eh, double ew, double t) {
    	double t_1 = ew * cos(t);
    	double t_2 = atan(((-eh * tan(t)) / ew));
    	double t_3 = (t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2));
    	double t_4 = tan(t) / ew;
    	double t_5 = t_4 * eh;
    	double tmp;
    	if (t_3 <= -4e+23) {
    		tmp = fabs(t_1);
    	} else if (t_3 <= -5e-268) {
    		tmp = fabs((fma(sin(t), (t_4 * (eh * eh)), ew) / cosh(asinh(t_5))));
    	} else {
    		tmp = fma((sin(t) * eh), (eh * t_4), (cos(t) * ew)) / sqrt((1.0 + pow(t_5, 2.0)));
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = Float64(ew * cos(t))
    	t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
    	t_3 = Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2)))
    	t_4 = Float64(tan(t) / ew)
    	t_5 = Float64(t_4 * eh)
    	tmp = 0.0
    	if (t_3 <= -4e+23)
    		tmp = abs(t_1);
    	elseif (t_3 <= -5e-268)
    		tmp = abs(Float64(fma(sin(t), Float64(t_4 * Float64(eh * eh)), ew) / cosh(asinh(t_5))));
    	else
    		tmp = Float64(fma(Float64(sin(t) * eh), Float64(eh * t_4), Float64(cos(t) * ew)) / sqrt(Float64(1.0 + (t_5 ^ 2.0))));
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * eh), $MachinePrecision]}, If[LessEqual[t$95$3, -4e+23], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[t$95$3, -5e-268], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$4 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[(eh * t$95$4), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[t$95$5, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := ew \cdot \cos t\\
    t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
    t_3 := t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2\\
    t_4 := \frac{\tan t}{ew}\\
    t_5 := t\_4 \cdot eh\\
    \mathbf{if}\;t\_3 \leq -4 \cdot 10^{+23}:\\
    \;\;\;\;\left|t\_1\right|\\
    
    \mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-268}:\\
    \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_4 \cdot \left(eh \cdot eh\right), ew\right)}{\cosh \sinh^{-1} t\_5}\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot t\_4, \cos t \cdot ew\right)}{\sqrt{1 + {t\_5}^{2}}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.9999999999999997e23

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Applied rewrites60.2%

        \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
      3. Taylor expanded in eh around 0

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
        2. lift-cos.f6462.7

          \[\leadsto \left|ew \cdot \cos t\right| \]
      5. Applied rewrites62.7%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

      if -3.9999999999999997e23 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.9999999999999999e-268

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Applied rewrites83.8%

        \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
      3. Taylor expanded in t around 0

        \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \color{blue}{ew}\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right| \]
      4. Step-by-step derivation
        1. Applied rewrites66.8%

          \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \color{blue}{ew}\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right| \]

        if -4.9999999999999999e-268 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites68.1%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Applied rewrites64.9%

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
        4. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          3. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          5. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \color{blue}{\left(eh \cdot eh\right)}\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          7. associate-*r*N/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \left(\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          9. *-commutativeN/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(eh \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          10. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          11. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          12. lower-fma.f6476.9

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, \frac{\tan t}{ew} \cdot eh, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          13. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{\frac{\tan t}{ew} \cdot eh}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          14. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          15. lower-*.f6476.9

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        5. Applied rewrites76.9%

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot \frac{\tan t}{ew}, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
      5. Recombined 3 regimes into one program.
      6. Add Preprocessing

      Alternative 5: 90.7% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew} \cdot eh\\ t_2 := \tan^{-1} t\_1\\ t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_4 := \cos t \cdot ew\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_3 - \left(eh \cdot \sin t\right) \cdot \sin t\_3 \leq -5 \cdot 10^{-268}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, \sin t \cdot eh, t\_4\right)}{-\cosh \sinh^{-1} t\_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sin t\_2 \cdot \sin t, eh, t\_4 \cdot \cos t\_2\right)\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (/ (tan t) ew) eh))
              (t_2 (atan t_1))
              (t_3 (atan (/ (* (- eh) (tan t)) ew)))
              (t_4 (* (cos t) ew)))
         (if (<=
              (- (* (* ew (cos t)) (cos t_3)) (* (* eh (sin t)) (sin t_3)))
              -5e-268)
           (/ (fma (/ (* eh (tan t)) ew) (* (sin t) eh) t_4) (- (cosh (asinh t_1))))
           (fma (* (sin t_2) (sin t)) eh (* t_4 (cos t_2))))))
      double code(double eh, double ew, double t) {
      	double t_1 = (tan(t) / ew) * eh;
      	double t_2 = atan(t_1);
      	double t_3 = atan(((-eh * tan(t)) / ew));
      	double t_4 = cos(t) * ew;
      	double tmp;
      	if ((((ew * cos(t)) * cos(t_3)) - ((eh * sin(t)) * sin(t_3))) <= -5e-268) {
      		tmp = fma(((eh * tan(t)) / ew), (sin(t) * eh), t_4) / -cosh(asinh(t_1));
      	} else {
      		tmp = fma((sin(t_2) * sin(t)), eh, (t_4 * cos(t_2)));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(Float64(tan(t) / ew) * eh)
      	t_2 = atan(t_1)
      	t_3 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
      	t_4 = Float64(cos(t) * ew)
      	tmp = 0.0
      	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_3)) - Float64(Float64(eh * sin(t)) * sin(t_3))) <= -5e-268)
      		tmp = Float64(fma(Float64(Float64(eh * tan(t)) / ew), Float64(sin(t) * eh), t_4) / Float64(-cosh(asinh(t_1))));
      	else
      		tmp = fma(Float64(sin(t_2) * sin(t)), eh, Float64(t_4 * cos(t_2)));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-268], N[(N[(N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] + t$95$4), $MachinePrecision] / (-N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sin[t$95$2], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * eh + N[(t$95$4 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{\tan t}{ew} \cdot eh\\
      t_2 := \tan^{-1} t\_1\\
      t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
      t_4 := \cos t \cdot ew\\
      \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_3 - \left(eh \cdot \sin t\right) \cdot \sin t\_3 \leq -5 \cdot 10^{-268}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, \sin t \cdot eh, t\_4\right)}{-\cosh \sinh^{-1} t\_1}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\sin t\_2 \cdot \sin t, eh, t\_4 \cdot \cos t\_2\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.9999999999999999e-268

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites1.2%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          2. frac-2negN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)}} \]
          3. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          7. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          8. distribute-frac-neg2N/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)} \]
          9. distribute-neg-fracN/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)\right)}\right) \]
        4. Applied rewrites82.4%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew} \cdot eh}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew}} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          3. associate-*l/N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          5. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          6. lower-*.f6482.4

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
        6. Applied rewrites82.4%

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{eh \cdot \tan t}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]

        if -4.9999999999999999e-268 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Step-by-step derivation
          1. lift-fabs.f64N/A

            \[\leadsto \color{blue}{\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|} \]
          2. rem-sqrt-square-revN/A

            \[\leadsto \color{blue}{\sqrt{\left(\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}} \]
          3. sqrt-prodN/A

            \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}} \]
          4. rem-square-sqrt98.7

            \[\leadsto \color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \]
          5. lift--.f64N/A

            \[\leadsto \color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \]
          6. sub-negate1N/A

            \[\leadsto \color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)} \]
        3. Applied rewrites98.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \sin t, eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 6: 81.4% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew} \cdot eh\\ t_2 := \sin t \cdot eh\\ t_3 := \cosh \sinh^{-1} t\_1\\ t_4 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_5 := \cos t \cdot ew\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_4 - \left(eh \cdot \sin t\right) \cdot \sin t\_4 \leq -5 \cdot 10^{-268}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, t\_2, t\_5\right)}{-t\_3}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\frac{\mathsf{fma}\left(t\_1, t\_2, t\_5\right)}{t\_3}}\right)}^{2}\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (/ (tan t) ew) eh))
              (t_2 (* (sin t) eh))
              (t_3 (cosh (asinh t_1)))
              (t_4 (atan (/ (* (- eh) (tan t)) ew)))
              (t_5 (* (cos t) ew)))
         (if (<=
              (- (* (* ew (cos t)) (cos t_4)) (* (* eh (sin t)) (sin t_4)))
              -5e-268)
           (/ (fma (/ (* eh (tan t)) ew) t_2 t_5) (- t_3))
           (pow (sqrt (/ (fma t_1 t_2 t_5) t_3)) 2.0))))
      double code(double eh, double ew, double t) {
      	double t_1 = (tan(t) / ew) * eh;
      	double t_2 = sin(t) * eh;
      	double t_3 = cosh(asinh(t_1));
      	double t_4 = atan(((-eh * tan(t)) / ew));
      	double t_5 = cos(t) * ew;
      	double tmp;
      	if ((((ew * cos(t)) * cos(t_4)) - ((eh * sin(t)) * sin(t_4))) <= -5e-268) {
      		tmp = fma(((eh * tan(t)) / ew), t_2, t_5) / -t_3;
      	} else {
      		tmp = pow(sqrt((fma(t_1, t_2, t_5) / t_3)), 2.0);
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(Float64(tan(t) / ew) * eh)
      	t_2 = Float64(sin(t) * eh)
      	t_3 = cosh(asinh(t_1))
      	t_4 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
      	t_5 = Float64(cos(t) * ew)
      	tmp = 0.0
      	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_4)) - Float64(Float64(eh * sin(t)) * sin(t_4))) <= -5e-268)
      		tmp = Float64(fma(Float64(Float64(eh * tan(t)) / ew), t_2, t_5) / Float64(-t_3));
      	else
      		tmp = sqrt(Float64(fma(t_1, t_2, t_5) / t_3)) ^ 2.0;
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$3 = N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-268], N[(N[(N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * t$95$2 + t$95$5), $MachinePrecision] / (-t$95$3)), $MachinePrecision], N[Power[N[Sqrt[N[(N[(t$95$1 * t$95$2 + t$95$5), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{\tan t}{ew} \cdot eh\\
      t_2 := \sin t \cdot eh\\
      t_3 := \cosh \sinh^{-1} t\_1\\
      t_4 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
      t_5 := \cos t \cdot ew\\
      \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_4 - \left(eh \cdot \sin t\right) \cdot \sin t\_4 \leq -5 \cdot 10^{-268}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, t\_2, t\_5\right)}{-t\_3}\\
      
      \mathbf{else}:\\
      \;\;\;\;{\left(\sqrt{\frac{\mathsf{fma}\left(t\_1, t\_2, t\_5\right)}{t\_3}}\right)}^{2}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.9999999999999999e-268

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites1.2%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          2. frac-2negN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)}} \]
          3. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          7. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          8. distribute-frac-neg2N/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)} \]
          9. distribute-neg-fracN/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)\right)}\right) \]
        4. Applied rewrites82.4%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew} \cdot eh}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew}} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          3. associate-*l/N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          5. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          6. lower-*.f6482.4

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
        6. Applied rewrites82.4%

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{eh \cdot \tan t}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]

        if -4.9999999999999999e-268 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites68.1%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Applied rewrites80.4%

          \[\leadsto \color{blue}{{\left(\sqrt{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right)}^{2}} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 7: 80.1% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ t_2 := \cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\ t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_4 := \cos t \cdot ew\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_3 - \left(eh \cdot \sin t\right) \cdot \sin t\_3 \leq -5 \cdot 10^{-268}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, t\_1, t\_4\right)}{-t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_4 - t\_1 \cdot \left(\frac{-eh}{ew} \cdot \tan t\right)}{t\_2}\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (sin t) eh))
              (t_2 (cosh (asinh (* (/ (tan t) ew) eh))))
              (t_3 (atan (/ (* (- eh) (tan t)) ew)))
              (t_4 (* (cos t) ew)))
         (if (<=
              (- (* (* ew (cos t)) (cos t_3)) (* (* eh (sin t)) (sin t_3)))
              -5e-268)
           (/ (fma (/ (* eh (tan t)) ew) t_1 t_4) (- t_2))
           (/ (- t_4 (* t_1 (* (/ (- eh) ew) (tan t)))) t_2))))
      double code(double eh, double ew, double t) {
      	double t_1 = sin(t) * eh;
      	double t_2 = cosh(asinh(((tan(t) / ew) * eh)));
      	double t_3 = atan(((-eh * tan(t)) / ew));
      	double t_4 = cos(t) * ew;
      	double tmp;
      	if ((((ew * cos(t)) * cos(t_3)) - ((eh * sin(t)) * sin(t_3))) <= -5e-268) {
      		tmp = fma(((eh * tan(t)) / ew), t_1, t_4) / -t_2;
      	} else {
      		tmp = (t_4 - (t_1 * ((-eh / ew) * tan(t)))) / t_2;
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(sin(t) * eh)
      	t_2 = cosh(asinh(Float64(Float64(tan(t) / ew) * eh)))
      	t_3 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
      	t_4 = Float64(cos(t) * ew)
      	tmp = 0.0
      	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_3)) - Float64(Float64(eh * sin(t)) * sin(t_3))) <= -5e-268)
      		tmp = Float64(fma(Float64(Float64(eh * tan(t)) / ew), t_1, t_4) / Float64(-t_2));
      	else
      		tmp = Float64(Float64(t_4 - Float64(t_1 * Float64(Float64(Float64(-eh) / ew) * tan(t)))) / t_2);
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[Cosh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-268], N[(N[(N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * t$95$1 + t$95$4), $MachinePrecision] / (-t$95$2)), $MachinePrecision], N[(N[(t$95$4 - N[(t$95$1 * N[(N[((-eh) / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \sin t \cdot eh\\
      t_2 := \cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\
      t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
      t_4 := \cos t \cdot ew\\
      \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_3 - \left(eh \cdot \sin t\right) \cdot \sin t\_3 \leq -5 \cdot 10^{-268}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, t\_1, t\_4\right)}{-t\_2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{t\_4 - t\_1 \cdot \left(\frac{-eh}{ew} \cdot \tan t\right)}{t\_2}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.9999999999999999e-268

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites1.2%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          2. frac-2negN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)}} \]
          3. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          7. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          8. distribute-frac-neg2N/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)} \]
          9. distribute-neg-fracN/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)\right)}\right) \]
        4. Applied rewrites82.4%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew} \cdot eh}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew}} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          3. associate-*l/N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          5. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          6. lower-*.f6482.4

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
        6. Applied rewrites82.4%

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{eh \cdot \tan t}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]

        if -4.9999999999999999e-268 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites77.9%

          \[\leadsto \color{blue}{\frac{\cos t \cdot ew - \left(\sin t \cdot eh\right) \cdot \left(\frac{-eh}{ew} \cdot \tan t\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 8: 79.6% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew}\\ t_2 := t\_1 \cdot eh\\ t_3 := \sin t \cdot eh\\ t_4 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_5 := \cos t \cdot ew\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_4 - \left(eh \cdot \sin t\right) \cdot \sin t\_4 \leq -5 \cdot 10^{-268}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, t\_3, t\_5\right)}{-\cosh \sinh^{-1} t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_3, eh \cdot t\_1, t\_5\right)}{\sqrt{1 + {t\_2}^{2}}}\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (/ (tan t) ew))
              (t_2 (* t_1 eh))
              (t_3 (* (sin t) eh))
              (t_4 (atan (/ (* (- eh) (tan t)) ew)))
              (t_5 (* (cos t) ew)))
         (if (<=
              (- (* (* ew (cos t)) (cos t_4)) (* (* eh (sin t)) (sin t_4)))
              -5e-268)
           (/ (fma (/ (* eh (tan t)) ew) t_3 t_5) (- (cosh (asinh t_2))))
           (/ (fma t_3 (* eh t_1) t_5) (sqrt (+ 1.0 (pow t_2 2.0)))))))
      double code(double eh, double ew, double t) {
      	double t_1 = tan(t) / ew;
      	double t_2 = t_1 * eh;
      	double t_3 = sin(t) * eh;
      	double t_4 = atan(((-eh * tan(t)) / ew));
      	double t_5 = cos(t) * ew;
      	double tmp;
      	if ((((ew * cos(t)) * cos(t_4)) - ((eh * sin(t)) * sin(t_4))) <= -5e-268) {
      		tmp = fma(((eh * tan(t)) / ew), t_3, t_5) / -cosh(asinh(t_2));
      	} else {
      		tmp = fma(t_3, (eh * t_1), t_5) / sqrt((1.0 + pow(t_2, 2.0)));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(tan(t) / ew)
      	t_2 = Float64(t_1 * eh)
      	t_3 = Float64(sin(t) * eh)
      	t_4 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
      	t_5 = Float64(cos(t) * ew)
      	tmp = 0.0
      	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_4)) - Float64(Float64(eh * sin(t)) * sin(t_4))) <= -5e-268)
      		tmp = Float64(fma(Float64(Float64(eh * tan(t)) / ew), t_3, t_5) / Float64(-cosh(asinh(t_2))));
      	else
      		tmp = Float64(fma(t_3, Float64(eh * t_1), t_5) / sqrt(Float64(1.0 + (t_2 ^ 2.0))));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * eh), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-268], N[(N[(N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * t$95$3 + t$95$5), $MachinePrecision] / (-N[Cosh[N[ArcSinh[t$95$2], $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(t$95$3 * N[(eh * t$95$1), $MachinePrecision] + t$95$5), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{\tan t}{ew}\\
      t_2 := t\_1 \cdot eh\\
      t_3 := \sin t \cdot eh\\
      t_4 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
      t_5 := \cos t \cdot ew\\
      \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_4 - \left(eh \cdot \sin t\right) \cdot \sin t\_4 \leq -5 \cdot 10^{-268}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\frac{eh \cdot \tan t}{ew}, t\_3, t\_5\right)}{-\cosh \sinh^{-1} t\_2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(t\_3, eh \cdot t\_1, t\_5\right)}{\sqrt{1 + {t\_2}^{2}}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.9999999999999999e-268

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites1.2%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          2. frac-2negN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)}} \]
          3. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          7. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          8. distribute-frac-neg2N/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)} \]
          9. distribute-neg-fracN/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)\right)}\right) \]
        4. Applied rewrites82.4%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew} \cdot eh}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t}{ew}} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          3. associate-*l/N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{\tan t \cdot eh}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          5. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
          6. lower-*.f6482.4

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\color{blue}{eh \cdot \tan t}}{ew}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]
        6. Applied rewrites82.4%

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{eh \cdot \tan t}{ew}}, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)} \]

        if -4.9999999999999999e-268 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites68.1%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Applied rewrites64.9%

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
        4. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          3. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          5. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \color{blue}{\left(eh \cdot eh\right)}\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          7. associate-*r*N/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \left(\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          9. *-commutativeN/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(eh \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          10. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          11. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          12. lower-fma.f6476.9

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, \frac{\tan t}{ew} \cdot eh, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          13. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{\frac{\tan t}{ew} \cdot eh}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          14. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          15. lower-*.f6476.9

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        5. Applied rewrites76.9%

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot \frac{\tan t}{ew}, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 9: 79.6% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew}\\ t_2 := t\_1 \cdot eh\\ t_3 := \sin t \cdot eh\\ t_4 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_5 := \cos t \cdot ew\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_4 - \left(eh \cdot \sin t\right) \cdot \sin t\_4 \leq -5 \cdot 10^{-268}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_2, t\_3, t\_5\right)}{-\cosh \sinh^{-1} t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_3, eh \cdot t\_1, t\_5\right)}{\sqrt{1 + {t\_2}^{2}}}\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (/ (tan t) ew))
              (t_2 (* t_1 eh))
              (t_3 (* (sin t) eh))
              (t_4 (atan (/ (* (- eh) (tan t)) ew)))
              (t_5 (* (cos t) ew)))
         (if (<=
              (- (* (* ew (cos t)) (cos t_4)) (* (* eh (sin t)) (sin t_4)))
              -5e-268)
           (/ (fma t_2 t_3 t_5) (- (cosh (asinh t_2))))
           (/ (fma t_3 (* eh t_1) t_5) (sqrt (+ 1.0 (pow t_2 2.0)))))))
      double code(double eh, double ew, double t) {
      	double t_1 = tan(t) / ew;
      	double t_2 = t_1 * eh;
      	double t_3 = sin(t) * eh;
      	double t_4 = atan(((-eh * tan(t)) / ew));
      	double t_5 = cos(t) * ew;
      	double tmp;
      	if ((((ew * cos(t)) * cos(t_4)) - ((eh * sin(t)) * sin(t_4))) <= -5e-268) {
      		tmp = fma(t_2, t_3, t_5) / -cosh(asinh(t_2));
      	} else {
      		tmp = fma(t_3, (eh * t_1), t_5) / sqrt((1.0 + pow(t_2, 2.0)));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(tan(t) / ew)
      	t_2 = Float64(t_1 * eh)
      	t_3 = Float64(sin(t) * eh)
      	t_4 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
      	t_5 = Float64(cos(t) * ew)
      	tmp = 0.0
      	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_4)) - Float64(Float64(eh * sin(t)) * sin(t_4))) <= -5e-268)
      		tmp = Float64(fma(t_2, t_3, t_5) / Float64(-cosh(asinh(t_2))));
      	else
      		tmp = Float64(fma(t_3, Float64(eh * t_1), t_5) / sqrt(Float64(1.0 + (t_2 ^ 2.0))));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * eh), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-268], N[(N[(t$95$2 * t$95$3 + t$95$5), $MachinePrecision] / (-N[Cosh[N[ArcSinh[t$95$2], $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(t$95$3 * N[(eh * t$95$1), $MachinePrecision] + t$95$5), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{\tan t}{ew}\\
      t_2 := t\_1 \cdot eh\\
      t_3 := \sin t \cdot eh\\
      t_4 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
      t_5 := \cos t \cdot ew\\
      \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_4 - \left(eh \cdot \sin t\right) \cdot \sin t\_4 \leq -5 \cdot 10^{-268}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(t\_2, t\_3, t\_5\right)}{-\cosh \sinh^{-1} t\_2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(t\_3, eh \cdot t\_1, t\_5\right)}{\sqrt{1 + {t\_2}^{2}}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.9999999999999999e-268

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites1.2%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          2. frac-2negN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)}} \]
          3. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          5. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew\right)\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          7. lift-fma.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}\right)}{\mathsf{neg}\left(\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)} \]
          8. distribute-frac-neg2N/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)} \]
          9. distribute-neg-fracN/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)\right)}\right) \]
        4. Applied rewrites82.4%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{-\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]

        if -4.9999999999999999e-268 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites68.1%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        3. Applied rewrites64.9%

          \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
        4. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\cos t \cdot ew + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\cos t \cdot ew} + \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          3. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) + \cos t \cdot ew}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          5. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \left(\frac{\tan t}{ew} \cdot \color{blue}{\left(eh \cdot eh\right)}\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          7. associate-*r*N/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{\sin t \cdot \left(\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          9. *-commutativeN/A

            \[\leadsto \frac{\sin t \cdot \color{blue}{\left(eh \cdot \left(\frac{\tan t}{ew} \cdot eh\right)\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          10. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right) \cdot \left(\frac{\tan t}{ew} \cdot eh\right)} + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          11. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(\sin t \cdot eh\right)} \cdot \left(\frac{\tan t}{ew} \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          12. lower-fma.f6476.9

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, \frac{\tan t}{ew} \cdot eh, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          13. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{\frac{\tan t}{ew} \cdot eh}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          14. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
          15. lower-*.f6476.9

            \[\leadsto \frac{\mathsf{fma}\left(\sin t \cdot eh, \color{blue}{eh \cdot \frac{\tan t}{ew}}, \cos t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
        5. Applied rewrites76.9%

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sin t \cdot eh, eh \cdot \frac{\tan t}{ew}, \cos t \cdot ew\right)}}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 10: 52.1% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq 5 \cdot 10^{-215}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* ew (cos t))) (t_2 (atan (/ (* (- eh) (tan t)) ew))))
         (if (<= (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))) 5e-215)
           (fabs ew)
           t_1)))
      double code(double eh, double ew, double t) {
      	double t_1 = ew * cos(t);
      	double t_2 = atan(((-eh * tan(t)) / ew));
      	double tmp;
      	if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 5e-215) {
      		tmp = fabs(ew);
      	} else {
      		tmp = t_1;
      	}
      	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(eh, ew, t)
      use fmin_fmax_functions
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = ew * cos(t)
          t_2 = atan(((-eh * tan(t)) / ew))
          if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 5d-215) then
              tmp = abs(ew)
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = ew * Math.cos(t);
      	double t_2 = Math.atan(((-eh * Math.tan(t)) / ew));
      	double tmp;
      	if (((t_1 * Math.cos(t_2)) - ((eh * Math.sin(t)) * Math.sin(t_2))) <= 5e-215) {
      		tmp = Math.abs(ew);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = ew * math.cos(t)
      	t_2 = math.atan(((-eh * math.tan(t)) / ew))
      	tmp = 0
      	if ((t_1 * math.cos(t_2)) - ((eh * math.sin(t)) * math.sin(t_2))) <= 5e-215:
      		tmp = math.fabs(ew)
      	else:
      		tmp = t_1
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(ew * cos(t))
      	t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
      	tmp = 0.0
      	if (Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2))) <= 5e-215)
      		tmp = abs(ew);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = ew * cos(t);
      	t_2 = atan(((-eh * tan(t)) / ew));
      	tmp = 0.0;
      	if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 5e-215)
      		tmp = abs(ew);
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-215], N[Abs[ew], $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := ew \cdot \cos t\\
      t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
      \mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq 5 \cdot 10^{-215}:\\
      \;\;\;\;\left|ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < 4.99999999999999956e-215

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Applied rewrites69.2%

          \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
        3. Taylor expanded in t around 0

          \[\leadsto \left|\color{blue}{ew}\right| \]
        4. Step-by-step derivation
          1. Applied rewrites43.0%

            \[\leadsto \left|\color{blue}{ew}\right| \]

          if 4.99999999999999956e-215 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Applied rewrites68.2%

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          3. Applied rewrites80.6%

            \[\leadsto \color{blue}{{\left(\sqrt{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right)}^{2}} \]
          4. Taylor expanded in eh around 0

            \[\leadsto \color{blue}{ew \cdot \cos t} \]
          5. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto ew \cdot \color{blue}{\cos t} \]
            2. lift-cos.f6461.8

              \[\leadsto ew \cdot \cos t \]
          6. Applied rewrites61.8%

            \[\leadsto \color{blue}{ew \cdot \cos t} \]
        5. Recombined 2 regimes into one program.
        6. Add Preprocessing

        Alternative 11: 76.9% accurate, 1.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew}\\ t_2 := eh \cdot \sin t\\ t_3 := -1 \cdot t\_2\\ \mathbf{if}\;eh \leq -3 \cdot 10^{+270}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;eh \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;eh \leq 3.4 \cdot 10^{+162}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(t\_1 \cdot eh\right)}\right|\\ \mathbf{elif}\;eh \leq 9.2 \cdot 10^{+210}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (/ (tan t) ew)) (t_2 (* eh (sin t))) (t_3 (* -1.0 t_2)))
           (if (<= eh -3e+270)
             t_3
             (if (<= eh -1.35e+154)
               t_2
               (if (<= eh 3.4e+162)
                 (fabs
                  (/
                   (fma (sin t) (* t_1 (* eh eh)) (* (cos t) ew))
                   (cosh (asinh (* t_1 eh)))))
                 (if (<= eh 9.2e+210) t_3 t_2))))))
        double code(double eh, double ew, double t) {
        	double t_1 = tan(t) / ew;
        	double t_2 = eh * sin(t);
        	double t_3 = -1.0 * t_2;
        	double tmp;
        	if (eh <= -3e+270) {
        		tmp = t_3;
        	} else if (eh <= -1.35e+154) {
        		tmp = t_2;
        	} else if (eh <= 3.4e+162) {
        		tmp = fabs((fma(sin(t), (t_1 * (eh * eh)), (cos(t) * ew)) / cosh(asinh((t_1 * eh)))));
        	} else if (eh <= 9.2e+210) {
        		tmp = t_3;
        	} else {
        		tmp = t_2;
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	t_1 = Float64(tan(t) / ew)
        	t_2 = Float64(eh * sin(t))
        	t_3 = Float64(-1.0 * t_2)
        	tmp = 0.0
        	if (eh <= -3e+270)
        		tmp = t_3;
        	elseif (eh <= -1.35e+154)
        		tmp = t_2;
        	elseif (eh <= 3.4e+162)
        		tmp = abs(Float64(fma(sin(t), Float64(t_1 * Float64(eh * eh)), Float64(cos(t) * ew)) / cosh(asinh(Float64(t_1 * eh)))));
        	elseif (eh <= 9.2e+210)
        		tmp = t_3;
        	else
        		tmp = t_2;
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 * t$95$2), $MachinePrecision]}, If[LessEqual[eh, -3e+270], t$95$3, If[LessEqual[eh, -1.35e+154], t$95$2, If[LessEqual[eh, 3.4e+162], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$1 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(t$95$1 * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 9.2e+210], t$95$3, t$95$2]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{\tan t}{ew}\\
        t_2 := eh \cdot \sin t\\
        t_3 := -1 \cdot t\_2\\
        \mathbf{if}\;eh \leq -3 \cdot 10^{+270}:\\
        \;\;\;\;t\_3\\
        
        \mathbf{elif}\;eh \leq -1.35 \cdot 10^{+154}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;eh \leq 3.4 \cdot 10^{+162}:\\
        \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(t\_1 \cdot eh\right)}\right|\\
        
        \mathbf{elif}\;eh \leq 9.2 \cdot 10^{+210}:\\
        \;\;\;\;t\_3\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if eh < -3.00000000000000014e270 or 3.40000000000000003e162 < eh < 9.1999999999999995e210

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Applied rewrites1.9%

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          3. Applied rewrites1.2%

            \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
          4. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
            2. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2} + 1}}} \]
            3. lift-pow.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}} + 1}} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)}}^{2} + 1}} \]
            5. unpow-prod-downN/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot {eh}^{2}} + 1}} \]
            6. pow2N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot \color{blue}{\left(eh \cdot eh\right)} + 1}} \]
            7. associate-*r*N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh\right) \cdot eh} + 1}} \]
            8. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
            9. lower-*.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh}, eh, 1\right)}} \]
            10. lower-pow.f641.2

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2}} \cdot eh, eh, 1\right)}} \]
          5. Applied rewrites1.2%

            \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
          6. Taylor expanded in eh around -inf

            \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
          7. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto -1 \cdot \color{blue}{\left(eh \cdot \sin t\right)} \]
            2. lower-*.f64N/A

              \[\leadsto -1 \cdot \left(eh \cdot \color{blue}{\sin t}\right) \]
            3. lift-sin.f6435.4

              \[\leadsto -1 \cdot \left(eh \cdot \sin t\right) \]
          8. Applied rewrites35.4%

            \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]

          if -3.00000000000000014e270 < eh < -1.35000000000000003e154 or 9.1999999999999995e210 < eh

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Applied rewrites1.9%

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
          3. Applied rewrites1.1%

            \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
          4. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
            2. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2} + 1}}} \]
            3. lift-pow.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}} + 1}} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)}}^{2} + 1}} \]
            5. unpow-prod-downN/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot {eh}^{2}} + 1}} \]
            6. pow2N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot \color{blue}{\left(eh \cdot eh\right)} + 1}} \]
            7. associate-*r*N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh\right) \cdot eh} + 1}} \]
            8. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
            9. lower-*.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh}, eh, 1\right)}} \]
            10. lower-pow.f641.1

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2}} \cdot eh, eh, 1\right)}} \]
          5. Applied rewrites1.1%

            \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
          6. Taylor expanded in eh around inf

            \[\leadsto \color{blue}{eh \cdot \sin t} \]
          7. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto eh \cdot \color{blue}{\sin t} \]
            2. lift-sin.f6438.6

              \[\leadsto eh \cdot \sin t \]
          8. Applied rewrites38.6%

            \[\leadsto \color{blue}{eh \cdot \sin t} \]

          if -1.35000000000000003e154 < eh < 3.40000000000000003e162

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Applied rewrites89.4%

            \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
        3. Recombined 3 regimes into one program.
        4. Add Preprocessing

        Alternative 12: 67.2% accurate, 1.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew}\\ t_2 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -1.25 \cdot 10^{-124}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;ew \leq 4.7 \cdot 10^{-129}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), ew\right)}{\cosh \sinh^{-1} \left(t\_1 \cdot eh\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (/ (tan t) ew)) (t_2 (fabs (* ew (cos t)))))
           (if (<= ew -1.25e-124)
             t_2
             (if (<= ew 4.7e-129)
               (fabs (/ (fma (sin t) (* t_1 (* eh eh)) ew) (cosh (asinh (* t_1 eh)))))
               t_2))))
        double code(double eh, double ew, double t) {
        	double t_1 = tan(t) / ew;
        	double t_2 = fabs((ew * cos(t)));
        	double tmp;
        	if (ew <= -1.25e-124) {
        		tmp = t_2;
        	} else if (ew <= 4.7e-129) {
        		tmp = fabs((fma(sin(t), (t_1 * (eh * eh)), ew) / cosh(asinh((t_1 * eh)))));
        	} else {
        		tmp = t_2;
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	t_1 = Float64(tan(t) / ew)
        	t_2 = abs(Float64(ew * cos(t)))
        	tmp = 0.0
        	if (ew <= -1.25e-124)
        		tmp = t_2;
        	elseif (ew <= 4.7e-129)
        		tmp = abs(Float64(fma(sin(t), Float64(t_1 * Float64(eh * eh)), ew) / cosh(asinh(Float64(t_1 * eh)))));
        	else
        		tmp = t_2;
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.25e-124], t$95$2, If[LessEqual[ew, 4.7e-129], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$1 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(t$95$1 * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{\tan t}{ew}\\
        t_2 := \left|ew \cdot \cos t\right|\\
        \mathbf{if}\;ew \leq -1.25 \cdot 10^{-124}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;ew \leq 4.7 \cdot 10^{-129}:\\
        \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), ew\right)}{\cosh \sinh^{-1} \left(t\_1 \cdot eh\right)}\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if ew < -1.2500000000000001e-124 or 4.7000000000000002e-129 < ew

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Applied rewrites74.6%

            \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
          3. Taylor expanded in eh around 0

            \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
          4. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
            2. lift-cos.f6475.3

              \[\leadsto \left|ew \cdot \cos t\right| \]
          5. Applied rewrites75.3%

            \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

          if -1.2500000000000001e-124 < ew < 4.7000000000000002e-129

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Applied rewrites54.7%

            \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
          3. Taylor expanded in t around 0

            \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \color{blue}{ew}\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right| \]
          4. Step-by-step derivation
            1. Applied rewrites48.1%

              \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \color{blue}{ew}\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right| \]
          5. Recombined 2 regimes into one program.
          6. Add Preprocessing

          Alternative 13: 64.7% accurate, 7.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -1.9 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 8 \cdot 10^{-223}:\\ \;\;\;\;eh \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (let* ((t_1 (fabs (* ew (cos t)))))
             (if (<= ew -1.9e-142) t_1 (if (<= ew 8e-223) (* eh (sin t)) t_1))))
          double code(double eh, double ew, double t) {
          	double t_1 = fabs((ew * cos(t)));
          	double tmp;
          	if (ew <= -1.9e-142) {
          		tmp = t_1;
          	} else if (ew <= 8e-223) {
          		tmp = eh * sin(t);
          	} else {
          		tmp = t_1;
          	}
          	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(eh, ew, t)
          use fmin_fmax_functions
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: tmp
              t_1 = abs((ew * cos(t)))
              if (ew <= (-1.9d-142)) then
                  tmp = t_1
              else if (ew <= 8d-223) then
                  tmp = eh * sin(t)
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double eh, double ew, double t) {
          	double t_1 = Math.abs((ew * Math.cos(t)));
          	double tmp;
          	if (ew <= -1.9e-142) {
          		tmp = t_1;
          	} else if (ew <= 8e-223) {
          		tmp = eh * Math.sin(t);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(eh, ew, t):
          	t_1 = math.fabs((ew * math.cos(t)))
          	tmp = 0
          	if ew <= -1.9e-142:
          		tmp = t_1
          	elif ew <= 8e-223:
          		tmp = eh * math.sin(t)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(eh, ew, t)
          	t_1 = abs(Float64(ew * cos(t)))
          	tmp = 0.0
          	if (ew <= -1.9e-142)
          		tmp = t_1;
          	elseif (ew <= 8e-223)
          		tmp = Float64(eh * sin(t));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(eh, ew, t)
          	t_1 = abs((ew * cos(t)));
          	tmp = 0.0;
          	if (ew <= -1.9e-142)
          		tmp = t_1;
          	elseif (ew <= 8e-223)
          		tmp = eh * sin(t);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.9e-142], t$95$1, If[LessEqual[ew, 8e-223], N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \left|ew \cdot \cos t\right|\\
          \mathbf{if}\;ew \leq -1.9 \cdot 10^{-142}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;ew \leq 8 \cdot 10^{-223}:\\
          \;\;\;\;eh \cdot \sin t\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if ew < -1.89999999999999986e-142 or 7.9999999999999998e-223 < ew

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Applied rewrites73.2%

              \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
            3. Taylor expanded in eh around 0

              \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
              2. lift-cos.f6471.0

                \[\leadsto \left|ew \cdot \cos t\right| \]
            5. Applied rewrites71.0%

              \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

            if -1.89999999999999986e-142 < ew < 7.9999999999999998e-223

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Applied rewrites21.6%

              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
            3. Applied rewrites16.5%

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
            4. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
              2. +-commutativeN/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2} + 1}}} \]
              3. lift-pow.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}} + 1}} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)}}^{2} + 1}} \]
              5. unpow-prod-downN/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot {eh}^{2}} + 1}} \]
              6. pow2N/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot \color{blue}{\left(eh \cdot eh\right)} + 1}} \]
              7. associate-*r*N/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh\right) \cdot eh} + 1}} \]
              8. lower-fma.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
              9. lower-*.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh}, eh, 1\right)}} \]
              10. lower-pow.f6410.5

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2}} \cdot eh, eh, 1\right)}} \]
            5. Applied rewrites10.5%

              \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
            6. Taylor expanded in eh around inf

              \[\leadsto \color{blue}{eh \cdot \sin t} \]
            7. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto eh \cdot \color{blue}{\sin t} \]
              2. lift-sin.f6440.0

                \[\leadsto eh \cdot \sin t \]
            8. Applied rewrites40.0%

              \[\leadsto \color{blue}{eh \cdot \sin t} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 14: 45.9% accurate, 7.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.9 \cdot 10^{-142}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{elif}\;ew \leq 1.05 \cdot 10^{-214}:\\ \;\;\;\;eh \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;ew\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (if (<= ew -1.9e-142) (fabs ew) (if (<= ew 1.05e-214) (* eh (sin t)) ew)))
          double code(double eh, double ew, double t) {
          	double tmp;
          	if (ew <= -1.9e-142) {
          		tmp = fabs(ew);
          	} else if (ew <= 1.05e-214) {
          		tmp = eh * sin(t);
          	} else {
          		tmp = ew;
          	}
          	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(eh, ew, t)
          use fmin_fmax_functions
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              real(8) :: tmp
              if (ew <= (-1.9d-142)) then
                  tmp = abs(ew)
              else if (ew <= 1.05d-214) then
                  tmp = eh * sin(t)
              else
                  tmp = ew
              end if
              code = tmp
          end function
          
          public static double code(double eh, double ew, double t) {
          	double tmp;
          	if (ew <= -1.9e-142) {
          		tmp = Math.abs(ew);
          	} else if (ew <= 1.05e-214) {
          		tmp = eh * Math.sin(t);
          	} else {
          		tmp = ew;
          	}
          	return tmp;
          }
          
          def code(eh, ew, t):
          	tmp = 0
          	if ew <= -1.9e-142:
          		tmp = math.fabs(ew)
          	elif ew <= 1.05e-214:
          		tmp = eh * math.sin(t)
          	else:
          		tmp = ew
          	return tmp
          
          function code(eh, ew, t)
          	tmp = 0.0
          	if (ew <= -1.9e-142)
          		tmp = abs(ew);
          	elseif (ew <= 1.05e-214)
          		tmp = Float64(eh * sin(t));
          	else
          		tmp = ew;
          	end
          	return tmp
          end
          
          function tmp_2 = code(eh, ew, t)
          	tmp = 0.0;
          	if (ew <= -1.9e-142)
          		tmp = abs(ew);
          	elseif (ew <= 1.05e-214)
          		tmp = eh * sin(t);
          	else
          		tmp = ew;
          	end
          	tmp_2 = tmp;
          end
          
          code[eh_, ew_, t_] := If[LessEqual[ew, -1.9e-142], N[Abs[ew], $MachinePrecision], If[LessEqual[ew, 1.05e-214], N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision], ew]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;ew \leq -1.9 \cdot 10^{-142}:\\
          \;\;\;\;\left|ew\right|\\
          
          \mathbf{elif}\;ew \leq 1.05 \cdot 10^{-214}:\\
          \;\;\;\;eh \cdot \sin t\\
          
          \mathbf{else}:\\
          \;\;\;\;ew\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if ew < -1.89999999999999986e-142

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Applied rewrites73.9%

              \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
            3. Taylor expanded in t around 0

              \[\leadsto \left|\color{blue}{ew}\right| \]
            4. Step-by-step derivation
              1. Applied rewrites48.7%

                \[\leadsto \left|\color{blue}{ew}\right| \]

              if -1.89999999999999986e-142 < ew < 1.04999999999999996e-214

              1. Initial program 99.8%

                \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              2. Applied rewrites22.2%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
              3. Applied rewrites17.1%

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\color{blue}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
              4. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}} \]
                2. +-commutativeN/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2} + 1}}} \]
                3. lift-pow.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}} + 1}} \]
                4. lift-*.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\color{blue}{\left(\frac{\tan t}{ew} \cdot eh\right)}}^{2} + 1}} \]
                5. unpow-prod-downN/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot {eh}^{2}} + 1}} \]
                6. pow2N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot \color{blue}{\left(eh \cdot eh\right)} + 1}} \]
                7. associate-*r*N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh\right) \cdot eh} + 1}} \]
                8. lower-fma.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
                9. lower-*.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh}, eh, 1\right)}} \]
                10. lower-pow.f6411.0

                  \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\mathsf{fma}\left(\color{blue}{{\left(\frac{\tan t}{ew}\right)}^{2}} \cdot eh, eh, 1\right)}} \]
              5. Applied rewrites11.0%

                \[\leadsto \frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\sqrt{\color{blue}{\mathsf{fma}\left({\left(\frac{\tan t}{ew}\right)}^{2} \cdot eh, eh, 1\right)}}} \]
              6. Taylor expanded in eh around inf

                \[\leadsto \color{blue}{eh \cdot \sin t} \]
              7. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto eh \cdot \color{blue}{\sin t} \]
                2. lift-sin.f6439.9

                  \[\leadsto eh \cdot \sin t \]
              8. Applied rewrites39.9%

                \[\leadsto \color{blue}{eh \cdot \sin t} \]

              if 1.04999999999999996e-214 < ew

              1. Initial program 99.8%

                \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              2. Applied rewrites54.9%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
              3. Applied rewrites65.2%

                \[\leadsto \color{blue}{{\left(\sqrt{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right)}^{2}} \]
              4. Taylor expanded in t around 0

                \[\leadsto \color{blue}{ew} \]
              5. Step-by-step derivation
                1. Applied rewrites46.4%

                  \[\leadsto \color{blue}{ew} \]
              6. Recombined 3 regimes into one program.
              7. Add Preprocessing

              Alternative 15: 42.4% accurate, 287.3× speedup?

              \[\begin{array}{l} \\ \left|ew\right| \end{array} \]
              (FPCore (eh ew t) :precision binary64 (fabs ew))
              double code(double eh, double ew, double t) {
              	return fabs(ew);
              }
              
              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(eh, ew, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: eh
                  real(8), intent (in) :: ew
                  real(8), intent (in) :: t
                  code = abs(ew)
              end function
              
              public static double code(double eh, double ew, double t) {
              	return Math.abs(ew);
              }
              
              def code(eh, ew, t):
              	return math.fabs(ew)
              
              function code(eh, ew, t)
              	return abs(ew)
              end
              
              function tmp = code(eh, ew, t)
              	tmp = abs(ew);
              end
              
              code[eh_, ew_, t_] := N[Abs[ew], $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \left|ew\right|
              \end{array}
              
              Derivation
              1. Initial program 99.8%

                \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              2. Applied rewrites68.7%

                \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
              3. Taylor expanded in t around 0

                \[\leadsto \left|\color{blue}{ew}\right| \]
              4. Step-by-step derivation
                1. Applied rewrites42.4%

                  \[\leadsto \left|\color{blue}{ew}\right| \]
                2. Add Preprocessing

                Alternative 16: 22.3% accurate, 862.0× speedup?

                \[\begin{array}{l} \\ ew \end{array} \]
                (FPCore (eh ew t) :precision binary64 ew)
                double code(double eh, double ew, double t) {
                	return ew;
                }
                
                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(eh, ew, t)
                use fmin_fmax_functions
                    real(8), intent (in) :: eh
                    real(8), intent (in) :: ew
                    real(8), intent (in) :: t
                    code = ew
                end function
                
                public static double code(double eh, double ew, double t) {
                	return ew;
                }
                
                def code(eh, ew, t):
                	return ew
                
                function code(eh, ew, t)
                	return ew
                end
                
                function tmp = code(eh, ew, t)
                	tmp = ew;
                end
                
                code[eh_, ew_, t_] := ew
                
                \begin{array}{l}
                
                \\
                ew
                \end{array}
                
                Derivation
                1. Initial program 99.8%

                  \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
                2. Applied rewrites35.3%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t, ew, \sin t \cdot \left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
                3. Applied rewrites40.9%

                  \[\leadsto \color{blue}{{\left(\sqrt{\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \sin t \cdot eh, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right)}^{2}} \]
                4. Taylor expanded in t around 0

                  \[\leadsto \color{blue}{ew} \]
                5. Step-by-step derivation
                  1. Applied rewrites22.3%

                    \[\leadsto \color{blue}{ew} \]
                  2. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2025107 
                  (FPCore (eh ew t)
                    :name "Example 2 from Robby"
                    :precision binary64
                    (fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))