Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 10.0s
Alternatives: 12
Speedup: 1.0×

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

\\
\left|\left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot ew\right) \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\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|\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)\right| \]
    2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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}{\tan t \cdot ew}\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (+
   (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t)))))
   (* (* eh (cos t)) (sin (atan (/ eh (* (tan t) ew))))))))
double code(double eh, double ew, double t) {
	return fabs((((ew * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan((eh / (tan(t) * ew)))))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = abs((((ew * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan((eh / (tan(t) * ew)))))))
end function
public static double code(double eh, double ew, double t) {
	return Math.abs((((ew * Math.sin(t)) * Math.cos(Math.atan(((eh / ew) / Math.tan(t))))) + ((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (Math.tan(t) * ew)))))));
}
def code(eh, ew, t):
	return math.fabs((((ew * math.sin(t)) * math.cos(math.atan(((eh / ew) / math.tan(t))))) + ((eh * math.cos(t)) * math.sin(math.atan((eh / (math.tan(t) * ew)))))))
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(tan(t) * ew)))))))
end
function tmp = code(eh, ew, t)
	tmp = abs((((ew * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan((eh / (tan(t) * ew)))))));
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\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}{\tan t \cdot ew}\right)\right|
\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. Add Preprocessing

Alternative 3: 86.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
t_2 := \frac{eh}{\tan t}\\
t_3 := \frac{t\_2}{ew}\\
t_4 := \cosh \sinh^{-1} t\_3\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+35}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\cos t \cdot t\_3, eh, t\_1\right)}{t\_4}\right|\\

\mathbf{elif}\;t \leq 2.65 \cdot 10^{+31}:\\
\;\;\;\;\left|\left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot ew\right) \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{t\_2 \cdot \cos t}{ew}, eh, t\_1\right)}{t\_4}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.1999999999999993e35

    1. Initial program 99.6%

      \[\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 rewrites73.9%

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

    if -9.1999999999999993e35 < t < 2.6500000000000002e31

    1. Initial program 99.9%

      \[\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|\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)\right| \]
      2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot ew\right) \cdot \sin t + \left(eh \cdot e^{\color{blue}{\log \left({\cos t}^{-1}\right)} \cdot -1}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      8. lower-pow.f6494.7

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

      \[\leadsto \left|\left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot ew\right) \cdot \sin t + \left(eh \cdot \color{blue}{e^{\log \left({\cos t}^{-1}\right) \cdot -1}}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    8. Taylor expanded in t around 0

      \[\leadsto \left|\left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot ew\right) \cdot \sin t + \color{blue}{eh} \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    9. Step-by-step derivation
      1. Applied rewrites96.0%

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

      if 2.6500000000000002e31 < t

      1. Initial program 99.6%

        \[\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 rewrites74.9%

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

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

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

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

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

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

    Alternative 4: 79.7% accurate, 1.3× speedup?

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

      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 rewrites13.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval12.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.30000000000000004e80 < eh < 3.8999999999999999e27

      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 rewrites89.5%

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

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

          \[\leadsto \left|\frac{\mathsf{fma}\left(\color{blue}{\frac{\frac{eh}{\tan t}}{ew}} \cdot \cos t, eh, \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{\color{blue}{\frac{eh}{\tan t}}}{ew} \cdot \cos t, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right| \]
        5. associate-/l/N/A

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

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

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

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

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

      if 3.8999999999999999e27 < 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. Applied rewrites17.0%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval15.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto eh \cdot \cos t \]
      9. Applied rewrites65.2%

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

    Alternative 5: 79.7% accurate, 1.3× speedup?

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

      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 rewrites13.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval12.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.30000000000000004e80 < eh < 3.8999999999999999e27

      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 rewrites89.5%

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

      if 3.8999999999999999e27 < 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. Applied rewrites17.0%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval15.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto eh \cdot \cos t \]
      9. Applied rewrites65.2%

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

    Alternative 6: 76.5% accurate, 1.3× speedup?

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

      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 rewrites13.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval12.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.30000000000000004e80 < eh < 3.8999999999999999e27

      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 rewrites89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.8999999999999999e27 < 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. Applied rewrites17.0%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval15.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto eh \cdot \cos t \]
      9. Applied rewrites65.2%

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

    Alternative 7: 71.7% accurate, 1.5× speedup?

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

      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 rewrites15.0%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval13.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -1 \cdot \left(eh \cdot \color{blue}{\cos t}\right) \]
        3. lift-cos.f6466.0

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

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

      if -1.24e64 < eh < 2.10000000000000009

      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 rewrites90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{t \cdot 1 + \frac{0}{-1}}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right| \]
        12. metadata-evalN/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{t \cdot 1 + 0}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right| \]
        13. sin-PIN/A

          \[\leadsto \left|\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{t \cdot 1 + \sin \mathsf{PI}\left(\right)}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right| \]
      7. Applied rewrites77.7%

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

      if 2.10000000000000009 < 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. Applied rewrites19.2%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval17.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{eh \cdot \cos t} \]
      8. 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 \]
      9. Applied rewrites63.4%

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

    Alternative 8: 62.8% accurate, 7.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;eh \leq -4.2 \cdot 10^{+61}:\\ \;\;\;\;-1 \cdot t\_1\\ \mathbf{elif}\;eh \leq 0.0058:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* eh (cos t))))
       (if (<= eh -4.2e+61)
         (* -1.0 t_1)
         (if (<= eh 0.0058) (fabs (* ew (sin t))) t_1))))
    double code(double eh, double ew, double t) {
    	double t_1 = eh * cos(t);
    	double tmp;
    	if (eh <= -4.2e+61) {
    		tmp = -1.0 * t_1;
    	} else if (eh <= 0.0058) {
    		tmp = fabs((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 <= (-4.2d+61)) then
            tmp = (-1.0d0) * t_1
        else if (eh <= 0.0058d0) then
            tmp = abs((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 <= -4.2e+61) {
    		tmp = -1.0 * t_1;
    	} else if (eh <= 0.0058) {
    		tmp = Math.abs((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 <= -4.2e+61:
    		tmp = -1.0 * t_1
    	elif eh <= 0.0058:
    		tmp = math.fabs((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 <= -4.2e+61)
    		tmp = Float64(-1.0 * t_1);
    	elseif (eh <= 0.0058)
    		tmp = abs(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 <= -4.2e+61)
    		tmp = -1.0 * t_1;
    	elseif (eh <= 0.0058)
    		tmp = abs((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, -4.2e+61], N[(-1.0 * t$95$1), $MachinePrecision], If[LessEqual[eh, 0.0058], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := eh \cdot \cos t\\
    \mathbf{if}\;eh \leq -4.2 \cdot 10^{+61}:\\
    \;\;\;\;-1 \cdot t\_1\\
    
    \mathbf{elif}\;eh \leq 0.0058:\\
    \;\;\;\;\left|ew \cdot \sin t\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if eh < -4.2000000000000002e61

      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 rewrites15.1%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval13.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -1 \cdot \left(eh \cdot \color{blue}{\cos t}\right) \]
        3. lift-cos.f6465.9

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

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

      if -4.2000000000000002e61 < eh < 0.0058

      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 rewrites90.5%

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

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

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

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

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

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

        \[\leadsto \left|\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\color{blue}{\tan \left(\pi + t\right)}}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{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. lower-*.f64N/A

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

          \[\leadsto \left|ew \cdot \sin t\right| \]
      7. Applied rewrites61.3%

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

      if 0.0058 < 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. Applied rewrites19.4%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval17.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{eh \cdot \cos t} \]
      8. 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 \]
      9. Applied rewrites63.4%

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

    Alternative 9: 53.7% accurate, 7.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;eh \leq -1.7 \cdot 10^{+244}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 0.0058:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* eh (cos t))))
       (if (<= eh -1.7e+244) t_1 (if (<= eh 0.0058) (fabs (* ew (sin t))) t_1))))
    double code(double eh, double ew, double t) {
    	double t_1 = eh * cos(t);
    	double tmp;
    	if (eh <= -1.7e+244) {
    		tmp = t_1;
    	} else if (eh <= 0.0058) {
    		tmp = fabs((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 <= (-1.7d+244)) then
            tmp = t_1
        else if (eh <= 0.0058d0) then
            tmp = abs((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 <= -1.7e+244) {
    		tmp = t_1;
    	} else if (eh <= 0.0058) {
    		tmp = Math.abs((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 <= -1.7e+244:
    		tmp = t_1
    	elif eh <= 0.0058:
    		tmp = math.fabs((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 <= -1.7e+244)
    		tmp = t_1;
    	elseif (eh <= 0.0058)
    		tmp = abs(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 <= -1.7e+244)
    		tmp = t_1;
    	elseif (eh <= 0.0058)
    		tmp = abs((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, -1.7e+244], t$95$1, If[LessEqual[eh, 0.0058], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := eh \cdot \cos t\\
    \mathbf{if}\;eh \leq -1.7 \cdot 10^{+244}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;eh \leq 0.0058:\\
    \;\;\;\;\left|ew \cdot \sin t\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < -1.70000000000000005e244 or 0.0058 < 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. Applied rewrites16.8%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval15.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.70000000000000005e244 < eh < 0.0058

      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 rewrites78.7%

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

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

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

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

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

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

        \[\leadsto \left|\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\color{blue}{\tan \left(\pi + t\right)}}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{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. lower-*.f64N/A

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

          \[\leadsto \left|ew \cdot \sin t\right| \]
      7. Applied rewrites52.3%

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

    Alternative 10: 38.6% accurate, 7.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;eh \leq -7 \cdot 10^{+205}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 2.4 \cdot 10^{-172}:\\ \;\;\;\;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 -7e+205) t_1 (if (<= eh 2.4e-172) (* ew (sin t)) t_1))))
    double code(double eh, double ew, double t) {
    	double t_1 = eh * cos(t);
    	double tmp;
    	if (eh <= -7e+205) {
    		tmp = t_1;
    	} else if (eh <= 2.4e-172) {
    		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 <= (-7d+205)) then
            tmp = t_1
        else if (eh <= 2.4d-172) 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 <= -7e+205) {
    		tmp = t_1;
    	} else if (eh <= 2.4e-172) {
    		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 <= -7e+205:
    		tmp = t_1
    	elif eh <= 2.4e-172:
    		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 <= -7e+205)
    		tmp = t_1;
    	elseif (eh <= 2.4e-172)
    		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 <= -7e+205)
    		tmp = t_1;
    	elseif (eh <= 2.4e-172)
    		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, -7e+205], t$95$1, If[LessEqual[eh, 2.4e-172], 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 -7 \cdot 10^{+205}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;eh \leq 2.4 \cdot 10^{-172}:\\
    \;\;\;\;ew \cdot \sin t\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < -6.9999999999999996e205 or 2.4000000000000001e-172 < 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. Applied rewrites24.6%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval21.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto eh \cdot \cos t \]
      9. Applied rewrites50.3%

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

      if -6.9999999999999996e205 < eh < 2.4000000000000001e-172

      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 rewrites39.4%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
        14. metadata-eval35.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto ew \cdot \sin t \]
      9. Applied rewrites27.9%

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

    Alternative 11: 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. Applied rewrites32.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
      14. metadata-eval29.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{eh \cdot \cos t} \]
    8. 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 \]
    9. Applied rewrites32.1%

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

    Alternative 12: 22.0% 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. Applied rewrites32.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\sin t, ew, \frac{\frac{eh}{ew} \cdot eh}{\tan t} \cdot \cos t\right)}{\sqrt{\color{blue}{{\left(\frac{\frac{eh}{\tan t}}{ew}\right)}^{2}} - \left(\mathsf{neg}\left(1\right)\right)}} \]
      14. metadata-eval29.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Reproduce

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