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

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\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. Final simplification0.1

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

Alternatives

Alternative 1
Error0.2
Cost52480
\[\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{\sin t}}\right| \]
Alternative 2
Error0.5
Cost52416
\[\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + \cos \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
Alternative 3
Error0.6
Cost46080
\[\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot t}\right)}{\sin t}}\right| \]
Alternative 4
Error0.9
Cost39232
\[\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + ew \cdot \sin t\right| \]
Alternative 5
Error11.0
Cost33096
\[\begin{array}{l} t_1 := ew \cdot \sin t\\ \mathbf{if}\;ew \leq -4.5 \cdot 10^{-117}:\\ \;\;\;\;\left|eh + \cos \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right) \cdot t_1\right|\\ \mathbf{elif}\;ew \leq 2.4 \cdot 10^{-199}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + ew \cdot t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \]
Alternative 6
Error11.1
Cost32968
\[\begin{array}{l} t_1 := ew \cdot \sin t\\ t_2 := \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\\ \mathbf{if}\;ew \leq -9.5 \cdot 10^{-117}:\\ \;\;\;\;\left|eh + \cos t_2 \cdot t_1\right|\\ \mathbf{elif}\;ew \leq 4.4 \cdot 10^{-199}:\\ \;\;\;\;\left|\frac{t}{\frac{\frac{eh}{ew \cdot ew}}{t}} + \left(eh \cdot \cos t\right) \cdot \sin t_2\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\ \end{array} \]
Alternative 7
Error1.1
Cost32832
\[\left|\cos \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right) \cdot \left(ew \cdot \sin t\right) + eh \cdot \cos t\right| \]
Alternative 8
Error1.1
Cost32832
\[\left|\cos \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right) \cdot \left(ew \cdot \sin t\right) - eh \cdot \cos t\right| \]
Alternative 9
Error13.4
Cost27081
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\\ \mathbf{if}\;ew \leq -2.3 \cdot 10^{-117} \lor \neg \left(ew \leq 3.75 \cdot 10^{-202}\right):\\ \;\;\;\;\left|eh + \cos t_1 \cdot \left(ew \cdot \sin t\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin t_1 + \left(ew \cdot ew\right) \cdot \frac{t \cdot t}{eh}\right|\\ \end{array} \]
Alternative 10
Error11.2
Cost27081
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\\ \mathbf{if}\;ew \leq -1.75 \cdot 10^{-116} \lor \neg \left(ew \leq 5.1 \cdot 10^{-199}\right):\\ \;\;\;\;\left|eh + \cos t_1 \cdot \left(ew \cdot \sin t\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{t}{\frac{\frac{eh}{ew \cdot ew}}{t}} + \left(eh \cdot \cos t\right) \cdot \sin t_1\right|\\ \end{array} \]
Alternative 11
Error13.7
Cost26304
\[\left|eh + \cos \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
Alternative 12
Error42.8
Cost20288
\[\left|\left(ew \cdot ew\right) \cdot \frac{t \cdot t}{eh} + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right| \]

Error

Reproduce

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