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

Percentage Accurate: 92.8% → 98.0%
Time: 8.1s
Alternatives: 10
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 10 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.8% 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: 98.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\frac{y}{t}, z - x, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (/ y t) (- z x) x))
double code(double x, double y, double z, double t) {
	return fma((y / t), (z - x), x);
}
function code(x, y, z, t)
	return fma(Float64(y / t), Float64(z - x), x)
end
code[x_, y_, z_, t_] := N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)
\end{array}
Derivation
  1. Initial program 92.7%

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)} \]
  4. Final simplification98.1%

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

Alternative 2: 50.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -3.15 \cdot 10^{-52}:\\ \;\;\;\;y \cdot \frac{-x}{t}\\ \mathbf{elif}\;t \leq -4 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-47}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -5.2e+61)
   x
   (if (<= t -3.15e-52)
     (* y (/ (- x) t))
     (if (<= t -4e-107) x (if (<= t 1.35e-47) (* (/ y t) (- x)) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.2e+61) {
		tmp = x;
	} else if (t <= -3.15e-52) {
		tmp = y * (-x / t);
	} else if (t <= -4e-107) {
		tmp = x;
	} else if (t <= 1.35e-47) {
		tmp = (y / t) * -x;
	} 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 <= (-5.2d+61)) then
        tmp = x
    else if (t <= (-3.15d-52)) then
        tmp = y * (-x / t)
    else if (t <= (-4d-107)) then
        tmp = x
    else if (t <= 1.35d-47) then
        tmp = (y / t) * -x
    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 <= -5.2e+61) {
		tmp = x;
	} else if (t <= -3.15e-52) {
		tmp = y * (-x / t);
	} else if (t <= -4e-107) {
		tmp = x;
	} else if (t <= 1.35e-47) {
		tmp = (y / t) * -x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -5.2e+61:
		tmp = x
	elif t <= -3.15e-52:
		tmp = y * (-x / t)
	elif t <= -4e-107:
		tmp = x
	elif t <= 1.35e-47:
		tmp = (y / t) * -x
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.2e+61)
		tmp = x;
	elseif (t <= -3.15e-52)
		tmp = Float64(y * Float64(Float64(-x) / t));
	elseif (t <= -4e-107)
		tmp = x;
	elseif (t <= 1.35e-47)
		tmp = Float64(Float64(y / t) * Float64(-x));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -5.2e+61)
		tmp = x;
	elseif (t <= -3.15e-52)
		tmp = y * (-x / t);
	elseif (t <= -4e-107)
		tmp = x;
	elseif (t <= 1.35e-47)
		tmp = (y / t) * -x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e+61], x, If[LessEqual[t, -3.15e-52], N[(y * N[((-x) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4e-107], x, If[LessEqual[t, 1.35e-47], N[(N[(y / t), $MachinePrecision] * (-x)), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+61}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq -4 \cdot 10^{-107}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.19999999999999945e61 or -3.1500000000000002e-52 < t < -4e-107 or 1.3499999999999999e-47 < t

    1. Initial program 87.4%

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

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

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

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

    if -5.19999999999999945e61 < t < -3.1500000000000002e-52

    1. Initial program 99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
    7. Taylor expanded in y around inf 28.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{t}\right)} \]
      2. distribute-frac-neg28.7%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y \cdot x}}{t} \]
      4. distribute-rgt-neg-out32.4%

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

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

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

    if -4e-107 < t < 1.3499999999999999e-47

    1. Initial program 98.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
    7. Taylor expanded in y around inf 48.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{t}\right)} \]
      2. distribute-frac-neg48.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -3.15 \cdot 10^{-52}:\\ \;\;\;\;y \cdot \frac{-x}{t}\\ \mathbf{elif}\;t \leq -4 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-47}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 50.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -2.85 \cdot 10^{-52}:\\ \;\;\;\;y \cdot \frac{-x}{t}\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-48}:\\ \;\;\;\;\frac{x}{\frac{-t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -7.5e+62)
   x
   (if (<= t -2.85e-52)
     (* y (/ (- x) t))
     (if (<= t -3.5e-107) x (if (<= t 2.4e-48) (/ x (/ (- t) y)) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -7.5e+62) {
		tmp = x;
	} else if (t <= -2.85e-52) {
		tmp = y * (-x / t);
	} else if (t <= -3.5e-107) {
		tmp = x;
	} else if (t <= 2.4e-48) {
		tmp = x / (-t / y);
	} 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 <= (-7.5d+62)) then
        tmp = x
    else if (t <= (-2.85d-52)) then
        tmp = y * (-x / t)
    else if (t <= (-3.5d-107)) then
        tmp = x
    else if (t <= 2.4d-48) then
        tmp = x / (-t / y)
    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 <= -7.5e+62) {
		tmp = x;
	} else if (t <= -2.85e-52) {
		tmp = y * (-x / t);
	} else if (t <= -3.5e-107) {
		tmp = x;
	} else if (t <= 2.4e-48) {
		tmp = x / (-t / y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -7.5e+62:
		tmp = x
	elif t <= -2.85e-52:
		tmp = y * (-x / t)
	elif t <= -3.5e-107:
		tmp = x
	elif t <= 2.4e-48:
		tmp = x / (-t / y)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -7.5e+62)
		tmp = x;
	elseif (t <= -2.85e-52)
		tmp = Float64(y * Float64(Float64(-x) / t));
	elseif (t <= -3.5e-107)
		tmp = x;
	elseif (t <= 2.4e-48)
		tmp = Float64(x / Float64(Float64(-t) / y));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -7.5e+62)
		tmp = x;
	elseif (t <= -2.85e-52)
		tmp = y * (-x / t);
	elseif (t <= -3.5e-107)
		tmp = x;
	elseif (t <= 2.4e-48)
		tmp = x / (-t / y);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.5e+62], x, If[LessEqual[t, -2.85e-52], N[(y * N[((-x) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.5e-107], x, If[LessEqual[t, 2.4e-48], N[(x / N[((-t) / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+62}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq -3.5 \cdot 10^{-107}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.49999999999999998e62 or -2.8499999999999999e-52 < t < -3.49999999999999985e-107 or 2.4e-48 < t

    1. Initial program 87.4%

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

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

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

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

    if -7.49999999999999998e62 < t < -2.8499999999999999e-52

    1. Initial program 99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
    7. Taylor expanded in y around inf 28.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{t}\right)} \]
      2. distribute-frac-neg28.7%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y \cdot x}}{t} \]
      4. distribute-rgt-neg-out32.4%

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

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

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

    if -3.49999999999999985e-107 < t < 2.4e-48

    1. Initial program 98.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
    7. Taylor expanded in y around inf 48.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{t}\right)} \]
      2. distribute-frac-neg48.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot y\right)}{t}} \]
      2. *-commutative42.7%

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

        \[\leadsto \frac{\color{blue}{-y \cdot x}}{t} \]
      4. distribute-rgt-neg-out42.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{t} \cdot y} \]
      2. distribute-frac-neg38.3%

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{t}{y}}} \]
      5. frac-2neg48.8%

        \[\leadsto -\color{blue}{\frac{-x}{-\frac{t}{y}}} \]
      6. distribute-neg-frac48.8%

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\frac{t}{y}}} \]
      7. remove-double-neg48.8%

        \[\leadsto \frac{\color{blue}{x}}{-\frac{t}{y}} \]
      8. distribute-neg-frac48.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -2.85 \cdot 10^{-52}:\\ \;\;\;\;y \cdot \frac{-x}{t}\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-48}:\\ \;\;\;\;\frac{x}{\frac{-t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 50.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.9 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -2.8 \cdot 10^{-52}:\\ \;\;\;\;\frac{y \cdot x}{-t}\\ \mathbf{elif}\;t \leq -1.2 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{\frac{-t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -4.9e+61)
   x
   (if (<= t -2.8e-52)
     (/ (* y x) (- t))
     (if (<= t -1.2e-107) x (if (<= t 2.1e-46) (/ x (/ (- t) y)) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4.9e+61) {
		tmp = x;
	} else if (t <= -2.8e-52) {
		tmp = (y * x) / -t;
	} else if (t <= -1.2e-107) {
		tmp = x;
	} else if (t <= 2.1e-46) {
		tmp = x / (-t / y);
	} 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 <= (-4.9d+61)) then
        tmp = x
    else if (t <= (-2.8d-52)) then
        tmp = (y * x) / -t
    else if (t <= (-1.2d-107)) then
        tmp = x
    else if (t <= 2.1d-46) then
        tmp = x / (-t / y)
    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 <= -4.9e+61) {
		tmp = x;
	} else if (t <= -2.8e-52) {
		tmp = (y * x) / -t;
	} else if (t <= -1.2e-107) {
		tmp = x;
	} else if (t <= 2.1e-46) {
		tmp = x / (-t / y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -4.9e+61:
		tmp = x
	elif t <= -2.8e-52:
		tmp = (y * x) / -t
	elif t <= -1.2e-107:
		tmp = x
	elif t <= 2.1e-46:
		tmp = x / (-t / y)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -4.9e+61)
		tmp = x;
	elseif (t <= -2.8e-52)
		tmp = Float64(Float64(y * x) / Float64(-t));
	elseif (t <= -1.2e-107)
		tmp = x;
	elseif (t <= 2.1e-46)
		tmp = Float64(x / Float64(Float64(-t) / y));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -4.9e+61)
		tmp = x;
	elseif (t <= -2.8e-52)
		tmp = (y * x) / -t;
	elseif (t <= -1.2e-107)
		tmp = x;
	elseif (t <= 2.1e-46)
		tmp = x / (-t / y);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.9e+61], x, If[LessEqual[t, -2.8e-52], N[(N[(y * x), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[t, -1.2e-107], x, If[LessEqual[t, 2.1e-46], N[(x / N[((-t) / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+61}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq -1.2 \cdot 10^{-107}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.90000000000000025e61 or -2.79999999999999995e-52 < t < -1.19999999999999997e-107 or 2.09999999999999987e-46 < t

    1. Initial program 87.4%

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

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

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

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

    if -4.90000000000000025e61 < t < -2.79999999999999995e-52

    1. Initial program 99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
    7. Taylor expanded in y around inf 28.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{t}\right)} \]
      2. distribute-frac-neg28.7%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-\left(-y\right)}{-t}} \]
      2. remove-double-neg28.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{-t} \]
    11. Applied egg-rr32.4%

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

    if -1.19999999999999997e-107 < t < 2.09999999999999987e-46

    1. Initial program 98.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
    7. Taylor expanded in y around inf 48.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{t}\right)} \]
      2. distribute-frac-neg48.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot y\right)}{t}} \]
      2. *-commutative42.7%

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

        \[\leadsto \frac{\color{blue}{-y \cdot x}}{t} \]
      4. distribute-rgt-neg-out42.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{t} \cdot y} \]
      2. distribute-frac-neg38.3%

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{t}{y}}} \]
      5. frac-2neg48.8%

        \[\leadsto -\color{blue}{\frac{-x}{-\frac{t}{y}}} \]
      6. distribute-neg-frac48.8%

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\frac{t}{y}}} \]
      7. remove-double-neg48.8%

        \[\leadsto \frac{\color{blue}{x}}{-\frac{t}{y}} \]
      8. distribute-neg-frac48.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.9 \cdot 10^{+61}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -2.8 \cdot 10^{-52}:\\ \;\;\;\;\frac{y \cdot x}{-t}\\ \mathbf{elif}\;t \leq -1.2 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{\frac{-t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 84.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-77} \lor \neg \left(x \leq 5.4 \cdot 10^{+78}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.8999999999999999e-77 or 5.40000000000000009e78 < x

    1. Initial program 91.4%

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

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

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

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

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

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

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

    if -2.8999999999999999e-77 < x < 5.40000000000000009e78

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

Alternative 6: 84.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.05 \cdot 10^{-75}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+78}:\\ \;\;\;\;x + \frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -3.05e-75)
   (* x (- 1.0 (/ y t)))
   (if (<= x 5.5e+78) (+ x (* (/ y t) z)) (- x (/ x (/ t y))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -3.05e-75) {
		tmp = x * (1.0 - (y / t));
	} else if (x <= 5.5e+78) {
		tmp = x + ((y / t) * z);
	} 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 (x <= (-3.05d-75)) then
        tmp = x * (1.0d0 - (y / t))
    else if (x <= 5.5d+78) then
        tmp = x + ((y / t) * z)
    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 (x <= -3.05e-75) {
		tmp = x * (1.0 - (y / t));
	} else if (x <= 5.5e+78) {
		tmp = x + ((y / t) * z);
	} else {
		tmp = x - (x / (t / y));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -3.05e-75:
		tmp = x * (1.0 - (y / t))
	elif x <= 5.5e+78:
		tmp = x + ((y / t) * z)
	else:
		tmp = x - (x / (t / y))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -3.05e-75)
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	elseif (x <= 5.5e+78)
		tmp = Float64(x + Float64(Float64(y / t) * z));
	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 (x <= -3.05e-75)
		tmp = x * (1.0 - (y / t));
	elseif (x <= 5.5e+78)
		tmp = x + ((y / t) * z);
	else
		tmp = x - (x / (t / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.05e-75], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e+78], N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.05 \cdot 10^{-75}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+78}:\\
\;\;\;\;x + \frac{y}{t} \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.05000000000000021e-75

    1. Initial program 92.7%

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

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

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

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

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

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

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

    if -3.05000000000000021e-75 < x < 5.4999999999999997e78

    1. Initial program 93.9%

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

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

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

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

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

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

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

    if 5.4999999999999997e78 < x

    1. Initial program 89.2%

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

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

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    5. Step-by-step derivation
      1. mul-1-neg83.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.05 \cdot 10^{-75}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+78}:\\ \;\;\;\;x + \frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{t}{y}}\\ \end{array} \]

Alternative 7: 51.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -4.2e-107) x (if (<= t 3.2e-46) (* (/ y t) (- x)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4.2e-107) {
		tmp = x;
	} else if (t <= 3.2e-46) {
		tmp = (y / t) * -x;
	} 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 <= (-4.2d-107)) then
        tmp = x
    else if (t <= 3.2d-46) then
        tmp = (y / t) * -x
    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 <= -4.2e-107) {
		tmp = x;
	} else if (t <= 3.2e-46) {
		tmp = (y / t) * -x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -4.2e-107:
		tmp = x
	elif t <= 3.2e-46:
		tmp = (y / t) * -x
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -4.2e-107)
		tmp = x;
	elseif (t <= 3.2e-46)
		tmp = Float64(Float64(y / t) * Float64(-x));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -4.2e-107)
		tmp = x;
	elseif (t <= 3.2e-46)
		tmp = (y / t) * -x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.2e-107], x, If[LessEqual[t, 3.2e-46], N[(N[(y / t), $MachinePrecision] * (-x)), $MachinePrecision], x]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.1999999999999998e-107 or 3.1999999999999999e-46 < t

    1. Initial program 89.3%

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

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

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

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

    if -4.1999999999999998e-107 < t < 3.1999999999999999e-46

    1. Initial program 98.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
    7. Taylor expanded in y around inf 48.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{t}\right)} \]
      2. distribute-frac-neg48.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{-107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 98.0% accurate, 1.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x + \frac{y}{t} \cdot \left(z - x\right)} \]
  4. Final simplification98.1%

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

Alternative 9: 66.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.7%

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

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{t}\right)} \]
  7. Final simplification66.2%

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

Alternative 10: 39.4% 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.7%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification39.9%

    \[\leadsto x \]

Developer target: 91.2% 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 2023336 
(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)))