Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D

Percentage Accurate: 92.5% → 97.8%
Time: 10.0s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - x\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
def code(x, y, z, t):
	return x + ((y * (z - x)) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * (z - x)) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y \cdot \left(z - x\right)}{t}
\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 15 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: 92.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - x\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * (z - x)) / t);
}
def code(x, y, z, t):
	return x + ((y * (z - x)) / t)
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * (z - x)) / t);
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}

Alternative 1: 97.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+79}:\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.5e+79) (+ x (* y (/ (- z x) t))) (fma (/ y t) (- z x) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.5e+79) {
		tmp = x + (y * ((z - x) / t));
	} else {
		tmp = fma((y / t), (z - x), x);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.5e+79)
		tmp = Float64(x + Float64(y * Float64(Float64(z - x) / t)));
	else
		tmp = fma(Float64(y / t), Float64(z - x), x);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.5e+79], N[(x + N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+79}:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.49999999999999987e79

    1. Initial program 86.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. frac-2neg97.3%

        \[\leadsto x + \color{blue}{\frac{-y}{-\frac{t}{z - x}}} \]
      2. distribute-frac-neg97.3%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{-\frac{t}{z - x}}\right)} \]
      3. remove-double-neg97.3%

        \[\leadsto x + \left(-\color{blue}{\left(-\left(-\frac{y}{-\frac{t}{z - x}}\right)\right)}\right) \]
      4. distribute-frac-neg97.3%

        \[\leadsto x + \left(-\left(-\color{blue}{\frac{-y}{-\frac{t}{z - x}}}\right)\right) \]
      5. frac-2neg97.3%

        \[\leadsto x + \left(-\left(-\color{blue}{\frac{y}{\frac{t}{z - x}}}\right)\right) \]
      6. associate-/l*86.0%

        \[\leadsto x + \left(-\left(-\color{blue}{\frac{y \cdot \left(z - x\right)}{t}}\right)\right) \]
      7. unsub-neg86.0%

        \[\leadsto \color{blue}{x - \left(-\frac{y \cdot \left(z - x\right)}{t}\right)} \]
      8. associate-/l*97.3%

        \[\leadsto x - \left(-\color{blue}{\frac{y}{\frac{t}{z - x}}}\right) \]
      9. frac-2neg97.3%

        \[\leadsto x - \left(-\color{blue}{\frac{-y}{-\frac{t}{z - x}}}\right) \]
      10. distribute-frac-neg97.3%

        \[\leadsto x - \left(-\color{blue}{\left(-\frac{y}{-\frac{t}{z - x}}\right)}\right) \]
      11. remove-double-neg97.3%

        \[\leadsto x - \color{blue}{\frac{y}{-\frac{t}{z - x}}} \]
      12. div-inv97.3%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{-\frac{t}{z - x}}} \]
      13. distribute-neg-frac97.3%

        \[\leadsto x - y \cdot \frac{1}{\color{blue}{\frac{-t}{z - x}}} \]
      14. clear-num97.4%

        \[\leadsto x - y \cdot \color{blue}{\frac{z - x}{-t}} \]
      15. frac-2neg97.4%

        \[\leadsto x - y \cdot \color{blue}{\frac{-\left(z - x\right)}{-\left(-t\right)}} \]
      16. neg-sub097.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{0 - \left(z - x\right)}}{-\left(-t\right)} \]
      17. sub-neg97.4%

        \[\leadsto x - y \cdot \frac{0 - \color{blue}{\left(z + \left(-x\right)\right)}}{-\left(-t\right)} \]
      18. +-commutative97.4%

        \[\leadsto x - y \cdot \frac{0 - \color{blue}{\left(\left(-x\right) + z\right)}}{-\left(-t\right)} \]
      19. associate--r+97.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{\left(0 - \left(-x\right)\right) - z}}{-\left(-t\right)} \]
      20. neg-sub097.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{\left(-\left(-x\right)\right)} - z}{-\left(-t\right)} \]
      21. remove-double-neg97.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{x} - z}{-\left(-t\right)} \]
      22. remove-double-neg97.4%

        \[\leadsto x - y \cdot \frac{x - z}{\color{blue}{t}} \]
    5. Applied egg-rr97.4%

      \[\leadsto \color{blue}{x - y \cdot \frac{x - z}{t}} \]

    if -1.49999999999999987e79 < y

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative93.7%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t} + x} \]
      2. associate-*l/98.6%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} + x \]
      3. fma-def98.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)} \]
    3. Simplified98.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+79}:\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)\\ \end{array} \]

Alternative 2: 83.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.52 \cdot 10^{-86} \lor \neg \left(z \leq 1.6 \cdot 10^{+27}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{x}{-t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.52e-86) (not (<= z 1.6e+27)))
   (+ x (/ z (/ t y)))
   (+ x (* y (/ x (- t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.52e-86) || !(z <= 1.6e+27)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x + (y * (x / -t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.52d-86)) .or. (.not. (z <= 1.6d+27))) then
        tmp = x + (z / (t / y))
    else
        tmp = x + (y * (x / -t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.52e-86) || !(z <= 1.6e+27)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x + (y * (x / -t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.52e-86) or not (z <= 1.6e+27):
		tmp = x + (z / (t / y))
	else:
		tmp = x + (y * (x / -t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.52e-86) || !(z <= 1.6e+27))
		tmp = Float64(x + Float64(z / Float64(t / y)));
	else
		tmp = Float64(x + Float64(y * Float64(x / Float64(-t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.52e-86) || ~((z <= 1.6e+27)))
		tmp = x + (z / (t / y));
	else
		tmp = x + (y * (x / -t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.52e-86], N[Not[LessEqual[z, 1.6e+27]], $MachinePrecision]], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(x / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.52 \cdot 10^{-86} \lor \neg \left(z \leq 1.6 \cdot 10^{+27}\right):\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{x}{-t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.52e-86 or 1.60000000000000008e27 < z

    1. Initial program 89.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*93.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.3%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    6. Taylor expanded in z around inf 85.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-*r/86.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative86.0%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/90.9%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Simplified90.9%

      \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]

    if -1.52e-86 < z < 1.60000000000000008e27

    1. Initial program 94.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Taylor expanded in z around 0 85.3%

      \[\leadsto x + \frac{\color{blue}{-1 \cdot \left(x \cdot y\right)}}{t} \]
    3. Step-by-step derivation
      1. mul-1-neg85.3%

        \[\leadsto x + \frac{\color{blue}{-x \cdot y}}{t} \]
      2. *-commutative85.3%

        \[\leadsto x + \frac{-\color{blue}{y \cdot x}}{t} \]
      3. distribute-rgt-neg-out85.3%

        \[\leadsto x + \frac{\color{blue}{y \cdot \left(-x\right)}}{t} \]
    4. Simplified85.3%

      \[\leadsto x + \frac{\color{blue}{y \cdot \left(-x\right)}}{t} \]
    5. Step-by-step derivation
      1. div-inv85.3%

        \[\leadsto x + \color{blue}{\left(y \cdot \left(-x\right)\right) \cdot \frac{1}{t}} \]
      2. associate-*l*88.3%

        \[\leadsto x + \color{blue}{y \cdot \left(\left(-x\right) \cdot \frac{1}{t}\right)} \]
      3. *-commutative88.3%

        \[\leadsto x + \color{blue}{\left(\left(-x\right) \cdot \frac{1}{t}\right) \cdot y} \]
      4. div-inv88.3%

        \[\leadsto x + \color{blue}{\frac{-x}{t}} \cdot y \]
      5. frac-2neg88.3%

        \[\leadsto x + \color{blue}{\frac{-\left(-x\right)}{-t}} \cdot y \]
      6. remove-double-neg88.3%

        \[\leadsto x + \frac{\color{blue}{x}}{-t} \cdot y \]
    6. Applied egg-rr88.3%

      \[\leadsto x + \color{blue}{\frac{x}{-t} \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.52 \cdot 10^{-86} \lor \neg \left(z \leq 1.6 \cdot 10^{+27}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{x}{-t}\\ \end{array} \]

Alternative 3: 82.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-86} \lor \neg \left(z \leq 3.6 \cdot 10^{+28}\right):\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.55e-86) (not (<= z 3.6e+28)))
   (+ x (* y (/ z t)))
   (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.55e-86) || !(z <= 3.6e+28)) {
		tmp = x + (y * (z / t));
	} else {
		tmp = x * (1.0 - (y / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.55d-86)) .or. (.not. (z <= 3.6d+28))) then
        tmp = x + (y * (z / t))
    else
        tmp = x * (1.0d0 - (y / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.55e-86) || !(z <= 3.6e+28)) {
		tmp = x + (y * (z / t));
	} else {
		tmp = x * (1.0 - (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.55e-86) or not (z <= 3.6e+28):
		tmp = x + (y * (z / t))
	else:
		tmp = x * (1.0 - (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.55e-86) || !(z <= 3.6e+28))
		tmp = Float64(x + Float64(y * Float64(z / t)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.55e-86) || ~((z <= 3.6e+28)))
		tmp = x + (y * (z / t));
	else
		tmp = x * (1.0 - (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e-86], N[Not[LessEqual[z, 3.6e+28]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-86} \lor \neg \left(z \leq 3.6 \cdot 10^{+28}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.54999999999999994e-86 or 3.5999999999999999e28 < z

    1. Initial program 89.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*93.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in z around inf 85.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. *-commutative85.9%

        \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
      2. associate-*l/86.0%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. *-commutative86.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Simplified86.0%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]

    if -1.54999999999999994e-86 < z < 3.5999999999999999e28

    1. Initial program 94.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in86.1%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity86.1%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/86.1%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/86.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/85.3%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative85.3%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg85.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative85.3%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/86.1%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative86.1%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified86.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
    7. Taylor expanded in x around 0 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-86} \lor \neg \left(z \leq 3.6 \cdot 10^{+28}\right):\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \]

Alternative 4: 83.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-83} \lor \neg \left(z \leq 5.8 \cdot 10^{+29}\right):\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -2.4e-83) (not (<= z 5.8e+29)))
   (+ x (/ y (/ t z)))
   (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.4e-83) || !(z <= 5.8e+29)) {
		tmp = x + (y / (t / z));
	} else {
		tmp = x * (1.0 - (y / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-2.4d-83)) .or. (.not. (z <= 5.8d+29))) then
        tmp = x + (y / (t / z))
    else
        tmp = x * (1.0d0 - (y / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.4e-83) || !(z <= 5.8e+29)) {
		tmp = x + (y / (t / z));
	} else {
		tmp = x * (1.0 - (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -2.4e-83) or not (z <= 5.8e+29):
		tmp = x + (y / (t / z))
	else:
		tmp = x * (1.0 - (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -2.4e-83) || !(z <= 5.8e+29))
		tmp = Float64(x + Float64(y / Float64(t / z)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -2.4e-83) || ~((z <= 5.8e+29)))
		tmp = x + (y / (t / z));
	else
		tmp = x * (1.0 - (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.4e-83], N[Not[LessEqual[z, 5.8e+29]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-83} \lor \neg \left(z \leq 5.8 \cdot 10^{+29}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.4000000000000001e-83 or 5.7999999999999999e29 < z

    1. Initial program 89.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*93.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in z around inf 85.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*87.1%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Simplified87.1%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]

    if -2.4000000000000001e-83 < z < 5.7999999999999999e29

    1. Initial program 94.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in86.1%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity86.1%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/86.1%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/86.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/85.3%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative85.3%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg85.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative85.3%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/86.1%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative86.1%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified86.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
    7. Taylor expanded in x around 0 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-83} \lor \neg \left(z \leq 5.8 \cdot 10^{+29}\right):\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \]

Alternative 5: 85.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.26 \cdot 10^{-83} \lor \neg \left(z \leq 5.1 \cdot 10^{+28}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.26e-83) (not (<= z 5.1e+28)))
   (+ x (/ z (/ t y)))
   (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.26e-83) || !(z <= 5.1e+28)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x * (1.0 - (y / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.26d-83)) .or. (.not. (z <= 5.1d+28))) then
        tmp = x + (z / (t / y))
    else
        tmp = x * (1.0d0 - (y / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.26e-83) || !(z <= 5.1e+28)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x * (1.0 - (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.26e-83) or not (z <= 5.1e+28):
		tmp = x + (z / (t / y))
	else:
		tmp = x * (1.0 - (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.26e-83) || !(z <= 5.1e+28))
		tmp = Float64(x + Float64(z / Float64(t / y)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.26e-83) || ~((z <= 5.1e+28)))
		tmp = x + (z / (t / y));
	else
		tmp = x * (1.0 - (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.26e-83], N[Not[LessEqual[z, 5.1e+28]], $MachinePrecision]], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{-83} \lor \neg \left(z \leq 5.1 \cdot 10^{+28}\right):\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2600000000000001e-83 or 5.1000000000000004e28 < z

    1. Initial program 89.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*93.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.3%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    6. Taylor expanded in z around inf 85.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-*r/86.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative86.0%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/90.9%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Simplified90.9%

      \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]

    if -1.2600000000000001e-83 < z < 5.1000000000000004e28

    1. Initial program 94.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in86.1%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity86.1%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/86.1%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/86.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/85.3%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative85.3%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg85.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative85.3%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/86.1%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative86.1%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified86.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
    7. Taylor expanded in x around 0 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.26 \cdot 10^{-83} \lor \neg \left(z \leq 5.1 \cdot 10^{+28}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \]

Alternative 6: 85.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-85} \lor \neg \left(z \leq 1.3 \cdot 10^{+29}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1e-85) (not (<= z 1.3e+29)))
   (+ x (/ z (/ t y)))
   (- x (* x (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1e-85) || !(z <= 1.3e+29)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x - (x * (y / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1d-85)) .or. (.not. (z <= 1.3d+29))) then
        tmp = x + (z / (t / y))
    else
        tmp = x - (x * (y / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1e-85) || !(z <= 1.3e+29)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x - (x * (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1e-85) or not (z <= 1.3e+29):
		tmp = x + (z / (t / y))
	else:
		tmp = x - (x * (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1e-85) || !(z <= 1.3e+29))
		tmp = Float64(x + Float64(z / Float64(t / y)));
	else
		tmp = Float64(x - Float64(x * Float64(y / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1e-85) || ~((z <= 1.3e+29)))
		tmp = x + (z / (t / y));
	else
		tmp = x - (x * (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1e-85], N[Not[LessEqual[z, 1.3e+29]], $MachinePrecision]], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-85} \lor \neg \left(z \leq 1.3 \cdot 10^{+29}\right):\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.9999999999999998e-86 or 1.3e29 < z

    1. Initial program 89.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*93.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.3%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    6. Taylor expanded in z around inf 85.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-*r/86.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative86.0%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/90.9%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Simplified90.9%

      \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]

    if -9.9999999999999998e-86 < z < 1.3e29

    1. Initial program 94.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in86.1%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity86.1%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/86.1%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/86.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/85.3%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative85.3%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg85.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative85.3%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/86.1%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative86.1%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified86.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-85} \lor \neg \left(z \leq 1.3 \cdot 10^{+29}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{t}\\ \end{array} \]

Alternative 7: 85.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{-83} \lor \neg \left(z \leq 3.7 \cdot 10^{+27}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -2.45e-83) (not (<= z 3.7e+27)))
   (+ x (/ z (/ t y)))
   (- x (/ x (/ t y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.45e-83) || !(z <= 3.7e+27)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x - (x / (t / y));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-2.45d-83)) .or. (.not. (z <= 3.7d+27))) then
        tmp = x + (z / (t / y))
    else
        tmp = x - (x / (t / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.45e-83) || !(z <= 3.7e+27)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x - (x / (t / y));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -2.45e-83) or not (z <= 3.7e+27):
		tmp = x + (z / (t / y))
	else:
		tmp = x - (x / (t / y))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -2.45e-83) || !(z <= 3.7e+27))
		tmp = Float64(x + Float64(z / Float64(t / y)));
	else
		tmp = Float64(x - Float64(x / Float64(t / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -2.45e-83) || ~((z <= 3.7e+27)))
		tmp = x + (z / (t / y));
	else
		tmp = x - (x / (t / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.45e-83], N[Not[LessEqual[z, 3.7e+27]], $MachinePrecision]], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-83} \lor \neg \left(z \leq 3.7 \cdot 10^{+27}\right):\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{x}{\frac{t}{y}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.45e-83 or 3.70000000000000002e27 < z

    1. Initial program 89.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*93.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.3%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    6. Taylor expanded in z around inf 85.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-*r/86.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative86.0%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/90.9%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Simplified90.9%

      \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]

    if -2.45e-83 < z < 3.70000000000000002e27

    1. Initial program 94.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in86.1%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity86.1%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/86.1%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/86.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/85.3%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative85.3%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg85.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative85.3%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/86.1%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative86.1%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified86.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
    7. Step-by-step derivation
      1. clear-num86.1%

        \[\leadsto x - x \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv86.1%

        \[\leadsto x - \color{blue}{\frac{x}{\frac{t}{y}}} \]
    8. Applied egg-rr86.1%

      \[\leadsto x - \color{blue}{\frac{x}{\frac{t}{y}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{-83} \lor \neg \left(z \leq 3.7 \cdot 10^{+27}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{t}{y}}\\ \end{array} \]

Alternative 8: 84.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{-83} \lor \neg \left(z \leq 1.66 \cdot 10^{+27}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -2.45e-83) (not (<= z 1.66e+27)))
   (+ x (/ z (/ t y)))
   (- x (/ y (/ t x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.45e-83) || !(z <= 1.66e+27)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x - (y / (t / x));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-2.45d-83)) .or. (.not. (z <= 1.66d+27))) then
        tmp = x + (z / (t / y))
    else
        tmp = x - (y / (t / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.45e-83) || !(z <= 1.66e+27)) {
		tmp = x + (z / (t / y));
	} else {
		tmp = x - (y / (t / x));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -2.45e-83) or not (z <= 1.66e+27):
		tmp = x + (z / (t / y))
	else:
		tmp = x - (y / (t / x))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -2.45e-83) || !(z <= 1.66e+27))
		tmp = Float64(x + Float64(z / Float64(t / y)));
	else
		tmp = Float64(x - Float64(y / Float64(t / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -2.45e-83) || ~((z <= 1.66e+27)))
		tmp = x + (z / (t / y));
	else
		tmp = x - (y / (t / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.45e-83], N[Not[LessEqual[z, 1.66e+27]], $MachinePrecision]], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-83} \lor \neg \left(z \leq 1.66 \cdot 10^{+27}\right):\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.45e-83 or 1.65999999999999986e27 < z

    1. Initial program 89.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*93.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.3%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    5. Applied egg-rr99.3%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    6. Taylor expanded in z around inf 85.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-*r/86.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative86.0%

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/90.9%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Simplified90.9%

      \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]

    if -2.45e-83 < z < 1.65999999999999986e27

    1. Initial program 94.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 86.1%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/86.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in86.1%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity86.1%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/86.1%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/86.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out86.1%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/85.3%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative85.3%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg85.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative85.3%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/86.1%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative86.1%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified86.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
    7. Step-by-step derivation
      1. *-commutative86.1%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      2. associate-/r/88.3%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{x}}} \]
    8. Applied egg-rr88.3%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{-83} \lor \neg \left(z \leq 1.66 \cdot 10^{+27}\right):\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{x}}\\ \end{array} \]

Alternative 9: 97.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+79}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\ \mathbf{else}:\\ \;\;\;\;x - \left(x - z\right) \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -4e+79) (+ x (/ y (/ t (- z x)))) (- x (* (- x z) (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -4e+79) {
		tmp = x + (y / (t / (z - x)));
	} else {
		tmp = x - ((x - z) * (y / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-4d+79)) then
        tmp = x + (y / (t / (z - x)))
    else
        tmp = x - ((x - z) * (y / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -4e+79) {
		tmp = x + (y / (t / (z - x)));
	} else {
		tmp = x - ((x - z) * (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -4e+79:
		tmp = x + (y / (t / (z - x)))
	else:
		tmp = x - ((x - z) * (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -4e+79)
		tmp = Float64(x + Float64(y / Float64(t / Float64(z - x))));
	else
		tmp = Float64(x - Float64(Float64(x - z) * Float64(y / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -4e+79)
		tmp = x + (y / (t / (z - x)));
	else
		tmp = x - ((x - z) * (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -4e+79], N[(x + N[(y / N[(t / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(x - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+79}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\

\mathbf{else}:\\
\;\;\;\;x - \left(x - z\right) \cdot \frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.99999999999999987e79

    1. Initial program 86.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]

    if -3.99999999999999987e79 < y

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*95.0%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified95.0%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. associate-/r/98.6%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    5. Applied egg-rr98.6%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+79}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\ \mathbf{else}:\\ \;\;\;\;x - \left(x - z\right) \cdot \frac{y}{t}\\ \end{array} \]

Alternative 10: 97.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+79}:\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \left(x - z\right) \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.15e+79) (+ x (* y (/ (- z x) t))) (- x (* (- x z) (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.15e+79) {
		tmp = x + (y * ((z - x) / t));
	} else {
		tmp = x - ((x - z) * (y / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-1.15d+79)) then
        tmp = x + (y * ((z - x) / t))
    else
        tmp = x - ((x - z) * (y / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.15e+79) {
		tmp = x + (y * ((z - x) / t));
	} else {
		tmp = x - ((x - z) * (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.15e+79:
		tmp = x + (y * ((z - x) / t))
	else:
		tmp = x - ((x - z) * (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.15e+79)
		tmp = Float64(x + Float64(y * Float64(Float64(z - x) / t)));
	else
		tmp = Float64(x - Float64(Float64(x - z) * Float64(y / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.15e+79)
		tmp = x + (y * ((z - x) / t));
	else
		tmp = x - ((x - z) * (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e+79], N[(x + N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(x - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+79}:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\

\mathbf{else}:\\
\;\;\;\;x - \left(x - z\right) \cdot \frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.15e79

    1. Initial program 86.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. frac-2neg97.3%

        \[\leadsto x + \color{blue}{\frac{-y}{-\frac{t}{z - x}}} \]
      2. distribute-frac-neg97.3%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{-\frac{t}{z - x}}\right)} \]
      3. remove-double-neg97.3%

        \[\leadsto x + \left(-\color{blue}{\left(-\left(-\frac{y}{-\frac{t}{z - x}}\right)\right)}\right) \]
      4. distribute-frac-neg97.3%

        \[\leadsto x + \left(-\left(-\color{blue}{\frac{-y}{-\frac{t}{z - x}}}\right)\right) \]
      5. frac-2neg97.3%

        \[\leadsto x + \left(-\left(-\color{blue}{\frac{y}{\frac{t}{z - x}}}\right)\right) \]
      6. associate-/l*86.0%

        \[\leadsto x + \left(-\left(-\color{blue}{\frac{y \cdot \left(z - x\right)}{t}}\right)\right) \]
      7. unsub-neg86.0%

        \[\leadsto \color{blue}{x - \left(-\frac{y \cdot \left(z - x\right)}{t}\right)} \]
      8. associate-/l*97.3%

        \[\leadsto x - \left(-\color{blue}{\frac{y}{\frac{t}{z - x}}}\right) \]
      9. frac-2neg97.3%

        \[\leadsto x - \left(-\color{blue}{\frac{-y}{-\frac{t}{z - x}}}\right) \]
      10. distribute-frac-neg97.3%

        \[\leadsto x - \left(-\color{blue}{\left(-\frac{y}{-\frac{t}{z - x}}\right)}\right) \]
      11. remove-double-neg97.3%

        \[\leadsto x - \color{blue}{\frac{y}{-\frac{t}{z - x}}} \]
      12. div-inv97.3%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{-\frac{t}{z - x}}} \]
      13. distribute-neg-frac97.3%

        \[\leadsto x - y \cdot \frac{1}{\color{blue}{\frac{-t}{z - x}}} \]
      14. clear-num97.4%

        \[\leadsto x - y \cdot \color{blue}{\frac{z - x}{-t}} \]
      15. frac-2neg97.4%

        \[\leadsto x - y \cdot \color{blue}{\frac{-\left(z - x\right)}{-\left(-t\right)}} \]
      16. neg-sub097.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{0 - \left(z - x\right)}}{-\left(-t\right)} \]
      17. sub-neg97.4%

        \[\leadsto x - y \cdot \frac{0 - \color{blue}{\left(z + \left(-x\right)\right)}}{-\left(-t\right)} \]
      18. +-commutative97.4%

        \[\leadsto x - y \cdot \frac{0 - \color{blue}{\left(\left(-x\right) + z\right)}}{-\left(-t\right)} \]
      19. associate--r+97.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{\left(0 - \left(-x\right)\right) - z}}{-\left(-t\right)} \]
      20. neg-sub097.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{\left(-\left(-x\right)\right)} - z}{-\left(-t\right)} \]
      21. remove-double-neg97.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{x} - z}{-\left(-t\right)} \]
      22. remove-double-neg97.4%

        \[\leadsto x - y \cdot \frac{x - z}{\color{blue}{t}} \]
    5. Applied egg-rr97.4%

      \[\leadsto \color{blue}{x - y \cdot \frac{x - z}{t}} \]

    if -1.15e79 < y

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*95.0%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified95.0%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Step-by-step derivation
      1. associate-/r/98.6%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
    5. Applied egg-rr98.6%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+79}:\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \left(x - z\right) \cdot \frac{y}{t}\\ \end{array} \]

Alternative 11: 50.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.62 \cdot 10^{-108}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-22}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -1.62e-108) x (if (<= t 1.9e-22) (* x (/ y (- t))) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.62e-108) {
		tmp = x;
	} else if (t <= 1.9e-22) {
		tmp = x * (y / -t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1.62d-108)) then
        tmp = x
    else if (t <= 1.9d-22) then
        tmp = x * (y / -t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.62e-108) {
		tmp = x;
	} else if (t <= 1.9e-22) {
		tmp = x * (y / -t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -1.62e-108:
		tmp = x
	elif t <= 1.9e-22:
		tmp = x * (y / -t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1.62e-108)
		tmp = x;
	elseif (t <= 1.9e-22)
		tmp = Float64(x * Float64(y / Float64(-t)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -1.62e-108)
		tmp = x;
	elseif (t <= 1.9e-22)
		tmp = x * (y / -t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.62e-108], x, If[LessEqual[t, 1.9e-22], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.62 \cdot 10^{-108}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.9 \cdot 10^{-22}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.62e-108 or 1.90000000000000012e-22 < t

    1. Initial program 88.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.5%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.5%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in y around 0 56.0%

      \[\leadsto \color{blue}{x} \]

    if -1.62e-108 < t < 1.90000000000000012e-22

    1. Initial program 97.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*92.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified92.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 57.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/57.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/57.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in57.4%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity57.4%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/57.4%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/57.4%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg57.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in57.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out57.4%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out57.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/58.2%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative58.2%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg58.2%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative58.2%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/57.4%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative57.4%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified57.4%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
    7. Step-by-step derivation
      1. clear-num57.4%

        \[\leadsto x - x \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv57.4%

        \[\leadsto x - \color{blue}{\frac{x}{\frac{t}{y}}} \]
    8. Applied egg-rr57.4%

      \[\leadsto x - \color{blue}{\frac{x}{\frac{t}{y}}} \]
    9. Taylor expanded in t around 0 53.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    10. Step-by-step derivation
      1. associate-*r/52.0%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{y}{t}\right)} \]
      2. neg-mul-152.0%

        \[\leadsto \color{blue}{-x \cdot \frac{y}{t}} \]
      3. distribute-rgt-neg-in52.0%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      4. mul-1-neg52.0%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      5. metadata-eval52.0%

        \[\leadsto x \cdot \left(\color{blue}{\frac{1}{-1}} \cdot \frac{y}{t}\right) \]
      6. times-frac52.0%

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot y}{-1 \cdot t}} \]
      7. *-lft-identity52.0%

        \[\leadsto x \cdot \frac{\color{blue}{y}}{-1 \cdot t} \]
      8. neg-mul-152.0%

        \[\leadsto x \cdot \frac{y}{\color{blue}{-t}} \]
    11. Simplified52.0%

      \[\leadsto \color{blue}{x \cdot \frac{y}{-t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.62 \cdot 10^{-108}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-22}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 49.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-108}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-23}:\\ \;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -3.3e-108) x (if (<= t 3.5e-23) (* (- y) (/ x t)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -3.3e-108) {
		tmp = x;
	} else if (t <= 3.5e-23) {
		tmp = -y * (x / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-3.3d-108)) then
        tmp = x
    else if (t <= 3.5d-23) then
        tmp = -y * (x / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -3.3e-108) {
		tmp = x;
	} else if (t <= 3.5e-23) {
		tmp = -y * (x / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -3.3e-108:
		tmp = x
	elif t <= 3.5e-23:
		tmp = -y * (x / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -3.3e-108)
		tmp = x;
	elseif (t <= 3.5e-23)
		tmp = Float64(Float64(-y) * Float64(x / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -3.3e-108)
		tmp = x;
	elseif (t <= 3.5e-23)
		tmp = -y * (x / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.3e-108], x, If[LessEqual[t, 3.5e-23], N[((-y) * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{-108}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-23}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.3000000000000002e-108 or 3.49999999999999993e-23 < t

    1. Initial program 88.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*97.5%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified97.5%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in y around 0 56.0%

      \[\leadsto \color{blue}{x} \]

    if -3.3000000000000002e-108 < t < 3.49999999999999993e-23

    1. Initial program 97.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. associate-/l*92.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
    3. Simplified92.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
    4. Taylor expanded in x around inf 57.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/57.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
      2. associate-*l/57.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
      3. distribute-rgt-in57.4%

        \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
      4. *-lft-identity57.4%

        \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
      5. associate-*l/57.4%

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
      6. associate-*r/57.4%

        \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
      7. mul-1-neg57.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
      8. distribute-lft-neg-in57.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      9. distribute-rgt-neg-out57.4%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
      10. distribute-rgt-neg-out57.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
      11. associate-*l/58.2%

        \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
      12. *-commutative58.2%

        \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
      13. unsub-neg58.2%

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
      14. *-commutative58.2%

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
      15. associate-*l/57.4%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
      16. *-commutative57.4%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
    6. Simplified57.4%

      \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
    7. Taylor expanded in y around inf 53.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    8. Step-by-step derivation
      1. associate-/l*52.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\frac{t}{y}}} \]
      2. associate-*r/52.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{\frac{t}{y}}} \]
      3. neg-mul-152.0%

        \[\leadsto \frac{\color{blue}{-x}}{\frac{t}{y}} \]
      4. associate-/r/53.5%

        \[\leadsto \color{blue}{\frac{-x}{t} \cdot y} \]
      5. *-commutative53.5%

        \[\leadsto \color{blue}{y \cdot \frac{-x}{t}} \]
    9. Simplified53.5%

      \[\leadsto \color{blue}{y \cdot \frac{-x}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-108}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-23}:\\ \;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 97.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \left(x - z\right) \cdot \frac{y}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (* (- x z) (/ y t))))
double code(double x, double y, double z, double t) {
	return x - ((x - z) * (y / t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - ((x - z) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
	return x - ((x - z) * (y / t));
}
def code(x, y, z, t):
	return x - ((x - z) * (y / t))
function code(x, y, z, t)
	return Float64(x - Float64(Float64(x - z) * Float64(y / t)))
end
function tmp = code(x, y, z, t)
	tmp = x - ((x - z) * (y / t));
end
code[x_, y_, z_, t_] := N[(x - N[(N[(x - z), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \left(x - z\right) \cdot \frac{y}{t}
\end{array}
Derivation
  1. Initial program 92.0%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Step-by-step derivation
    1. associate-/l*95.5%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
  3. Simplified95.5%

    \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
  4. Step-by-step derivation
    1. associate-/r/96.3%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
  5. Applied egg-rr96.3%

    \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)} \]
  6. Final simplification96.3%

    \[\leadsto x - \left(x - z\right) \cdot \frac{y}{t} \]

Alternative 14: 65.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ x \cdot \left(1 - \frac{y}{t}\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* x (- 1.0 (/ y t))))
double code(double x, double y, double z, double t) {
	return x * (1.0 - (y / t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x * (1.0d0 - (y / t))
end function
public static double code(double x, double y, double z, double t) {
	return x * (1.0 - (y / t));
}
def code(x, y, z, t):
	return x * (1.0 - (y / t))
function code(x, y, z, t)
	return Float64(x * Float64(1.0 - Float64(y / t)))
end
function tmp = code(x, y, z, t)
	tmp = x * (1.0 - (y / t));
end
code[x_, y_, z_, t_] := N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(1 - \frac{y}{t}\right)
\end{array}
Derivation
  1. Initial program 92.0%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Step-by-step derivation
    1. associate-/l*95.5%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
  3. Simplified95.5%

    \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
  4. Taylor expanded in x around inf 65.3%

    \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
  5. Step-by-step derivation
    1. associate-*r/65.3%

      \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1 \cdot y}{t}}\right) \]
    2. associate-*l/65.3%

      \[\leadsto x \cdot \left(1 + \color{blue}{\frac{-1}{t} \cdot y}\right) \]
    3. distribute-rgt-in65.3%

      \[\leadsto \color{blue}{1 \cdot x + \left(\frac{-1}{t} \cdot y\right) \cdot x} \]
    4. *-lft-identity65.3%

      \[\leadsto \color{blue}{x} + \left(\frac{-1}{t} \cdot y\right) \cdot x \]
    5. associate-*l/65.3%

      \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{t}} \cdot x \]
    6. associate-*r/65.3%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \cdot x \]
    7. mul-1-neg65.3%

      \[\leadsto x + \color{blue}{\left(-\frac{y}{t}\right)} \cdot x \]
    8. distribute-lft-neg-in65.3%

      \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
    9. distribute-rgt-neg-out65.3%

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(-x\right)} \]
    10. distribute-rgt-neg-out65.3%

      \[\leadsto x + \color{blue}{\left(-\frac{y}{t} \cdot x\right)} \]
    11. associate-*l/61.5%

      \[\leadsto x + \left(-\color{blue}{\frac{y \cdot x}{t}}\right) \]
    12. *-commutative61.5%

      \[\leadsto x + \left(-\frac{\color{blue}{x \cdot y}}{t}\right) \]
    13. unsub-neg61.5%

      \[\leadsto \color{blue}{x - \frac{x \cdot y}{t}} \]
    14. *-commutative61.5%

      \[\leadsto x - \frac{\color{blue}{y \cdot x}}{t} \]
    15. associate-*l/65.3%

      \[\leadsto x - \color{blue}{\frac{y}{t} \cdot x} \]
    16. *-commutative65.3%

      \[\leadsto x - \color{blue}{x \cdot \frac{y}{t}} \]
  6. Simplified65.3%

    \[\leadsto \color{blue}{x - x \cdot \frac{y}{t}} \]
  7. Taylor expanded in x around 0 65.3%

    \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
  8. Final simplification65.3%

    \[\leadsto x \cdot \left(1 - \frac{y}{t}\right) \]

Alternative 15: 38.3% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 92.0%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Step-by-step derivation
    1. associate-/l*95.5%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
  3. Simplified95.5%

    \[\leadsto \color{blue}{x + \frac{y}{\frac{t}{z - x}}} \]
  4. Taylor expanded in y around 0 35.1%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification35.1%

    \[\leadsto x \]

Developer target: 89.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
	return x - ((x * (y / t)) + (-z * (y / t)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
	return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t):
	return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t)
	return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t))))
end
function tmp = code(x, y, z, t)
	tmp = x - ((x * (y / t)) + (-z * (y / t)));
end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}

Reproduce

?
herbie shell --seed 2023297 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

  :herbie-target
  (- x (+ (* x (/ y t)) (* (- z) (/ y t))))

  (+ x (/ (* y (- z x)) t)))