Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 17.3s
Alternatives: 12
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
   (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh / ew) / tan(t)));
	return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
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.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{eh}{\tan t \cdot ew}\\
\left|\mathsf{fma}\left(\frac{ew}{\sqrt{1 + {t\_1}^{2}}}, \sin t, \left(\cos t \cdot eh\right) \cdot \sin \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. 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| \]
    3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\frac{ew}{\sqrt{1 + {\left(\frac{eh}{\tan t \cdot ew}\right)}^{2}}}, \sin t, \left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right| \]
  12. Add Preprocessing

Alternative 2: 98.9% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos t \cdot eh\\ t_2 := \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\\ t_3 := \left|\sin t\_2 \cdot t\_1 + \left(\sin t \cdot ew\right) \cdot \cos t\_2\right|\\ \mathbf{if}\;ew \leq -1.12 \cdot 10^{-125}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;ew \leq 7.5 \cdot 10^{-134}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right) \cdot t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (cos t) eh))
        (t_2 (atan (/ eh (* t ew))))
        (t_3 (fabs (+ (* (sin t_2) t_1) (* (* (sin t) ew) (cos t_2))))))
   (if (<= ew -1.12e-125)
     t_3
     (if (<= ew 7.5e-134)
       (fabs (* (sin (atan (* (/ (/ eh (sin t)) ew) (cos t)))) t_1))
       t_3))))
double code(double eh, double ew, double t) {
	double t_1 = cos(t) * eh;
	double t_2 = atan((eh / (t * ew)));
	double t_3 = fabs(((sin(t_2) * t_1) + ((sin(t) * ew) * cos(t_2))));
	double tmp;
	if (ew <= -1.12e-125) {
		tmp = t_3;
	} else if (ew <= 7.5e-134) {
		tmp = fabs((sin(atan((((eh / sin(t)) / ew) * cos(t)))) * t_1));
	} else {
		tmp = t_3;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = cos(t) * eh
    t_2 = atan((eh / (t * ew)))
    t_3 = abs(((sin(t_2) * t_1) + ((sin(t) * ew) * cos(t_2))))
    if (ew <= (-1.12d-125)) then
        tmp = t_3
    else if (ew <= 7.5d-134) then
        tmp = abs((sin(atan((((eh / sin(t)) / ew) * cos(t)))) * t_1))
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.cos(t) * eh;
	double t_2 = Math.atan((eh / (t * ew)));
	double t_3 = Math.abs(((Math.sin(t_2) * t_1) + ((Math.sin(t) * ew) * Math.cos(t_2))));
	double tmp;
	if (ew <= -1.12e-125) {
		tmp = t_3;
	} else if (ew <= 7.5e-134) {
		tmp = Math.abs((Math.sin(Math.atan((((eh / Math.sin(t)) / ew) * Math.cos(t)))) * t_1));
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.cos(t) * eh
	t_2 = math.atan((eh / (t * ew)))
	t_3 = math.fabs(((math.sin(t_2) * t_1) + ((math.sin(t) * ew) * math.cos(t_2))))
	tmp = 0
	if ew <= -1.12e-125:
		tmp = t_3
	elif ew <= 7.5e-134:
		tmp = math.fabs((math.sin(math.atan((((eh / math.sin(t)) / ew) * math.cos(t)))) * t_1))
	else:
		tmp = t_3
	return tmp
function code(eh, ew, t)
	t_1 = Float64(cos(t) * eh)
	t_2 = atan(Float64(eh / Float64(t * ew)))
	t_3 = abs(Float64(Float64(sin(t_2) * t_1) + Float64(Float64(sin(t) * ew) * cos(t_2))))
	tmp = 0.0
	if (ew <= -1.12e-125)
		tmp = t_3;
	elseif (ew <= 7.5e-134)
		tmp = abs(Float64(sin(atan(Float64(Float64(Float64(eh / sin(t)) / ew) * cos(t)))) * t_1));
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = cos(t) * eh;
	t_2 = atan((eh / (t * ew)));
	t_3 = abs(((sin(t_2) * t_1) + ((sin(t) * ew) * cos(t_2))));
	tmp = 0.0;
	if (ew <= -1.12e-125)
		tmp = t_3;
	elseif (ew <= 7.5e-134)
		tmp = abs((sin(atan((((eh / sin(t)) / ew) * cos(t)))) * t_1));
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(N[(N[Sin[t$95$2], $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.12e-125], t$95$3, If[LessEqual[ew, 7.5e-134], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], t$95$3]]]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -1.11999999999999997e-125 or 7.50000000000000048e-134 < 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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

    if -1.11999999999999997e-125 < ew < 7.50000000000000048e-134

    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 ew around 0

      \[\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| \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -1.12 \cdot 10^{-125}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right) + \left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\ \mathbf{elif}\;ew \leq 7.5 \cdot 10^{-134}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right) + \left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.0% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.89999999999999988e-83 or 1.40000000000000011e-112 < eh

    1. Initial program 99.9%

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

      \[\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| \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999988e-83 < eh < 1.40000000000000011e-112

    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. 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| \]
      3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \left(\sin t \cdot ew\right)\right| \]
    10. Recombined 2 regimes into one program.
    11. Final simplification80.7%

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

    Alternative 5: 58.6% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right|\\ \mathbf{if}\;eh \leq -7 \cdot 10^{-59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 5.4 \cdot 10^{-102}:\\ \;\;\;\;\left|\left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1
             (fabs
              (*
               (sin
                (atan
                 (*
                  (/
                   (fma
                    (fma
                     (fma
                      -0.0021164021164021165
                      (/ (* t t) ew)
                      (/ -0.022222222222222223 ew))
                     (* t t)
                     (/ -0.3333333333333333 ew))
                    (* t t)
                    (/ 1.0 ew))
                   t)
                  eh)))
               eh))))
       (if (<= eh -7e-59)
         t_1
         (if (<= eh 5.4e-102)
           (fabs (* (* (sin t) ew) (cos (atan (/ eh (* t ew))))))
           t_1))))
    double code(double eh, double ew, double t) {
    	double t_1 = fabs((sin(atan(((fma(fma(fma(-0.0021164021164021165, ((t * t) / ew), (-0.022222222222222223 / ew)), (t * t), (-0.3333333333333333 / ew)), (t * t), (1.0 / ew)) / t) * eh))) * eh));
    	double tmp;
    	if (eh <= -7e-59) {
    		tmp = t_1;
    	} else if (eh <= 5.4e-102) {
    		tmp = fabs(((sin(t) * ew) * cos(atan((eh / (t * ew))))));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = abs(Float64(sin(atan(Float64(Float64(fma(fma(fma(-0.0021164021164021165, Float64(Float64(t * t) / ew), Float64(-0.022222222222222223 / ew)), Float64(t * t), Float64(-0.3333333333333333 / ew)), Float64(t * t), Float64(1.0 / ew)) / t) * eh))) * eh))
    	tmp = 0.0
    	if (eh <= -7e-59)
    		tmp = t_1;
    	elseif (eh <= 5.4e-102)
    		tmp = abs(Float64(Float64(sin(t) * ew) * cos(atan(Float64(eh / Float64(t * ew))))));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(N[(-0.0021164021164021165 * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision] + N[(-0.022222222222222223 / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(-0.3333333333333333 / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(1.0 / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -7e-59], t$95$1, If[LessEqual[eh, 5.4e-102], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right|\\
    \mathbf{if}\;eh \leq -7 \cdot 10^{-59}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;eh \leq 5.4 \cdot 10^{-102}:\\
    \;\;\;\;\left|\left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < -7.0000000000000002e-59 or 5.4e-102 < eh

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|\sin \tan^{-1} \left(eh \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t}\right) \cdot eh\right| \]

            if -7.0000000000000002e-59 < eh < 5.4e-102

            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. 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| \]
              3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \left(\sin t \cdot ew\right)\right| \]
            10. Recombined 2 regimes into one program.
            11. Final simplification62.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -7 \cdot 10^{-59}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right|\\ \mathbf{elif}\;eh \leq 5.4 \cdot 10^{-102}:\\ \;\;\;\;\left|\left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right|\\ \end{array} \]
            12. Add Preprocessing

            Alternative 6: 42.1% accurate, 2.9× speedup?

            \[\begin{array}{l} \\ \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right| \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (fabs
              (*
               (sin
                (atan
                 (*
                  (/
                   (fma
                    (fma
                     (fma
                      -0.0021164021164021165
                      (/ (* t t) ew)
                      (/ -0.022222222222222223 ew))
                     (* t t)
                     (/ -0.3333333333333333 ew))
                    (* t t)
                    (/ 1.0 ew))
                   t)
                  eh)))
               eh)))
            double code(double eh, double ew, double t) {
            	return fabs((sin(atan(((fma(fma(fma(-0.0021164021164021165, ((t * t) / ew), (-0.022222222222222223 / ew)), (t * t), (-0.3333333333333333 / ew)), (t * t), (1.0 / ew)) / t) * eh))) * eh));
            }
            
            function code(eh, ew, t)
            	return abs(Float64(sin(atan(Float64(Float64(fma(fma(fma(-0.0021164021164021165, Float64(Float64(t * t) / ew), Float64(-0.022222222222222223 / ew)), Float64(t * t), Float64(-0.3333333333333333 / ew)), Float64(t * t), Float64(1.0 / ew)) / t) * eh))) * eh))
            end
            
            code[eh_, ew_, t_] := N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(N[(-0.0021164021164021165 * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision] + N[(-0.022222222222222223 / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(-0.3333333333333333 / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(1.0 / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\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. 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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left|\sin \tan^{-1} \left(eh \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t}\right) \cdot eh\right| \]
                  2. Final simplification37.4%

                    \[\leadsto \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, \frac{t \cdot t}{ew}, \frac{-0.022222222222222223}{ew}\right), t \cdot t, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right| \]
                  3. Add Preprocessing

                  Alternative 7: 42.1% accurate, 3.1× speedup?

                  \[\begin{array}{l} \\ \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.022222222222222223 \cdot t, \frac{t}{ew}, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right| \end{array} \]
                  (FPCore (eh ew t)
                   :precision binary64
                   (fabs
                    (*
                     (sin
                      (atan
                       (*
                        (/
                         (fma
                          (fma (* -0.022222222222222223 t) (/ t ew) (/ -0.3333333333333333 ew))
                          (* t t)
                          (/ 1.0 ew))
                         t)
                        eh)))
                     eh)))
                  double code(double eh, double ew, double t) {
                  	return fabs((sin(atan(((fma(fma((-0.022222222222222223 * t), (t / ew), (-0.3333333333333333 / ew)), (t * t), (1.0 / ew)) / t) * eh))) * eh));
                  }
                  
                  function code(eh, ew, t)
                  	return abs(Float64(sin(atan(Float64(Float64(fma(fma(Float64(-0.022222222222222223 * t), Float64(t / ew), Float64(-0.3333333333333333 / ew)), Float64(t * t), Float64(1.0 / ew)) / t) * eh))) * eh))
                  end
                  
                  code[eh_, ew_, t_] := N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(N[(-0.022222222222222223 * t), $MachinePrecision] * N[(t / ew), $MachinePrecision] + N[(-0.3333333333333333 / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(1.0 / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.022222222222222223 \cdot t, \frac{t}{ew}, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\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. 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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left|\sin \tan^{-1} \left(eh \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.022222222222222223 \cdot t, \frac{t}{ew}, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t}\right) \cdot eh\right| \]
                      2. Final simplification37.4%

                        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.022222222222222223 \cdot t, \frac{t}{ew}, \frac{-0.3333333333333333}{ew}\right), t \cdot t, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right| \]
                      3. Add Preprocessing

                      Alternative 8: 42.1% accurate, 3.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left|\sin \tan^{-1} \left(eh \cdot \left(\left(\frac{\frac{1}{ew \cdot t}}{t} - \frac{0.3333333333333333}{ew}\right) \cdot t\right)\right) \cdot eh\right| \]
                            2. Final simplification37.4%

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

                            Alternative 9: 42.1% accurate, 3.4× speedup?

                            \[\begin{array}{l} \\ \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{t \cdot t}{ew}, -0.3333333333333333, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right| \end{array} \]
                            (FPCore (eh ew t)
                             :precision binary64
                             (fabs
                              (*
                               (sin
                                (atan (* (/ (fma (/ (* t t) ew) -0.3333333333333333 (/ 1.0 ew)) t) eh)))
                               eh)))
                            double code(double eh, double ew, double t) {
                            	return fabs((sin(atan(((fma(((t * t) / ew), -0.3333333333333333, (1.0 / ew)) / t) * eh))) * eh));
                            }
                            
                            function code(eh, ew, t)
                            	return abs(Float64(sin(atan(Float64(Float64(fma(Float64(Float64(t * t) / ew), -0.3333333333333333, Float64(1.0 / ew)) / t) * eh))) * eh))
                            end
                            
                            code[eh_, ew_, t_] := N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision] * -0.3333333333333333 + N[(1.0 / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{t \cdot t}{ew}, -0.3333333333333333, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\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. 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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left|\sin \tan^{-1} \left(eh \cdot \frac{\mathsf{fma}\left(\frac{t \cdot t}{ew}, -0.3333333333333333, \frac{1}{ew}\right)}{t}\right) \cdot eh\right| \]
                                2. Final simplification37.4%

                                  \[\leadsto \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{t \cdot t}{ew}, -0.3333333333333333, \frac{1}{ew}\right)}{t} \cdot eh\right) \cdot eh\right| \]
                                3. Add Preprocessing

                                Alternative 10: 42.1% accurate, 3.5× speedup?

                                \[\begin{array}{l} \\ \left|\sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(t \cdot t, -0.3333333333333333, 1\right)}{t}}{ew} \cdot eh\right) \cdot eh\right| \end{array} \]
                                (FPCore (eh ew t)
                                 :precision binary64
                                 (fabs
                                  (*
                                   (sin (atan (* (/ (/ (fma (* t t) -0.3333333333333333 1.0) t) ew) eh)))
                                   eh)))
                                double code(double eh, double ew, double t) {
                                	return fabs((sin(atan((((fma((t * t), -0.3333333333333333, 1.0) / t) / ew) * eh))) * eh));
                                }
                                
                                function code(eh, ew, t)
                                	return abs(Float64(sin(atan(Float64(Float64(Float64(fma(Float64(t * t), -0.3333333333333333, 1.0) / t) / ew) * eh))) * eh))
                                end
                                
                                code[eh_, ew_, t_] := N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(N[(t * t), $MachinePrecision] * -0.3333333333333333 + 1.0), $MachinePrecision] / t), $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]
                                
                                \begin{array}{l}
                                
                                \\
                                \left|\sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(t \cdot t, -0.3333333333333333, 1\right)}{t}}{ew} \cdot eh\right) \cdot eh\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. 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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left|\sin \tan^{-1} \left(eh \cdot \frac{\frac{\mathsf{fma}\left(t \cdot t, -0.3333333333333333, 1\right)}{t}}{ew}\right) \cdot eh\right| \]
                                      2. Final simplification37.4%

                                        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(t \cdot t, -0.3333333333333333, 1\right)}{t}}{ew} \cdot eh\right) \cdot eh\right| \]
                                      3. Add Preprocessing

                                      Alternative 11: 40.0% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 12: 39.9% accurate, 3.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Reproduce

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