Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 10.3s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Alternative 1: 99.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0 \cdot \sin t\\ t_2 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \left|\left(eh \cdot \sin t\right) \cdot \sin t\_2 - \left(ew \cdot \frac{t\_1 \cdot t\_1 - \cos t \cdot \cos t}{t\_1 - \cos t}\right) \cdot \cos t\_2\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* 0.0 (sin t))) (t_2 (atan (/ (* eh (tan t)) (- ew)))))
   (fabs
    (-
     (* (* eh (sin t)) (sin t_2))
     (*
      (* ew (/ (- (* t_1 t_1) (* (cos t) (cos t))) (- t_1 (cos t))))
      (cos t_2))))))
double code(double eh, double ew, double t) {
	double t_1 = 0.0 * sin(t);
	double t_2 = atan(((eh * tan(t)) / -ew));
	return fabs((((eh * sin(t)) * sin(t_2)) - ((ew * (((t_1 * t_1) - (cos(t) * cos(t))) / (t_1 - cos(t)))) * cos(t_2))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto \left|\frac{\color{blue}{\left(\frac{\tan t}{ew} \cdot \left(eh \cdot eh\right)\right) \cdot \sin t} + \cos t \cdot ew}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right| \]
      3. lower-fma.f6471.7

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

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

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

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

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

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

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \leq -4 \cdot 10^{-232}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh, \sin t, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \sin t, eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 52.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq 2 \cdot 10^{-219}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* ew (cos t))) (t_2 (atan (/ (* eh (tan t)) (- ew)))))
   (if (<= (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))) 2e-219)
     (fabs ew)
     t_1)))
double code(double eh, double ew, double t) {
	double t_1 = ew * cos(t);
	double t_2 = atan(((eh * tan(t)) / -ew));
	double tmp;
	if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 2e-219) {
		tmp = fabs(ew);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ew * cos(t)
    t_2 = atan(((eh * tan(t)) / -ew))
    if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 2d-219) then
        tmp = abs(ew)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = ew * Math.cos(t);
	double t_2 = Math.atan(((eh * Math.tan(t)) / -ew));
	double tmp;
	if (((t_1 * Math.cos(t_2)) - ((eh * Math.sin(t)) * Math.sin(t_2))) <= 2e-219) {
		tmp = Math.abs(ew);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = ew * math.cos(t)
	t_2 = math.atan(((eh * math.tan(t)) / -ew))
	tmp = 0
	if ((t_1 * math.cos(t_2)) - ((eh * math.sin(t)) * math.sin(t_2))) <= 2e-219:
		tmp = math.fabs(ew)
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = Float64(ew * cos(t))
	t_2 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
	tmp = 0.0
	if (Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2))) <= 2e-219)
		tmp = abs(ew);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = ew * cos(t);
	t_2 = atan(((eh * tan(t)) / -ew));
	tmp = 0.0;
	if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 2e-219)
		tmp = abs(ew);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-219], N[Abs[ew], $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;\left|ew\right|\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

      1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
      5. Step-by-step derivation
        1. Applied rewrites65.5%

          \[\leadsto \color{blue}{ew \cdot \cos t} \]
      6. Recombined 2 regimes into one program.
      7. Final simplification54.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \leq 2 \cdot 10^{-219}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \]
      8. Add Preprocessing

      Alternative 4: 99.8% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \left|\left(eh \cdot \sin t\right) \cdot \sin t\_1 - \left(ew \cdot \cos t\right) \cdot \cos t\_1\right| \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
         (fabs (- (* (* eh (sin t)) (sin t_1)) (* (* ew (cos t)) (cos t_1))))))
      double code(double eh, double ew, double t) {
      	double t_1 = atan(((eh * tan(t)) / -ew));
      	return fabs((((eh * sin(t)) * sin(t_1)) - ((ew * cos(t)) * cos(t_1))));
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(eh, ew, t)
      use fmin_fmax_functions
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: t_1
          t_1 = atan(((eh * tan(t)) / -ew))
          code = abs((((eh * sin(t)) * sin(t_1)) - ((ew * cos(t)) * cos(t_1))))
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = Math.atan(((eh * Math.tan(t)) / -ew));
      	return Math.abs((((eh * Math.sin(t)) * Math.sin(t_1)) - ((ew * Math.cos(t)) * Math.cos(t_1))));
      }
      
      def code(eh, ew, t):
      	t_1 = math.atan(((eh * math.tan(t)) / -ew))
      	return math.fabs((((eh * math.sin(t)) * math.sin(t_1)) - ((ew * math.cos(t)) * math.cos(t_1))))
      
      function code(eh, ew, t)
      	t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
      	return abs(Float64(Float64(Float64(eh * sin(t)) * sin(t_1)) - Float64(Float64(ew * cos(t)) * cos(t_1))))
      end
      
      function tmp = code(eh, ew, t)
      	t_1 = atan(((eh * tan(t)) / -ew));
      	tmp = abs((((eh * sin(t)) * sin(t_1)) - ((ew * cos(t)) * cos(t_1))));
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
      \left|\left(eh \cdot \sin t\right) \cdot \sin t\_1 - \left(ew \cdot \cos t\right) \cdot \cos t\_1\right|
      \end{array}
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Final simplification99.8%

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

      Alternative 5: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

      Alternative 6: 87.6% accurate, 1.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew} \cdot eh\\ \mathbf{if}\;eh \leq -1 \cdot 10^{+139} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \sin t, \cos t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (/ (tan t) ew) eh)))
         (if (or (<= eh -1e+139) (not (<= eh 1.9e+227)))
           (fabs (* (sin t) eh))
           (fabs (/ (fma (* t_1 eh) (sin t) (* (cos t) ew)) (cosh (asinh t_1)))))))
      double code(double eh, double ew, double t) {
      	double t_1 = (tan(t) / ew) * eh;
      	double tmp;
      	if ((eh <= -1e+139) || !(eh <= 1.9e+227)) {
      		tmp = fabs((sin(t) * eh));
      	} else {
      		tmp = fabs((fma((t_1 * eh), sin(t), (cos(t) * ew)) / cosh(asinh(t_1))));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(Float64(tan(t) / ew) * eh)
      	tmp = 0.0
      	if ((eh <= -1e+139) || !(eh <= 1.9e+227))
      		tmp = abs(Float64(sin(t) * eh));
      	else
      		tmp = abs(Float64(fma(Float64(t_1 * eh), sin(t), Float64(cos(t) * ew)) / cosh(asinh(t_1))));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, If[Or[LessEqual[eh, -1e+139], N[Not[LessEqual[eh, 1.9e+227]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(t$95$1 * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{\tan t}{ew} \cdot eh\\
      \mathbf{if}\;eh \leq -1 \cdot 10^{+139} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\
      \;\;\;\;\left|\sin t \cdot eh\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \sin t, \cos t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if eh < -1.00000000000000003e139 or 1.90000000000000018e227 < eh

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

          \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
        7. Step-by-step derivation
          1. Applied rewrites79.2%

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

          if -1.00000000000000003e139 < eh < 1.90000000000000018e227

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh, \sin t, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification91.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1 \cdot 10^{+139} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh, \sin t, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|\\ \end{array} \]
        10. Add Preprocessing

        Alternative 7: 84.5% accurate, 1.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew}\\ t_2 := t\_1 \cdot eh\\ \mathbf{if}\;eh \leq -8.8 \cdot 10^{+138} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\left(\sin t \cdot t\_1\right) \cdot eh, eh, \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(t\_2, t\_2, 1\right)}}\right|\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (/ (tan t) ew)) (t_2 (* t_1 eh)))
           (if (or (<= eh -8.8e+138) (not (<= eh 1.9e+227)))
             (fabs (* (sin t) eh))
             (fabs
              (/
               (fma (* (* (sin t) t_1) eh) eh (* (cos t) ew))
               (sqrt (fma t_2 t_2 1.0)))))))
        double code(double eh, double ew, double t) {
        	double t_1 = tan(t) / ew;
        	double t_2 = t_1 * eh;
        	double tmp;
        	if ((eh <= -8.8e+138) || !(eh <= 1.9e+227)) {
        		tmp = fabs((sin(t) * eh));
        	} else {
        		tmp = fabs((fma(((sin(t) * t_1) * eh), eh, (cos(t) * ew)) / sqrt(fma(t_2, t_2, 1.0))));
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	t_1 = Float64(tan(t) / ew)
        	t_2 = Float64(t_1 * eh)
        	tmp = 0.0
        	if ((eh <= -8.8e+138) || !(eh <= 1.9e+227))
        		tmp = abs(Float64(sin(t) * eh));
        	else
        		tmp = abs(Float64(fma(Float64(Float64(sin(t) * t_1) * eh), eh, Float64(cos(t) * ew)) / sqrt(fma(t_2, t_2, 1.0))));
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * eh), $MachinePrecision]}, If[Or[LessEqual[eh, -8.8e+138], N[Not[LessEqual[eh, 1.9e+227]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[(N[Sin[t], $MachinePrecision] * t$95$1), $MachinePrecision] * eh), $MachinePrecision] * eh + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t$95$2 * t$95$2 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{\tan t}{ew}\\
        t_2 := t\_1 \cdot eh\\
        \mathbf{if}\;eh \leq -8.8 \cdot 10^{+138} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\
        \;\;\;\;\left|\sin t \cdot eh\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|\frac{\mathsf{fma}\left(\left(\sin t \cdot t\_1\right) \cdot eh, eh, \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(t\_2, t\_2, 1\right)}}\right|\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if eh < -8.8000000000000003e138 or 1.90000000000000018e227 < eh

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
          7. Step-by-step derivation
            1. Applied rewrites79.2%

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

            if -8.8000000000000003e138 < eh < 1.90000000000000018e227

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|\frac{\color{blue}{\mathsf{fma}\left(\left(\sin t \cdot \frac{\tan t}{ew}\right) \cdot eh, eh, \cos t \cdot ew\right)}}{\sqrt{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \frac{\tan t}{ew} \cdot eh, 1\right)}}\right| \]
          8. Recombined 2 regimes into one program.
          9. Final simplification89.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -8.8 \cdot 10^{+138} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\left(\sin t \cdot \frac{\tan t}{ew}\right) \cdot eh, eh, \cos t \cdot ew\right)}{\sqrt{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot eh, \frac{\tan t}{ew} \cdot eh, 1\right)}}\right|\\ \end{array} \]
          10. Add Preprocessing

          Alternative 8: 84.4% accurate, 1.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew}\\ \mathbf{if}\;eh \leq -8.8 \cdot 10^{+138} \lor \neg \left(eh \leq 1.1 \cdot 10^{+154}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{{\left(eh \cdot t\_1\right)}^{2} - -1}}\right|\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (let* ((t_1 (/ (tan t) ew)))
             (if (or (<= eh -8.8e+138) (not (<= eh 1.1e+154)))
               (fabs (* (sin t) eh))
               (fabs
                (/
                 (fma (sin t) (* t_1 (* eh eh)) (* (cos t) ew))
                 (sqrt (- (pow (* eh t_1) 2.0) -1.0)))))))
          double code(double eh, double ew, double t) {
          	double t_1 = tan(t) / ew;
          	double tmp;
          	if ((eh <= -8.8e+138) || !(eh <= 1.1e+154)) {
          		tmp = fabs((sin(t) * eh));
          	} else {
          		tmp = fabs((fma(sin(t), (t_1 * (eh * eh)), (cos(t) * ew)) / sqrt((pow((eh * t_1), 2.0) - -1.0))));
          	}
          	return tmp;
          }
          
          function code(eh, ew, t)
          	t_1 = Float64(tan(t) / ew)
          	tmp = 0.0
          	if ((eh <= -8.8e+138) || !(eh <= 1.1e+154))
          		tmp = abs(Float64(sin(t) * eh));
          	else
          		tmp = abs(Float64(fma(sin(t), Float64(t_1 * Float64(eh * eh)), Float64(cos(t) * ew)) / sqrt(Float64((Float64(eh * t_1) ^ 2.0) - -1.0))));
          	end
          	return tmp
          end
          
          code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[eh, -8.8e+138], N[Not[LessEqual[eh, 1.1e+154]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$1 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(eh * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \frac{\tan t}{ew}\\
          \mathbf{if}\;eh \leq -8.8 \cdot 10^{+138} \lor \neg \left(eh \leq 1.1 \cdot 10^{+154}\right):\\
          \;\;\;\;\left|\sin t \cdot eh\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{{\left(eh \cdot t\_1\right)}^{2} - -1}}\right|\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if eh < -8.8000000000000003e138 or 1.1000000000000001e154 < eh

            1. Initial program 99.9%

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

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

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

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

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

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

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

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

              \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
            7. Step-by-step derivation
              1. Applied rewrites72.1%

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

              if -8.8000000000000003e138 < eh < 1.1000000000000001e154

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\color{blue}{\sqrt{{\left(eh \cdot \frac{\tan t}{ew}\right)}^{2} - -1}}}\right| \]
            8. Recombined 2 regimes into one program.
            9. Final simplification86.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -8.8 \cdot 10^{+138} \lor \neg \left(eh \leq 1.1 \cdot 10^{+154}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, \frac{\tan t}{ew} \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{ew}\right)}^{2} - -1}}\right|\\ \end{array} \]
            10. Add Preprocessing

            Alternative 9: 72.3% accurate, 7.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -5.2 \cdot 10^{+56} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (or (<= eh -5.2e+56) (not (<= eh 1.9e+227)))
               (fabs (* (sin t) eh))
               (fabs (* ew (cos t)))))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if ((eh <= -5.2e+56) || !(eh <= 1.9e+227)) {
            		tmp = fabs((sin(t) * eh));
            	} else {
            		tmp = fabs((ew * cos(t)));
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(eh, ew, t)
            use fmin_fmax_functions
                real(8), intent (in) :: eh
                real(8), intent (in) :: ew
                real(8), intent (in) :: t
                real(8) :: tmp
                if ((eh <= (-5.2d+56)) .or. (.not. (eh <= 1.9d+227))) then
                    tmp = abs((sin(t) * eh))
                else
                    tmp = abs((ew * cos(t)))
                end if
                code = tmp
            end function
            
            public static double code(double eh, double ew, double t) {
            	double tmp;
            	if ((eh <= -5.2e+56) || !(eh <= 1.9e+227)) {
            		tmp = Math.abs((Math.sin(t) * eh));
            	} else {
            		tmp = Math.abs((ew * Math.cos(t)));
            	}
            	return tmp;
            }
            
            def code(eh, ew, t):
            	tmp = 0
            	if (eh <= -5.2e+56) or not (eh <= 1.9e+227):
            		tmp = math.fabs((math.sin(t) * eh))
            	else:
            		tmp = math.fabs((ew * math.cos(t)))
            	return tmp
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if ((eh <= -5.2e+56) || !(eh <= 1.9e+227))
            		tmp = abs(Float64(sin(t) * eh));
            	else
            		tmp = abs(Float64(ew * cos(t)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(eh, ew, t)
            	tmp = 0.0;
            	if ((eh <= -5.2e+56) || ~((eh <= 1.9e+227)))
            		tmp = abs((sin(t) * eh));
            	else
            		tmp = abs((ew * cos(t)));
            	end
            	tmp_2 = tmp;
            end
            
            code[eh_, ew_, t_] := If[Or[LessEqual[eh, -5.2e+56], N[Not[LessEqual[eh, 1.9e+227]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;eh \leq -5.2 \cdot 10^{+56} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\
            \;\;\;\;\left|\sin t \cdot eh\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|ew \cdot \cos t\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if eh < -5.20000000000000022e56 or 1.90000000000000018e227 < eh

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

                \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
              7. Step-by-step derivation
                1. Applied rewrites75.5%

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

                if -5.20000000000000022e56 < eh < 1.90000000000000018e227

                1. Initial program 99.8%

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

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

                  \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
                5. Step-by-step derivation
                  1. Applied rewrites81.2%

                    \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
                6. Recombined 2 regimes into one program.
                7. Final simplification79.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.2 \cdot 10^{+56} \lor \neg \left(eh \leq 1.9 \cdot 10^{+227}\right):\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \]
                8. Add Preprocessing

                Alternative 10: 63.4% accurate, 7.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 1.7 \cdot 10^{+231}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot eh\right|\\ \end{array} \end{array} \]
                (FPCore (eh ew t)
                 :precision binary64
                 (if (<= eh 1.7e+231) (fabs (* ew (cos t))) (fabs (* t eh))))
                double code(double eh, double ew, double t) {
                	double tmp;
                	if (eh <= 1.7e+231) {
                		tmp = fabs((ew * cos(t)));
                	} else {
                		tmp = fabs((t * eh));
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(eh, ew, t)
                use fmin_fmax_functions
                    real(8), intent (in) :: eh
                    real(8), intent (in) :: ew
                    real(8), intent (in) :: t
                    real(8) :: tmp
                    if (eh <= 1.7d+231) then
                        tmp = abs((ew * cos(t)))
                    else
                        tmp = abs((t * eh))
                    end if
                    code = tmp
                end function
                
                public static double code(double eh, double ew, double t) {
                	double tmp;
                	if (eh <= 1.7e+231) {
                		tmp = Math.abs((ew * Math.cos(t)));
                	} else {
                		tmp = Math.abs((t * eh));
                	}
                	return tmp;
                }
                
                def code(eh, ew, t):
                	tmp = 0
                	if eh <= 1.7e+231:
                		tmp = math.fabs((ew * math.cos(t)))
                	else:
                		tmp = math.fabs((t * eh))
                	return tmp
                
                function code(eh, ew, t)
                	tmp = 0.0
                	if (eh <= 1.7e+231)
                		tmp = abs(Float64(ew * cos(t)));
                	else
                		tmp = abs(Float64(t * eh));
                	end
                	return tmp
                end
                
                function tmp_2 = code(eh, ew, t)
                	tmp = 0.0;
                	if (eh <= 1.7e+231)
                		tmp = abs((ew * cos(t)));
                	else
                		tmp = abs((t * eh));
                	end
                	tmp_2 = tmp;
                end
                
                code[eh_, ew_, t_] := If[LessEqual[eh, 1.7e+231], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t * eh), $MachinePrecision]], $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;eh \leq 1.7 \cdot 10^{+231}:\\
                \;\;\;\;\left|ew \cdot \cos t\right|\\
                
                \mathbf{else}:\\
                \;\;\;\;\left|t \cdot eh\right|\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if eh < 1.7e231

                  1. Initial program 99.8%

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

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

                    \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
                  5. Step-by-step derivation
                    1. Applied rewrites71.2%

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

                    if 1.7e231 < eh

                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

                      \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
                    7. Step-by-step derivation
                      1. Applied rewrites89.8%

                        \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
                      2. Taylor expanded in t around 0

                        \[\leadsto \left|t \cdot eh\right| \]
                      3. Step-by-step derivation
                        1. Applied rewrites53.9%

                          \[\leadsto \left|t \cdot eh\right| \]
                      4. Recombined 2 regimes into one program.
                      5. Add Preprocessing

                      Alternative 11: 44.0% accurate, 61.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 1.2 \cdot 10^{+231}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t \cdot eh\right|\\ \end{array} \end{array} \]
                      (FPCore (eh ew t)
                       :precision binary64
                       (if (<= eh 1.2e+231) (fabs ew) (fabs (* t eh))))
                      double code(double eh, double ew, double t) {
                      	double tmp;
                      	if (eh <= 1.2e+231) {
                      		tmp = fabs(ew);
                      	} else {
                      		tmp = fabs((t * eh));
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(eh, ew, t)
                      use fmin_fmax_functions
                          real(8), intent (in) :: eh
                          real(8), intent (in) :: ew
                          real(8), intent (in) :: t
                          real(8) :: tmp
                          if (eh <= 1.2d+231) then
                              tmp = abs(ew)
                          else
                              tmp = abs((t * eh))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double eh, double ew, double t) {
                      	double tmp;
                      	if (eh <= 1.2e+231) {
                      		tmp = Math.abs(ew);
                      	} else {
                      		tmp = Math.abs((t * eh));
                      	}
                      	return tmp;
                      }
                      
                      def code(eh, ew, t):
                      	tmp = 0
                      	if eh <= 1.2e+231:
                      		tmp = math.fabs(ew)
                      	else:
                      		tmp = math.fabs((t * eh))
                      	return tmp
                      
                      function code(eh, ew, t)
                      	tmp = 0.0
                      	if (eh <= 1.2e+231)
                      		tmp = abs(ew);
                      	else
                      		tmp = abs(Float64(t * eh));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(eh, ew, t)
                      	tmp = 0.0;
                      	if (eh <= 1.2e+231)
                      		tmp = abs(ew);
                      	else
                      		tmp = abs((t * eh));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[eh_, ew_, t_] := If[LessEqual[eh, 1.2e+231], N[Abs[ew], $MachinePrecision], N[Abs[N[(t * eh), $MachinePrecision]], $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;eh \leq 1.2 \cdot 10^{+231}:\\
                      \;\;\;\;\left|ew\right|\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left|t \cdot eh\right|\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if eh < 1.20000000000000003e231

                        1. Initial program 99.8%

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

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

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

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

                          if 1.20000000000000003e231 < eh

                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

                            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
                          7. Step-by-step derivation
                            1. Applied rewrites89.8%

                              \[\leadsto \left|\color{blue}{\sin t \cdot eh}\right| \]
                            2. Taylor expanded in t around 0

                              \[\leadsto \left|t \cdot eh\right| \]
                            3. Step-by-step derivation
                              1. Applied rewrites53.9%

                                \[\leadsto \left|t \cdot eh\right| \]
                            4. Recombined 2 regimes into one program.
                            5. Add Preprocessing

                            Alternative 12: 42.7% accurate, 287.3× speedup?

                            \[\begin{array}{l} \\ \left|ew\right| \end{array} \]
                            (FPCore (eh ew t) :precision binary64 (fabs ew))
                            double code(double eh, double ew, double t) {
                            	return fabs(ew);
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(eh, ew, t)
                            use fmin_fmax_functions
                                real(8), intent (in) :: eh
                                real(8), intent (in) :: ew
                                real(8), intent (in) :: t
                                code = abs(ew)
                            end function
                            
                            public static double code(double eh, double ew, double t) {
                            	return Math.abs(ew);
                            }
                            
                            def code(eh, ew, t):
                            	return math.fabs(ew)
                            
                            function code(eh, ew, t)
                            	return abs(ew)
                            end
                            
                            function tmp = code(eh, ew, t)
                            	tmp = abs(ew);
                            end
                            
                            code[eh_, ew_, t_] := N[Abs[ew], $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \left|ew\right|
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.8%

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

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

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

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

                              Alternative 13: 22.0% accurate, 862.0× speedup?

                              \[\begin{array}{l} \\ ew \end{array} \]
                              (FPCore (eh ew t) :precision binary64 ew)
                              double code(double eh, double ew, double t) {
                              	return ew;
                              }
                              
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(eh, ew, t)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: eh
                                  real(8), intent (in) :: ew
                                  real(8), intent (in) :: t
                                  code = ew
                              end function
                              
                              public static double code(double eh, double ew, double t) {
                              	return ew;
                              }
                              
                              def code(eh, ew, t):
                              	return ew
                              
                              function code(eh, ew, t)
                              	return ew
                              end
                              
                              function tmp = code(eh, ew, t)
                              	tmp = ew;
                              end
                              
                              code[eh_, ew_, t_] := ew
                              
                              \begin{array}{l}
                              
                              \\
                              ew
                              \end{array}
                              
                              Derivation
                              1. Initial program 99.8%

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

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

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

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

                                Reproduce

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