Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 8.3s
Alternatives: 9
Speedup: N/A×

Specification

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 74.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
t_2 := \frac{\frac{eh}{\tan t}}{ew}\\
\mathbf{if}\;eh \leq -8.8 \cdot 10^{+27}:\\
\;\;\;\;eh \cdot \left(-\cos t\right)\\

\mathbf{elif}\;eh \leq 5.5 \cdot 10^{-48}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew} \cdot eh}{\tan t}, \cos t, t\_1\right)}{\sqrt{1 + {t\_2}^{2}}}\right|\\

\mathbf{elif}\;eh \leq 1.7 \cdot 10^{+106}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh \cdot eh}{\tan t \cdot ew}, \cos t, t\_1\right)}{\cosh \sinh^{-1} t\_2}\right|\\

\mathbf{else}:\\
\;\;\;\;eh \cdot \cos t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if eh < -8.7999999999999995e27

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \cos \left(t + \mathsf{PI}\left(\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto eh \cdot \color{blue}{\cos \left(t + \mathsf{PI}\left(\right)\right)} \]
      2. cos-+PIN/A

        \[\leadsto eh \cdot \left(\mathsf{neg}\left(\cos t\right)\right) \]
      3. lower-neg.f64N/A

        \[\leadsto eh \cdot \left(-\cos t\right) \]
      4. lift-cos.f6464.7

        \[\leadsto eh \cdot \left(-\cos t\right) \]
    9. Applied rewrites64.7%

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

    if -8.7999999999999995e27 < eh < 5.50000000000000047e-48

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.50000000000000047e-48 < eh < 1.69999999999999997e106

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.69999999999999997e106 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto eh \cdot \color{blue}{\cos t} \]
      2. lift-cos.f6468.7

        \[\leadsto eh \cdot \cos t \]
    10. Applied rewrites68.7%

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

Alternative 3: 79.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{eh}{\tan t}}{ew}\\ \mathbf{if}\;eh \leq -1.2 \cdot 10^{+31}:\\ \;\;\;\;eh \cdot \left(-\cos t\right)\\ \mathbf{elif}\;eh \leq 1.7 \cdot 10^{+106}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \cos t, \sin t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \cos t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ (/ eh (tan t)) ew)))
   (if (<= eh -1.2e+31)
     (* eh (- (cos t)))
     (if (<= eh 1.7e+106)
       (fabs (/ (fma (* t_1 eh) (cos t) (* (sin t) ew)) (cosh (asinh t_1))))
       (* eh (cos t))))))
double code(double eh, double ew, double t) {
	double t_1 = (eh / tan(t)) / ew;
	double tmp;
	if (eh <= -1.2e+31) {
		tmp = eh * -cos(t);
	} else if (eh <= 1.7e+106) {
		tmp = fabs((fma((t_1 * eh), cos(t), (sin(t) * ew)) / cosh(asinh(t_1))));
	} else {
		tmp = eh * cos(t);
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(Float64(eh / tan(t)) / ew)
	tmp = 0.0
	if (eh <= -1.2e+31)
		tmp = Float64(eh * Float64(-cos(t)));
	elseif (eh <= 1.7e+106)
		tmp = abs(Float64(fma(Float64(t_1 * eh), cos(t), Float64(sin(t) * ew)) / cosh(asinh(t_1))));
	else
		tmp = Float64(eh * cos(t));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[LessEqual[eh, -1.2e+31], N[(eh * (-N[Cos[t], $MachinePrecision])), $MachinePrecision], If[LessEqual[eh, 1.7e+106], N[Abs[N[(N[(N[(t$95$1 * eh), $MachinePrecision] * N[Cos[t], $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
\mathbf{if}\;eh \leq -1.2 \cdot 10^{+31}:\\
\;\;\;\;eh \cdot \left(-\cos t\right)\\

\mathbf{elif}\;eh \leq 1.7 \cdot 10^{+106}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \cos t, \sin t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\

\mathbf{else}:\\
\;\;\;\;eh \cdot \cos t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -1.19999999999999991e31

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \cos \left(t + \mathsf{PI}\left(\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto eh \cdot \color{blue}{\cos \left(t + \mathsf{PI}\left(\right)\right)} \]
      2. cos-+PIN/A

        \[\leadsto eh \cdot \left(\mathsf{neg}\left(\cos t\right)\right) \]
      3. lower-neg.f64N/A

        \[\leadsto eh \cdot \left(-\cos t\right) \]
      4. lift-cos.f6465.0

        \[\leadsto eh \cdot \left(-\cos t\right) \]
    9. Applied rewrites65.0%

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

    if -1.19999999999999991e31 < eh < 1.69999999999999997e106

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.69999999999999997e106 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto eh \cdot \color{blue}{\cos t} \]
      2. lift-cos.f6468.7

        \[\leadsto eh \cdot \cos t \]
    10. Applied rewrites68.7%

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

Alternative 4: 72.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -8.8 \cdot 10^{+27}:\\ \;\;\;\;eh \cdot \left(-\cos t\right)\\ \mathbf{elif}\;eh \leq 1.1 \cdot 10^{+95}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew} \cdot eh}{\tan t}, \cos t, \sin t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}}}\right|\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \cos t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= eh -8.8e+27)
   (* eh (- (cos t)))
   (if (<= eh 1.1e+95)
     (fabs
      (/
       (fma (/ (* (/ eh ew) eh) (tan t)) (cos t) (* (sin t) ew))
       (sqrt (+ 1.0 (pow (/ (/ eh (tan t)) ew) 2.0)))))
     (* eh (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= -8.8e+27) {
		tmp = eh * -cos(t);
	} else if (eh <= 1.1e+95) {
		tmp = fabs((fma((((eh / ew) * eh) / tan(t)), cos(t), (sin(t) * ew)) / sqrt((1.0 + pow(((eh / tan(t)) / ew), 2.0)))));
	} else {
		tmp = eh * cos(t);
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= -8.8e+27)
		tmp = Float64(eh * Float64(-cos(t)));
	elseif (eh <= 1.1e+95)
		tmp = abs(Float64(fma(Float64(Float64(Float64(eh / ew) * eh) / tan(t)), cos(t), Float64(sin(t) * ew)) / sqrt(Float64(1.0 + (Float64(Float64(eh / tan(t)) / ew) ^ 2.0)))));
	else
		tmp = Float64(eh * cos(t));
	end
	return tmp
end
code[eh_, ew_, t_] := If[LessEqual[eh, -8.8e+27], N[(eh * (-N[Cos[t], $MachinePrecision])), $MachinePrecision], If[LessEqual[eh, 1.1e+95], N[Abs[N[(N[(N[(N[(N[(eh / ew), $MachinePrecision] * eh), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t], $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -8.8 \cdot 10^{+27}:\\
\;\;\;\;eh \cdot \left(-\cos t\right)\\

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

\mathbf{else}:\\
\;\;\;\;eh \cdot \cos t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -8.7999999999999995e27

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \cos \left(t + \mathsf{PI}\left(\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto eh \cdot \color{blue}{\cos \left(t + \mathsf{PI}\left(\right)\right)} \]
      2. cos-+PIN/A

        \[\leadsto eh \cdot \left(\mathsf{neg}\left(\cos t\right)\right) \]
      3. lower-neg.f64N/A

        \[\leadsto eh \cdot \left(-\cos t\right) \]
      4. lift-cos.f6464.7

        \[\leadsto eh \cdot \left(-\cos t\right) \]
    9. Applied rewrites64.7%

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

    if -8.7999999999999995e27 < eh < 1.0999999999999999e95

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0999999999999999e95 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto eh \cdot \color{blue}{\cos t} \]
      2. lift-cos.f6468.4

        \[\leadsto eh \cdot \cos t \]
    10. Applied rewrites68.4%

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

Alternative 5: 63.2% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -2 \cdot 10^{+27}:\\ \;\;\;\;eh \cdot \left(-\cos t\right)\\ \mathbf{elif}\;eh \leq 3.35 \cdot 10^{-15}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \cos t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= eh -2e+27)
   (* eh (- (cos t)))
   (if (<= eh 3.35e-15) (fabs (* ew (sin t))) (* eh (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= -2e+27) {
		tmp = eh * -cos(t);
	} else if (eh <= 3.35e-15) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = eh * cos(t);
	}
	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 (eh <= (-2d+27)) then
        tmp = eh * -cos(t)
    else if (eh <= 3.35d-15) then
        tmp = abs((ew * sin(t)))
    else
        tmp = eh * cos(t)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= -2e+27) {
		tmp = eh * -Math.cos(t);
	} else if (eh <= 3.35e-15) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = eh * Math.cos(t);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if eh <= -2e+27:
		tmp = eh * -math.cos(t)
	elif eh <= 3.35e-15:
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = eh * math.cos(t)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= -2e+27)
		tmp = Float64(eh * Float64(-cos(t)));
	elseif (eh <= 3.35e-15)
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = Float64(eh * cos(t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (eh <= -2e+27)
		tmp = eh * -cos(t);
	elseif (eh <= 3.35e-15)
		tmp = abs((ew * sin(t)));
	else
		tmp = eh * cos(t);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[eh, -2e+27], N[(eh * (-N[Cos[t], $MachinePrecision])), $MachinePrecision], If[LessEqual[eh, 3.35e-15], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2 \cdot 10^{+27}:\\
\;\;\;\;eh \cdot \left(-\cos t\right)\\

\mathbf{elif}\;eh \leq 3.35 \cdot 10^{-15}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

\mathbf{else}:\\
\;\;\;\;eh \cdot \cos t\\


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \cos \left(t + \mathsf{PI}\left(\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto eh \cdot \color{blue}{\cos \left(t + \mathsf{PI}\left(\right)\right)} \]
      2. cos-+PIN/A

        \[\leadsto eh \cdot \left(\mathsf{neg}\left(\cos t\right)\right) \]
      3. lower-neg.f64N/A

        \[\leadsto eh \cdot \left(-\cos t\right) \]
      4. lift-cos.f6464.7

        \[\leadsto eh \cdot \left(-\cos t\right) \]
    9. Applied rewrites64.7%

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

    if -2e27 < eh < 3.35e-15

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \left|\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew} \cdot eh}{\tan t}, \cos t, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan \color{blue}{\left(\mathsf{PI}\left(\right) + t\right)}}}{ew}\right)}\right| \]
      6. lower-PI.f6473.8

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

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

      \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
    6. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left|ew \cdot \sin t\right| \]
      2. lift-*.f6462.4

        \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
    7. Applied rewrites62.4%

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

    if 3.35e-15 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto eh \cdot \color{blue}{\cos t} \]
      2. lift-cos.f6463.4

        \[\leadsto eh \cdot \cos t \]
    10. Applied rewrites63.4%

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

Alternative 6: 51.9% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -1.3 \cdot 10^{-248}:\\ \;\;\;\;eh \cdot \left(-\cos t\right)\\ \mathbf{elif}\;eh \leq 1.65 \cdot 10^{-169}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \cos t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= eh -1.3e-248)
   (* eh (- (cos t)))
   (if (<= eh 1.65e-169) (* ew (sin t)) (* eh (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= -1.3e-248) {
		tmp = eh * -cos(t);
	} else if (eh <= 1.65e-169) {
		tmp = ew * sin(t);
	} else {
		tmp = eh * cos(t);
	}
	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 (eh <= (-1.3d-248)) then
        tmp = eh * -cos(t)
    else if (eh <= 1.65d-169) then
        tmp = ew * sin(t)
    else
        tmp = eh * cos(t)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= -1.3e-248) {
		tmp = eh * -Math.cos(t);
	} else if (eh <= 1.65e-169) {
		tmp = ew * Math.sin(t);
	} else {
		tmp = eh * Math.cos(t);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if eh <= -1.3e-248:
		tmp = eh * -math.cos(t)
	elif eh <= 1.65e-169:
		tmp = ew * math.sin(t)
	else:
		tmp = eh * math.cos(t)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= -1.3e-248)
		tmp = Float64(eh * Float64(-cos(t)));
	elseif (eh <= 1.65e-169)
		tmp = Float64(ew * sin(t));
	else
		tmp = Float64(eh * cos(t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (eh <= -1.3e-248)
		tmp = eh * -cos(t);
	elseif (eh <= 1.65e-169)
		tmp = ew * sin(t);
	else
		tmp = eh * cos(t);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[eh, -1.3e-248], N[(eh * (-N[Cos[t], $MachinePrecision])), $MachinePrecision], If[LessEqual[eh, 1.65e-169], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.3 \cdot 10^{-248}:\\
\;\;\;\;eh \cdot \left(-\cos t\right)\\

\mathbf{elif}\;eh \leq 1.65 \cdot 10^{-169}:\\
\;\;\;\;ew \cdot \sin t\\

\mathbf{else}:\\
\;\;\;\;eh \cdot \cos t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -1.30000000000000003e-248

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew} \cdot eh}{\frac{-\sin t}{\cos \left(\color{blue}{\pi} + t\right)}}, \cos t, \sin t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}}}}\right)}^{2} \]
    6. Applied rewrites26.7%

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

      \[\leadsto \color{blue}{eh \cdot \cos \left(t + \mathsf{PI}\left(\right)\right)} \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto eh \cdot \color{blue}{\cos \left(t + \mathsf{PI}\left(\right)\right)} \]
      2. cos-+PIN/A

        \[\leadsto eh \cdot \left(\mathsf{neg}\left(\cos t\right)\right) \]
      3. lower-neg.f64N/A

        \[\leadsto eh \cdot \left(-\cos t\right) \]
      4. lift-cos.f6452.2

        \[\leadsto eh \cdot \left(-\cos t\right) \]
    9. Applied rewrites52.2%

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

    if -1.30000000000000003e-248 < eh < 1.65000000000000013e-169

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{ew \cdot \sin t} \]
    8. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto ew \cdot \sin t \]
      2. lift-*.f6441.0

        \[\leadsto ew \cdot \color{blue}{\sin t} \]
    9. Applied rewrites41.0%

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

    if 1.65000000000000013e-169 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto eh \cdot \cos t \]
    10. Applied rewrites56.0%

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

Alternative 7: 39.4% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;eh \leq -5.6 \cdot 10^{-15}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 1.65 \cdot 10^{-169}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* eh (cos t))))
   (if (<= eh -5.6e-15) t_1 (if (<= eh 1.65e-169) (* ew (sin t)) t_1))))
double code(double eh, double ew, double t) {
	double t_1 = eh * cos(t);
	double tmp;
	if (eh <= -5.6e-15) {
		tmp = t_1;
	} else if (eh <= 1.65e-169) {
		tmp = ew * 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 = eh * cos(t)
    if (eh <= (-5.6d-15)) then
        tmp = t_1
    else if (eh <= 1.65d-169) then
        tmp = ew * 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 = eh * Math.cos(t);
	double tmp;
	if (eh <= -5.6e-15) {
		tmp = t_1;
	} else if (eh <= 1.65e-169) {
		tmp = ew * Math.sin(t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = eh * math.cos(t)
	tmp = 0
	if eh <= -5.6e-15:
		tmp = t_1
	elif eh <= 1.65e-169:
		tmp = ew * math.sin(t)
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = Float64(eh * cos(t))
	tmp = 0.0
	if (eh <= -5.6e-15)
		tmp = t_1;
	elseif (eh <= 1.65e-169)
		tmp = Float64(ew * sin(t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = eh * cos(t);
	tmp = 0.0;
	if (eh <= -5.6e-15)
		tmp = t_1;
	elseif (eh <= 1.65e-169)
		tmp = ew * sin(t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -5.6e-15], t$95$1, If[LessEqual[eh, 1.65e-169], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
\mathbf{if}\;eh \leq -5.6 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;eh \leq 1.65 \cdot 10^{-169}:\\
\;\;\;\;ew \cdot \sin t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -5.60000000000000028e-15 or 1.65000000000000013e-169 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto eh \cdot \color{blue}{\cos t} \]
      2. lift-cos.f6441.4

        \[\leadsto eh \cdot \cos t \]
    10. Applied rewrites41.4%

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

    if -5.60000000000000028e-15 < eh < 1.65000000000000013e-169

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{\mathsf{fma}\left(\frac{\frac{eh}{ew} \cdot eh}{\frac{-\sin t}{\cos \left(\color{blue}{\pi} + t\right)}}, \cos t, \sin t \cdot ew\right)}{\sqrt{1 + {\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}}}}\right)}^{2} \]
    6. Applied rewrites41.7%

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

      \[\leadsto \color{blue}{ew \cdot \sin t} \]
    8. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto ew \cdot \sin t \]
      2. lift-*.f6435.6

        \[\leadsto ew \cdot \color{blue}{\sin t} \]
    9. Applied rewrites35.6%

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

Alternative 8: 32.1% accurate, 8.2× speedup?

\[\begin{array}{l} \\ eh \cdot \cos t \end{array} \]
(FPCore (eh ew t) :precision binary64 (* eh (cos t)))
double code(double eh, double ew, double t) {
	return eh * cos(t);
}
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 = eh * cos(t)
end function
public static double code(double eh, double ew, double t) {
	return eh * Math.cos(t);
}
def code(eh, ew, t):
	return eh * math.cos(t)
function code(eh, ew, t)
	return Float64(eh * cos(t))
end
function tmp = code(eh, ew, t)
	tmp = eh * cos(t);
end
code[eh_, ew_, t_] := N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
eh \cdot \cos t
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(\cos t \cdot eh, \frac{\frac{eh}{\tan t}}{ew}, \sin t \cdot ew\right)}{\sqrt{1 + \frac{eh \cdot eh}{\color{blue}{\left(\tan t \cdot ew\right) \cdot \left(\tan t \cdot ew\right)}}}} \]
  7. Applied rewrites22.3%

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

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

      \[\leadsto eh \cdot \color{blue}{\cos t} \]
    2. lift-cos.f6432.1

      \[\leadsto eh \cdot \cos t \]
  10. Applied rewrites32.1%

    \[\leadsto \color{blue}{eh \cdot \cos t} \]
  11. Add Preprocessing

Alternative 9: 22.4% accurate, 870.0× speedup?

\[\begin{array}{l} \\ eh \end{array} \]
(FPCore (eh ew t) :precision binary64 eh)
double code(double eh, double ew, double t) {
	return eh;
}
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 = eh
end function
public static double code(double eh, double ew, double t) {
	return eh;
}
def code(eh, ew, t):
	return eh
function code(eh, ew, t)
	return eh
end
function tmp = code(eh, ew, t)
	tmp = eh;
end
code[eh_, ew_, t_] := eh
\begin{array}{l}

\\
eh
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(\cos t \cdot eh, \frac{\frac{eh}{\tan t}}{ew}, \sin t \cdot ew\right)}{\sqrt{1 + \frac{eh \cdot eh}{\color{blue}{\left(\tan t \cdot ew\right) \cdot \left(\tan t \cdot ew\right)}}}} \]
  7. Applied rewrites22.3%

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

    \[\leadsto \color{blue}{eh} \]
  9. Step-by-step derivation
    1. Applied rewrites22.4%

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

    Reproduce

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