Example from Robby

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

Specification

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

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

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 12 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 29.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \mathbf{if}\;\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1 \leq 10^{-201}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \mathbf{else}:\\ \;\;\;\;\sin t \cdot ew\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
   (if (<=
        (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1)))
        1e-201)
     (fabs (* ew t))
     (* (sin t) ew))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh / ew) / tan(t)));
	double tmp;
	if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= 1e-201) {
		tmp = fabs((ew * t));
	} else {
		tmp = sin(t) * ew;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = atan(((eh / ew) / tan(t)))
    if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= 1d-201) then
        tmp = abs((ew * t))
    else
        tmp = sin(t) * ew
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
	double tmp;
	if ((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))) <= 1e-201) {
		tmp = Math.abs((ew * t));
	} else {
		tmp = Math.sin(t) * ew;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan(((eh / ew) / math.tan(t)))
	tmp = 0
	if (((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))) <= 1e-201:
		tmp = math.fabs((ew * t))
	else:
		tmp = math.sin(t) * ew
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh / ew) / tan(t)))
	tmp = 0.0
	if (Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))) <= 1e-201)
		tmp = abs(Float64(ew * t));
	else
		tmp = Float64(sin(t) * ew);
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan(((eh / ew) / tan(t)));
	tmp = 0.0;
	if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= 1e-201)
		tmp = abs((ew * t));
	else
		tmp = sin(t) * ew;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-201], N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision], N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\sin t \cdot ew\\


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
      2. lower-sin.f6435.1

        \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites35.1%

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

      \[\leadsto \left|ew \cdot \color{blue}{t}\right| \]
    8. Step-by-step derivation
      1. Applied rewrites18.6%

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

      if 9.99999999999999946e-202 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))

      1. Initial program 99.8%

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

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

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

          \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
        2. lower-sin.f6443.8

          \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
      6. Applied rewrites43.8%

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

          \[\leadsto \color{blue}{\left|ew \cdot \sin t\right|} \]
        2. rem-sqrt-square-revN/A

          \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \sin t\right) \cdot \left(ew \cdot \sin t\right)}} \]
        3. sqrt-prodN/A

          \[\leadsto \color{blue}{\sqrt{ew \cdot \sin t} \cdot \sqrt{ew \cdot \sin t}} \]
        4. rem-square-sqrt43.8

          \[\leadsto \color{blue}{ew \cdot \sin t} \]
      8. Applied rewrites43.8%

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

    Alternative 3: 99.8% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \left|\left(ew \cdot \sin t\right) \cdot {\left({\left(\frac{eh}{ew \cdot \tan t}\right)}^{2} + 1\right)}^{-0.5} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right| \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (fabs
      (+
       (* (* ew (sin t)) (pow (+ (pow (/ eh (* ew (tan t))) 2.0) 1.0) -0.5))
       (* (* eh (cos t)) (sin (atan (/ eh (* (tan t) ew))))))))
    double code(double eh, double ew, double t) {
    	return fabs((((ew * sin(t)) * pow((pow((eh / (ew * tan(t))), 2.0) + 1.0), -0.5)) + ((eh * cos(t)) * sin(atan((eh / (tan(t) * ew)))))));
    }
    
    real(8) function code(eh, ew, t)
        real(8), intent (in) :: eh
        real(8), intent (in) :: ew
        real(8), intent (in) :: t
        code = abs((((ew * sin(t)) * ((((eh / (ew * tan(t))) ** 2.0d0) + 1.0d0) ** (-0.5d0))) + ((eh * cos(t)) * sin(atan((eh / (tan(t) * ew)))))))
    end function
    
    public static double code(double eh, double ew, double t) {
    	return Math.abs((((ew * Math.sin(t)) * Math.pow((Math.pow((eh / (ew * Math.tan(t))), 2.0) + 1.0), -0.5)) + ((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (Math.tan(t) * ew)))))));
    }
    
    def code(eh, ew, t):
    	return math.fabs((((ew * math.sin(t)) * math.pow((math.pow((eh / (ew * math.tan(t))), 2.0) + 1.0), -0.5)) + ((eh * math.cos(t)) * math.sin(math.atan((eh / (math.tan(t) * ew)))))))
    
    function code(eh, ew, t)
    	return abs(Float64(Float64(Float64(ew * sin(t)) * (Float64((Float64(eh / Float64(ew * tan(t))) ^ 2.0) + 1.0) ^ -0.5)) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(tan(t) * ew)))))))
    end
    
    function tmp = code(eh, ew, t)
    	tmp = abs((((ew * sin(t)) * ((((eh / (ew * tan(t))) ^ 2.0) + 1.0) ^ -0.5)) + ((eh * cos(t)) * sin(atan((eh / (tan(t) * ew)))))));
    end
    
    code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Power[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left|\left(ew \cdot \sin t\right) \cdot {\left({\left(\frac{eh}{ew \cdot \tan t}\right)}^{2} + 1\right)}^{-0.5} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right|
    \end{array}
    
    Derivation
    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 76.4% accurate, 1.6× speedup?

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

      1. Initial program 99.8%

        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. Add Preprocessing
      3. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.8e-166 < eh < 9.5000000000000006e53

      1. Initial program 99.8%

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

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

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

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

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

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

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

    Alternative 5: 98.4% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 77.0% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.02 \cdot 10^{+120} \lor \neg \left(ew \leq 4.1 \cdot 10^{-5}\right):\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right)}{ew \cdot t}\right)\right)\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (or (<= ew -2.02e+120) (not (<= ew 4.1e-5)))
         (fabs
          (/
           (fma (/ eh (* ew t)) eh (* (sin t) ew))
           (cosh (asinh (/ (/ eh (tan t)) ew)))))
         (fabs
          (*
           eh
           (* (cos t) (sin (atan (/ (fma (* -0.5 eh) (* t t) eh) (* ew t)))))))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if ((ew <= -2.02e+120) || !(ew <= 4.1e-5)) {
      		tmp = fabs((fma((eh / (ew * t)), eh, (sin(t) * ew)) / cosh(asinh(((eh / tan(t)) / ew)))));
      	} else {
      		tmp = fabs((eh * (cos(t) * sin(atan((fma((-0.5 * eh), (t * t), eh) / (ew * t)))))));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if ((ew <= -2.02e+120) || !(ew <= 4.1e-5))
      		tmp = abs(Float64(fma(Float64(eh / Float64(ew * t)), eh, Float64(sin(t) * ew)) / cosh(asinh(Float64(Float64(eh / tan(t)) / ew)))));
      	else
      		tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(fma(Float64(-0.5 * eh), Float64(t * t), eh) / Float64(ew * t)))))));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.02e+120], N[Not[LessEqual[ew, 4.1e-5]], $MachinePrecision]], N[Abs[N[(N[(N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision] * eh + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(-0.5 * eh), $MachinePrecision] * N[(t * t), $MachinePrecision] + eh), $MachinePrecision] / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;ew \leq -2.02 \cdot 10^{+120} \lor \neg \left(ew \leq 4.1 \cdot 10^{-5}\right):\\
      \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{eh}{ew \cdot t}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right)}{ew \cdot t}\right)\right)\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if ew < -2.0200000000000001e120 or 4.10000000000000005e-5 < ew

        1. Initial program 99.8%

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

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

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

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

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

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

        if -2.0200000000000001e120 < ew < 4.10000000000000005e-5

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        2. Add Preprocessing
        3. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh + \frac{-1}{2} \cdot \left(eh \cdot {t}^{2}\right)}{ew \cdot t}\right)\right)\right| \]
          3. Step-by-step derivation
            1. Applied rewrites80.2%

              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right)}{ew \cdot t}\right)\right)\right| \]
          4. Recombined 2 regimes into one program.
          5. Final simplification78.2%

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

          Alternative 7: 74.3% accurate, 2.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -4.3 \cdot 10^{+120} \lor \neg \left(ew \leq 8.2 \cdot 10^{+129}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right)}{ew \cdot t}\right)\right)\right|\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (if (or (<= ew -4.3e+120) (not (<= ew 8.2e+129)))
             (fabs (* ew (sin t)))
             (fabs
              (*
               eh
               (* (cos t) (sin (atan (/ (fma (* -0.5 eh) (* t t) eh) (* ew t)))))))))
          double code(double eh, double ew, double t) {
          	double tmp;
          	if ((ew <= -4.3e+120) || !(ew <= 8.2e+129)) {
          		tmp = fabs((ew * sin(t)));
          	} else {
          		tmp = fabs((eh * (cos(t) * sin(atan((fma((-0.5 * eh), (t * t), eh) / (ew * t)))))));
          	}
          	return tmp;
          }
          
          function code(eh, ew, t)
          	tmp = 0.0
          	if ((ew <= -4.3e+120) || !(ew <= 8.2e+129))
          		tmp = abs(Float64(ew * sin(t)));
          	else
          		tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(fma(Float64(-0.5 * eh), Float64(t * t), eh) / Float64(ew * t)))))));
          	end
          	return tmp
          end
          
          code[eh_, ew_, t_] := If[Or[LessEqual[ew, -4.3e+120], N[Not[LessEqual[ew, 8.2e+129]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(-0.5 * eh), $MachinePrecision] * N[(t * t), $MachinePrecision] + eh), $MachinePrecision] / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;ew \leq -4.3 \cdot 10^{+120} \lor \neg \left(ew \leq 8.2 \cdot 10^{+129}\right):\\
          \;\;\;\;\left|ew \cdot \sin t\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right)}{ew \cdot t}\right)\right)\right|\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if ew < -4.3000000000000002e120 or 8.2000000000000005e129 < ew

            1. Initial program 99.7%

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

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

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

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              2. lower-sin.f6473.0

                \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
            6. Applied rewrites73.0%

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

            if -4.3000000000000002e120 < ew < 8.2000000000000005e129

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            2. Add Preprocessing
            3. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot t}\right)\right)\right| \]
            10. Step-by-step derivation
              1. Applied rewrites67.8%

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

                \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh + \frac{-1}{2} \cdot \left(eh \cdot {t}^{2}\right)}{ew \cdot t}\right)\right)\right| \]
              3. Step-by-step derivation
                1. Applied rewrites78.1%

                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right)}{ew \cdot t}\right)\right)\right| \]
              4. Recombined 2 regimes into one program.
              5. Final simplification76.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -4.3 \cdot 10^{+120} \lor \neg \left(ew \leq 8.2 \cdot 10^{+129}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right)}{ew \cdot t}\right)\right)\right|\\ \end{array} \]
              6. Add Preprocessing

              Alternative 8: 61.0% accurate, 2.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.72 \lor \neg \left(t \leq 8.6 \cdot 10^{-83}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right|\\ \end{array} \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (if (or (<= t -0.72) (not (<= t 8.6e-83)))
                 (fabs (* ew (sin t)))
                 (fabs (* (tanh (asinh (/ eh (* (tan t) ew)))) eh))))
              double code(double eh, double ew, double t) {
              	double tmp;
              	if ((t <= -0.72) || !(t <= 8.6e-83)) {
              		tmp = fabs((ew * sin(t)));
              	} else {
              		tmp = fabs((tanh(asinh((eh / (tan(t) * ew)))) * eh));
              	}
              	return tmp;
              }
              
              def code(eh, ew, t):
              	tmp = 0
              	if (t <= -0.72) or not (t <= 8.6e-83):
              		tmp = math.fabs((ew * math.sin(t)))
              	else:
              		tmp = math.fabs((math.tanh(math.asinh((eh / (math.tan(t) * ew)))) * eh))
              	return tmp
              
              function code(eh, ew, t)
              	tmp = 0.0
              	if ((t <= -0.72) || !(t <= 8.6e-83))
              		tmp = abs(Float64(ew * sin(t)));
              	else
              		tmp = abs(Float64(tanh(asinh(Float64(eh / Float64(tan(t) * ew)))) * eh));
              	end
              	return tmp
              end
              
              function tmp_2 = code(eh, ew, t)
              	tmp = 0.0;
              	if ((t <= -0.72) || ~((t <= 8.6e-83)))
              		tmp = abs((ew * sin(t)));
              	else
              		tmp = abs((tanh(asinh((eh / (tan(t) * ew)))) * eh));
              	end
              	tmp_2 = tmp;
              end
              
              code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.72], N[Not[LessEqual[t, 8.6e-83]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Tanh[N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;t \leq -0.72 \lor \neg \left(t \leq 8.6 \cdot 10^{-83}\right):\\
              \;\;\;\;\left|ew \cdot \sin t\right|\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right|\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if t < -0.71999999999999997 or 8.60000000000000066e-83 < t

                1. Initial program 99.6%

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

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

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

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

                    \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                6. Applied rewrites52.1%

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

                if -0.71999999999999997 < t < 8.60000000000000066e-83

                1. Initial program 100.0%

                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. Add Preprocessing
                3. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sqrt{{\left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right)}^{2}}} \]
                8. Step-by-step derivation
                  1. lift-sqrt.f64N/A

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

                    \[\leadsto \sqrt{\color{blue}{{\left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right)}^{2}}} \]
                  3. unpow2N/A

                    \[\leadsto \sqrt{\color{blue}{\left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right) \cdot \left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right)}} \]
                  4. rem-sqrt-squareN/A

                    \[\leadsto \color{blue}{\left|\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right|} \]
                9. Applied rewrites77.5%

                  \[\leadsto \color{blue}{\left|\tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right|} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification63.9%

                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.72 \lor \neg \left(t \leq 8.6 \cdot 10^{-83}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right|\\ \end{array} \]
              5. Add Preprocessing

              Alternative 9: 55.3% accurate, 3.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.72 \lor \neg \left(t \leq 6.2 \cdot 10^{-89}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, \frac{eh}{ew} \cdot -0.3333333333333333, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\ \end{array} \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (if (or (<= t -0.72) (not (<= t 6.2e-89)))
                 (fabs (* ew (sin t)))
                 (fabs
                  (*
                   (sin
                    (atan (/ (fma (* t t) (* (/ eh ew) -0.3333333333333333) (/ eh ew)) t)))
                   eh))))
              double code(double eh, double ew, double t) {
              	double tmp;
              	if ((t <= -0.72) || !(t <= 6.2e-89)) {
              		tmp = fabs((ew * sin(t)));
              	} else {
              		tmp = fabs((sin(atan((fma((t * t), ((eh / ew) * -0.3333333333333333), (eh / ew)) / t))) * eh));
              	}
              	return tmp;
              }
              
              function code(eh, ew, t)
              	tmp = 0.0
              	if ((t <= -0.72) || !(t <= 6.2e-89))
              		tmp = abs(Float64(ew * sin(t)));
              	else
              		tmp = abs(Float64(sin(atan(Float64(fma(Float64(t * t), Float64(Float64(eh / ew) * -0.3333333333333333), Float64(eh / ew)) / t))) * eh));
              	end
              	return tmp
              end
              
              code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.72], N[Not[LessEqual[t, 6.2e-89]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(t * t), $MachinePrecision] * N[(N[(eh / ew), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;t \leq -0.72 \lor \neg \left(t \leq 6.2 \cdot 10^{-89}\right):\\
              \;\;\;\;\left|ew \cdot \sin t\right|\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, \frac{eh}{ew} \cdot -0.3333333333333333, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if t < -0.71999999999999997 or 6.19999999999999993e-89 < t

                1. Initial program 99.6%

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

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

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

                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                  2. lower-sin.f6451.8

                    \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                6. Applied rewrites51.8%

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

                if -0.71999999999999997 < t < 6.19999999999999993e-89

                1. Initial program 100.0%

                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. Add Preprocessing
                3. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\sin \tan^{-1} \left(\frac{{t}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{eh}{ew} - \frac{-1}{6} \cdot \frac{eh}{ew}\right) + \frac{eh}{ew}}{t}\right) \cdot eh\right| \]
                7. Step-by-step derivation
                  1. Applied rewrites69.7%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.72 \lor \neg \left(t \leq 6.2 \cdot 10^{-89}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, \frac{eh}{ew} \cdot -0.3333333333333333, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\ \end{array} \]
                10. Add Preprocessing

                Alternative 10: 41.0% accurate, 8.1× speedup?

                \[\begin{array}{l} \\ \left|ew \cdot \sin t\right| \end{array} \]
                (FPCore (eh ew t) :precision binary64 (fabs (* ew (sin t))))
                double code(double eh, double ew, double t) {
                	return fabs((ew * sin(t)));
                }
                
                real(8) function code(eh, ew, t)
                    real(8), intent (in) :: eh
                    real(8), intent (in) :: ew
                    real(8), intent (in) :: t
                    code = abs((ew * sin(t)))
                end function
                
                public static double code(double eh, double ew, double t) {
                	return Math.abs((ew * Math.sin(t)));
                }
                
                def code(eh, ew, t):
                	return math.fabs((ew * math.sin(t)))
                
                function code(eh, ew, t)
                	return abs(Float64(ew * sin(t)))
                end
                
                function tmp = code(eh, ew, t)
                	tmp = abs((ew * sin(t)));
                end
                
                code[eh_, ew_, t_] := N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left|ew \cdot \sin t\right|
                \end{array}
                
                Derivation
                1. Initial program 99.8%

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

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

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

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

                    \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                6. Applied rewrites39.3%

                  \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                7. Add Preprocessing

                Alternative 11: 18.2% accurate, 108.8× speedup?

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

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

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

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

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

                    \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                6. Applied rewrites39.3%

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

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

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

                  Alternative 12: 9.9% accurate, 145.0× speedup?

                  \[\begin{array}{l} \\ t \cdot ew \end{array} \]
                  (FPCore (eh ew t) :precision binary64 (* t ew))
                  double code(double eh, double ew, double t) {
                  	return t * ew;
                  }
                  
                  real(8) function code(eh, ew, t)
                      real(8), intent (in) :: eh
                      real(8), intent (in) :: ew
                      real(8), intent (in) :: t
                      code = t * ew
                  end function
                  
                  public static double code(double eh, double ew, double t) {
                  	return t * ew;
                  }
                  
                  def code(eh, ew, t):
                  	return t * ew
                  
                  function code(eh, ew, t)
                  	return Float64(t * ew)
                  end
                  
                  function tmp = code(eh, ew, t)
                  	tmp = t * ew;
                  end
                  
                  code[eh_, ew_, t_] := N[(t * ew), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  t \cdot ew
                  \end{array}
                  
                  Derivation
                  1. Initial program 99.8%

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

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

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

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

                      \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                  6. Applied rewrites39.3%

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

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

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

                        \[\leadsto \color{blue}{\left|ew \cdot t\right|} \]
                      2. rem-sqrt-square-revN/A

                        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}} \]
                      3. sqrt-prodN/A

                        \[\leadsto \color{blue}{\sqrt{ew \cdot t} \cdot \sqrt{ew \cdot t}} \]
                      4. rem-square-sqrt11.3

                        \[\leadsto \color{blue}{ew \cdot t} \]
                    3. Applied rewrites11.3%

                      \[\leadsto \color{blue}{t \cdot ew} \]
                    4. Add Preprocessing

                    Reproduce

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