Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 18.1s
Alternatives: 11
Speedup: 1.1×

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} t\_1 + \frac{ew \cdot \sin t}{\mathsf{hypot}\left(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. associate-/r*99.8%

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

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

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

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

      \[\leadsto \left|\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, \color{blue}{\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| \]
  4. Applied egg-rr99.8%

    \[\leadsto \left|\color{blue}{\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, \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| \]
  5. Final simplification99.8%

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

Alternative 3: 99.7% accurate, 1.1× speedup?

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

\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{\sin t}}\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

    \[\leadsto \left|\color{blue}{ew \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \sin 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. *-commutative99.8%

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

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

      \[\leadsto \left|ew \cdot \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \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| \]
    4. hypot-1-def99.8%

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{\sin t}{\mathsf{hypot}\left(1, \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| \]
    6. clear-num99.7%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\sin t}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    7. un-div-inv99.7%

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\sin t}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    8. associate-/r*99.7%

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

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

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

Alternative 4: 99.0% accurate, 1.1× speedup?

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

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

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

    \[\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. Final simplification98.4%

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

Alternative 5: 98.4% accurate, 1.5× speedup?

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

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

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

    \[\leadsto \left|\color{blue}{ew \cdot \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \sin 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. *-commutative99.8%

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

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

      \[\leadsto \left|ew \cdot \left(\sin t \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \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| \]
    4. hypot-1-def99.8%

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

      \[\leadsto \left|ew \cdot \color{blue}{\frac{\sin t}{\mathsf{hypot}\left(1, \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| \]
    6. clear-num99.7%

      \[\leadsto \left|ew \cdot \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\sin t}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    7. un-div-inv99.7%

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}{\sin t}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    8. associate-/r*99.7%

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

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

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

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

Alternative 6: 73.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -4.6 \cdot 10^{+158} \lor \neg \left(ew \leq 10^{+47}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= ew -4.6e+158) (not (<= ew 1e+47)))
   (fabs (* ew (sin t)))
   (fabs (* (cos t) (* eh (sin (atan (/ eh (* ew (tan t))))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -4.6e+158) || !(ew <= 1e+47)) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = fabs((cos(t) * (eh * sin(atan((eh / (ew * tan(t))))))));
	}
	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) :: tmp
    if ((ew <= (-4.6d+158)) .or. (.not. (ew <= 1d+47))) then
        tmp = abs((ew * sin(t)))
    else
        tmp = abs((cos(t) * (eh * sin(atan((eh / (ew * tan(t))))))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -4.6e+158) || !(ew <= 1e+47)) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = Math.abs((Math.cos(t) * (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t))))))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (ew <= -4.6e+158) or not (ew <= 1e+47):
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = math.fabs((math.cos(t) * (eh * math.sin(math.atan((eh / (ew * math.tan(t))))))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((ew <= -4.6e+158) || !(ew <= 1e+47))
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = abs(Float64(cos(t) * Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((ew <= -4.6e+158) || ~((ew <= 1e+47)))
		tmp = abs((ew * sin(t)));
	else
		tmp = abs((cos(t) * (eh * sin(atan((eh / (ew * tan(t))))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -4.6e+158], N[Not[LessEqual[ew, 1e+47]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4.6 \cdot 10^{+158} \lor \neg \left(ew \leq 10^{+47}\right):\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -4.59999999999999971e158 or 1e47 < ew

    1. Initial program 99.7%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
      3. associate-/r*99.7%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt99.1%

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

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

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

      \[\leadsto \color{blue}{ew \cdot \sin t} \]
    8. Step-by-step derivation
      1. add-cube-cbrt39.6%

        \[\leadsto ew \cdot \color{blue}{\left(\left(\sqrt[3]{\sin t} \cdot \sqrt[3]{\sin t}\right) \cdot \sqrt[3]{\sin t}\right)} \]
      2. pow339.6%

        \[\leadsto ew \cdot \color{blue}{{\left(\sqrt[3]{\sin t}\right)}^{3}} \]
    9. Applied egg-rr39.6%

      \[\leadsto ew \cdot \color{blue}{{\left(\sqrt[3]{\sin t}\right)}^{3}} \]
    10. Step-by-step derivation
      1. rem-cube-cbrt40.1%

        \[\leadsto ew \cdot \color{blue}{\sin t} \]
      2. add-sqr-sqrt39.4%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \sin t} \cdot \sqrt{ew \cdot \sin t}} \]
      3. sqrt-unprod32.9%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \sin t\right) \cdot \left(ew \cdot \sin t\right)}} \]
      4. pow232.9%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \sin t\right)}^{2}}} \]
    11. Applied egg-rr32.9%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \sin t\right)}^{2}}} \]
    12. Step-by-step derivation
      1. unpow232.9%

        \[\leadsto \sqrt{\color{blue}{\left(ew \cdot \sin t\right) \cdot \left(ew \cdot \sin t\right)}} \]
      2. rem-sqrt-square74.3%

        \[\leadsto \color{blue}{\left|ew \cdot \sin t\right|} \]
    13. Simplified74.3%

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

    if -4.59999999999999971e158 < ew < 1e47

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.8%

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
      3. associate-/r*99.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -4.6 \cdot 10^{+158} \lor \neg \left(ew \leq 10^{+47}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 60.6% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -9.2 \cdot 10^{-58} \lor \neg \left(t \leq 19000000000000\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -9.2e-58) (not (<= t 19000000000000.0)))
   (fabs (* ew (sin t)))
   (fabs (* eh (sin (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -9.2e-58) || !(t <= 19000000000000.0)) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = fabs((eh * sin(atan((eh / (ew * t))))));
	}
	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) :: tmp
    if ((t <= (-9.2d-58)) .or. (.not. (t <= 19000000000000.0d0))) then
        tmp = abs((ew * sin(t)))
    else
        tmp = abs((eh * sin(atan((eh / (ew * t))))))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -9.2e-58) || !(t <= 19000000000000.0)) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = Math.abs((eh * Math.sin(Math.atan((eh / (ew * t))))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -9.2e-58) or not (t <= 19000000000000.0):
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = math.fabs((eh * math.sin(math.atan((eh / (ew * t))))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -9.2e-58) || !(t <= 19000000000000.0))
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = abs(Float64(eh * sin(atan(Float64(eh / Float64(ew * t))))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -9.2e-58) || ~((t <= 19000000000000.0)))
		tmp = abs((ew * sin(t)));
	else
		tmp = abs((eh * sin(atan((eh / (ew * t))))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -9.2e-58], N[Not[LessEqual[t, 19000000000000.0]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{-58} \lor \neg \left(t \leq 19000000000000\right):\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.1999999999999995e-58 or 1.9e13 < t

    1. Initial program 99.7%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
      3. associate-/r*99.7%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt99.1%

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

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

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

      \[\leadsto \color{blue}{ew \cdot \sin t} \]
    8. Step-by-step derivation
      1. add-cube-cbrt30.5%

        \[\leadsto ew \cdot \color{blue}{\left(\left(\sqrt[3]{\sin t} \cdot \sqrt[3]{\sin t}\right) \cdot \sqrt[3]{\sin t}\right)} \]
      2. pow330.4%

        \[\leadsto ew \cdot \color{blue}{{\left(\sqrt[3]{\sin t}\right)}^{3}} \]
    9. Applied egg-rr30.4%

      \[\leadsto ew \cdot \color{blue}{{\left(\sqrt[3]{\sin t}\right)}^{3}} \]
    10. Step-by-step derivation
      1. rem-cube-cbrt30.9%

        \[\leadsto ew \cdot \color{blue}{\sin t} \]
      2. add-sqr-sqrt30.0%

        \[\leadsto \color{blue}{\sqrt{ew \cdot \sin t} \cdot \sqrt{ew \cdot \sin t}} \]
      3. sqrt-unprod31.1%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \sin t\right) \cdot \left(ew \cdot \sin t\right)}} \]
      4. pow231.1%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \sin t\right)}^{2}}} \]
    11. Applied egg-rr31.1%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \sin t\right)}^{2}}} \]
    12. Step-by-step derivation
      1. unpow231.1%

        \[\leadsto \sqrt{\color{blue}{\left(ew \cdot \sin t\right) \cdot \left(ew \cdot \sin t\right)}} \]
      2. rem-sqrt-square54.7%

        \[\leadsto \color{blue}{\left|ew \cdot \sin t\right|} \]
    13. Simplified54.7%

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

    if -9.1999999999999995e-58 < t < 1.9e13

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*100.0%

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
      3. associate-/r*100.0%

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

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

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

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

      \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}\right| \]
    6. Step-by-step derivation
      1. add-cube-cbrt74.9%

        \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{\left(\sqrt[3]{ew \cdot \tan t} \cdot \sqrt[3]{ew \cdot \tan t}\right) \cdot \sqrt[3]{ew \cdot \tan t}}}\right)\right| \]
      2. pow374.9%

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

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

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

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

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

Alternative 8: 42.5% accurate, 4.5× speedup?

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

\\
\left|ew \cdot \sin t\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. associate-/r*99.8%

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-sqr-sqrt99.2%

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

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

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

    \[\leadsto \color{blue}{ew \cdot \sin t} \]
  8. Step-by-step derivation
    1. add-cube-cbrt22.3%

      \[\leadsto ew \cdot \color{blue}{\left(\left(\sqrt[3]{\sin t} \cdot \sqrt[3]{\sin t}\right) \cdot \sqrt[3]{\sin t}\right)} \]
    2. pow322.3%

      \[\leadsto ew \cdot \color{blue}{{\left(\sqrt[3]{\sin t}\right)}^{3}} \]
  9. Applied egg-rr22.3%

    \[\leadsto ew \cdot \color{blue}{{\left(\sqrt[3]{\sin t}\right)}^{3}} \]
  10. Step-by-step derivation
    1. rem-cube-cbrt22.6%

      \[\leadsto ew \cdot \color{blue}{\sin t} \]
    2. add-sqr-sqrt21.8%

      \[\leadsto \color{blue}{\sqrt{ew \cdot \sin t} \cdot \sqrt{ew \cdot \sin t}} \]
    3. sqrt-unprod26.2%

      \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \sin t\right) \cdot \left(ew \cdot \sin t\right)}} \]
    4. pow226.2%

      \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot \sin t\right)}^{2}}} \]
  11. Applied egg-rr26.2%

    \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot \sin t\right)}^{2}}} \]
  12. Step-by-step derivation
    1. unpow226.2%

      \[\leadsto \sqrt{\color{blue}{\left(ew \cdot \sin t\right) \cdot \left(ew \cdot \sin t\right)}} \]
    2. rem-sqrt-square43.1%

      \[\leadsto \color{blue}{\left|ew \cdot \sin t\right|} \]
  13. Simplified43.1%

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

Alternative 9: 29.4% accurate, 8.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0027 \lor \neg \left(t \leq 19000000000000\right):\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -0.0027) (not (<= t 19000000000000.0)))
   (* ew (sin t))
   (fabs (* ew t))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -0.0027) || !(t <= 19000000000000.0)) {
		tmp = ew * sin(t);
	} else {
		tmp = fabs((ew * t));
	}
	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) :: tmp
    if ((t <= (-0.0027d0)) .or. (.not. (t <= 19000000000000.0d0))) then
        tmp = ew * sin(t)
    else
        tmp = abs((ew * t))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -0.0027) || !(t <= 19000000000000.0)) {
		tmp = ew * Math.sin(t);
	} else {
		tmp = Math.abs((ew * t));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -0.0027) or not (t <= 19000000000000.0):
		tmp = ew * math.sin(t)
	else:
		tmp = math.fabs((ew * t))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -0.0027) || !(t <= 19000000000000.0))
		tmp = Float64(ew * sin(t));
	else
		tmp = abs(Float64(ew * t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -0.0027) || ~((t <= 19000000000000.0)))
		tmp = ew * sin(t);
	else
		tmp = abs((ew * t));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.0027], N[Not[LessEqual[t, 19000000000000.0]], $MachinePrecision]], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0027 \lor \neg \left(t \leq 19000000000000\right):\\
\;\;\;\;ew \cdot \sin t\\

\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0027000000000000001 or 1.9e13 < t

    1. Initial program 99.6%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*99.7%

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
      3. associate-/r*99.6%

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt99.1%

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

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

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

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

    if -0.0027000000000000001 < t < 1.9e13

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Step-by-step derivation
      1. associate-*l*100.0%

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
      3. associate-/r*100.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{ew \cdot t} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt11.4%

        \[\leadsto \color{blue}{\sqrt{ew \cdot t} \cdot \sqrt{ew \cdot t}} \]
      2. sqrt-unprod21.6%

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}} \]
      3. pow221.6%

        \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot t\right)}^{2}}} \]
    12. Applied egg-rr21.6%

      \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot t\right)}^{2}}} \]
    13. Step-by-step derivation
      1. unpow221.6%

        \[\leadsto \sqrt{\color{blue}{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}} \]
      2. rem-sqrt-square30.3%

        \[\leadsto \color{blue}{\left|ew \cdot t\right|} \]
    14. Simplified30.3%

      \[\leadsto \color{blue}{\left|ew \cdot t\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0027 \lor \neg \left(t \leq 19000000000000\right):\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 19.0% accurate, 8.9× speedup?

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

\\
\left|ew \cdot t\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. associate-/r*99.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{ew \cdot t} \]
  11. Step-by-step derivation
    1. add-sqr-sqrt7.4%

      \[\leadsto \color{blue}{\sqrt{ew \cdot t} \cdot \sqrt{ew \cdot t}} \]
    2. sqrt-unprod13.2%

      \[\leadsto \color{blue}{\sqrt{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}} \]
    3. pow213.2%

      \[\leadsto \sqrt{\color{blue}{{\left(ew \cdot t\right)}^{2}}} \]
  12. Applied egg-rr13.2%

    \[\leadsto \color{blue}{\sqrt{{\left(ew \cdot t\right)}^{2}}} \]
  13. Step-by-step derivation
    1. unpow213.2%

      \[\leadsto \sqrt{\color{blue}{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}} \]
    2. rem-sqrt-square17.7%

      \[\leadsto \color{blue}{\left|ew \cdot t\right|} \]
  14. Simplified17.7%

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

Alternative 11: 10.4% accurate, 306.3× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. associate-/r*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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