Average Error: 8.3 → 1.6
Time: 1.7s
Precision: binary64
\[\frac{\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t}{k}\]
\[\begin{array}{l} \mathbf{if}\;\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le -3.36994431608202736 \cdot 10^{223} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le -5.7715338565787761 \cdot 10^{-258} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le 3.6318661836753736 \cdot 10^{-276} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le 1.2847778419113857 \cdot 10^{90}\right)\right)\right):\\ \;\;\;\;\frac{t}{\frac{k}{\left(0.5 \cdot x\right) \cdot t + y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t}{k}\\ \end{array}\]
\frac{\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t}{k}
\begin{array}{l}
\mathbf{if}\;\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le -3.36994431608202736 \cdot 10^{223} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le -5.7715338565787761 \cdot 10^{-258} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le 3.6318661836753736 \cdot 10^{-276} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le 1.2847778419113857 \cdot 10^{90}\right)\right)\right):\\
\;\;\;\;\frac{t}{\frac{k}{\left(0.5 \cdot x\right) \cdot t + y}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t}{k}\\

\end{array}
double code(double x, double t, double y, double k) {
	return ((double) (((double) (((double) (((double) (((double) (0.5 * x)) * t)) * t)) + ((double) (y * t)))) / k));
}
double code(double x, double t, double y, double k) {
	double VAR;
	if (((((double) (((double) (((double) (((double) (0.5 * x)) * t)) * t)) + ((double) (y * t)))) <= -3.3699443160820274e+223) || !((((double) (((double) (((double) (((double) (0.5 * x)) * t)) * t)) + ((double) (y * t)))) <= -5.771533856578776e-258) || !((((double) (((double) (((double) (((double) (0.5 * x)) * t)) * t)) + ((double) (y * t)))) <= 3.6318661836753736e-276) || !(((double) (((double) (((double) (((double) (0.5 * x)) * t)) * t)) + ((double) (y * t)))) <= 1.2847778419113857e+90))))) {
		VAR = ((double) (t / ((double) (k / ((double) (((double) (((double) (0.5 * x)) * t)) + y))))));
	} else {
		VAR = ((double) (((double) (((double) (((double) (((double) (0.5 * x)) * t)) * t)) + ((double) (y * t)))) / k));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus t

Bits error versus y

Bits error versus k

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (+ (* (* (* 0.5 x) t) t) (* y t)) < -3.36994431608202736e223 or -5.7715338565787761e-258 < (+ (* (* (* 0.5 x) t) t) (* y t)) < 3.6318661836753736e-276 or 1.2847778419113857e90 < (+ (* (* (* 0.5 x) t) t) (* y t))

    1. Initial program 20.1

      \[\frac{\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t}{k}\]
    2. Simplified3.5

      \[\leadsto \color{blue}{\frac{t}{\frac{k}{\left(0.5 \cdot x\right) \cdot t + y}}}\]

    if -3.36994431608202736e223 < (+ (* (* (* 0.5 x) t) t) (* y t)) < -5.7715338565787761e-258 or 3.6318661836753736e-276 < (+ (* (* (* 0.5 x) t) t) (* y t)) < 1.2847778419113857e90

    1. Initial program 0.3

      \[\frac{\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t}{k}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le -3.36994431608202736 \cdot 10^{223} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le -5.7715338565787761 \cdot 10^{-258} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le 3.6318661836753736 \cdot 10^{-276} \lor \neg \left(\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t \le 1.2847778419113857 \cdot 10^{90}\right)\right)\right):\\ \;\;\;\;\frac{t}{\frac{k}{\left(0.5 \cdot x\right) \cdot t + y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(0.5 \cdot x\right) \cdot t\right) \cdot t + y \cdot t}{k}\\ \end{array}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x t y k)
  :name "(/ (+ (* (* (* 0.5 x) t) t) (* y t)) k)"
  :precision binary64
  (/ (+ (* (* (* 0.5 x) t) t) (* y t)) k))