?

Average Error: 0.1 → 0.1
Time: 16.9s
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|\sin t \cdot \left(ew \cdot \cos t_1\right) + eh \cdot \left(\cos t \cdot \sin t_1\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 (+ (* (sin t) (* ew (cos t_1))) (* eh (* (cos t) (sin t_1)))))))
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(((sin(t) * (ew * 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
    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(((sin(t) * (ew * cos(t_1))) + (eh * (cos(t) * sin(t_1)))))
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.sin(t) * (ew * Math.cos(t_1))) + (eh * (Math.cos(t) * Math.sin(t_1)))));
}
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.sin(t) * (ew * math.cos(t_1))) + (eh * (math.cos(t) * math.sin(t_1)))))
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(sin(t) * Float64(ew * cos(t_1))) + Float64(eh * Float64(cos(t) * sin(t_1)))))
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(((sin(t) * (ew * cos(t_1))) + (eh * (cos(t) * sin(t_1)))));
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[Sin[t], $MachinePrecision] * N[(ew * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $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|\sin t \cdot \left(ew \cdot \cos t_1\right) + eh \cdot \left(\cos t \cdot \sin t_1\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. Simplified0.1

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

    [Start]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| \]

    rational_best-simplify-2 [=>]0.1

    \[ \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| \]

    rational_best-simplify-2 [=>]0.1

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

    rational_best-simplify-44 [=>]0.1

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

    rational_best-simplify-2 [=>]0.1

    \[ \left|\sin t \cdot \color{blue}{\left(ew \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| \]

    rational_best-simplify-2 [=>]0.1

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

    rational_best-simplify-44 [=>]0.1

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

    rational_best-simplify-2 [=>]0.1

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

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

Alternatives

Alternative 1
Error0.6
Cost52416
\[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
Alternative 2
Error10.8
Cost46416
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\\ t_2 := \cos t_1\\ t_3 := \left|t_2 \cdot \left(t \cdot ew\right) + \left(eh \cdot \cos t\right) \cdot \sin t_1\right|\\ t_4 := \left|\left(ew \cdot \sin t\right) \cdot t_2 + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \mathbf{if}\;eh \leq -1.05 \cdot 10^{+67}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;eh \leq 1.02 \cdot 10^{-51}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;eh \leq 3.3:\\ \;\;\;\;t_3\\ \mathbf{elif}\;eh \leq 1.06 \cdot 10^{+167}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 3
Error1.3
Cost46408
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\\ t_2 := \cos t_1\\ t_3 := \left|\left(ew \cdot \sin t\right) \cdot t_2 + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{t \cdot eh}{ew}\right)\right|\\ \mathbf{if}\;t \leq -1.5 \cdot 10^{-8}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-90}:\\ \;\;\;\;\left|t_2 \cdot \left(t \cdot ew\right) + \sin t_1 \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error6.3
Cost46016
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{t \cdot ew}\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} \]
Alternative 5
Error11.0
Cost40264
\[\begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ t_2 := \tan^{-1} t_1\\ t_3 := \sin t_2\\ t_4 := \cos t_2\\ t_5 := \left|t_4 \cdot \left(t \cdot ew\right) + \left(eh \cdot \cos t\right) \cdot t_3\right|\\ t_6 := \left(ew \cdot \sin t\right) \cdot t_4\\ \mathbf{if}\;eh \leq -1.25 \cdot 10^{+67}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;eh \leq 1.02 \cdot 10^{-51}:\\ \;\;\;\;\left|t_6 + eh \cdot \sin \tan^{-1} \left(t_1 + -0.3333333333333333 \cdot \frac{eh \cdot t}{ew}\right)\right|\\ \mathbf{elif}\;eh \leq 4.5:\\ \;\;\;\;t_5\\ \mathbf{elif}\;eh \leq 1.06 \cdot 10^{+167}:\\ \;\;\;\;\left|t_6 + t_3 \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;t_5\\ \end{array} \]
Alternative 6
Error11.3
Cost40144
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\\ t_2 := \sin t_1\\ t_3 := \cos t_1\\ t_4 := \left|t_3 \cdot \left(t \cdot ew\right) + \left(eh \cdot \cos t\right) \cdot t_2\right|\\ t_5 := \left|\left(ew \cdot \sin t\right) \cdot t_3 + t_2 \cdot eh\right|\\ \mathbf{if}\;eh \leq -6.1 \cdot 10^{+66}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;eh \leq 9.6 \cdot 10^{-53}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;eh \leq 3.4:\\ \;\;\;\;t_4\\ \mathbf{elif}\;eh \leq 7.5 \cdot 10^{+165}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 7
Error13.4
Cost39488
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t_1 + \sin t_1 \cdot eh\right| \end{array} \]
Alternative 8
Error29.5
Cost33088
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\\ \left|\cos t_1 \cdot \left(t \cdot ew\right) + \sin t_1 \cdot eh\right| \end{array} \]

Error

Reproduce?

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