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

Percentage Accurate: 92.4% → 97.8%
Time: 8.3s
Alternatives: 13
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 13 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.4% 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, 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 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 69.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+156}:\\
\;\;\;\;\frac{y}{t} \cdot 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.49999999999999996e156

    1. Initial program 90.9%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 71.9%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. add-log-exp44.3%

        \[\leadsto \color{blue}{\log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      2. *-un-lft-identity44.3%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{y \cdot z}{t}}\right)} \]
      3. log-prod44.3%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      4. metadata-eval44.3%

        \[\leadsto \color{blue}{0} + \log \left(e^{\frac{y \cdot z}{t}}\right) \]
      5. add-log-exp71.5%

        \[\leadsto 0 + \color{blue}{\frac{y \cdot z}{t}} \]
      6. associate-/l*65.3%

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

      \[\leadsto \color{blue}{0 + y \cdot \frac{z}{t}} \]
    7. Step-by-step derivation
      1. +-lft-identity65.3%

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

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-*l/71.5%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      4. associate-*r/77.5%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    8. Simplified77.5%

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

    if -2.49999999999999996e156 < z

    1. Initial program 97.1%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 66.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+156}:\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 70.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.4500000000000001e73

    1. Initial program 96.4%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 71.5%

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

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

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

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

    if 1.4500000000000001e73 < z

    1. Initial program 96.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 78.3%

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

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

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

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

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

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

        \[\leadsto x + \left(z \cdot \frac{y}{t} + \left(-\color{blue}{x \cdot \frac{y}{t}}\right)\right) \]
      6. distribute-lft-neg-in87.0%

        \[\leadsto x + \left(z \cdot \frac{y}{t} + \color{blue}{\left(-x\right) \cdot \frac{y}{t}}\right) \]
      7. distribute-rgt-in98.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.45 \cdot 10^{+73}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.4% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 94.6%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 92.6%

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

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

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

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

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

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

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

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

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

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

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

    if -5.80000000000000014e119 < y

    1. Initial program 96.7%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified76.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+119}:\\ \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+119}:\\
\;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\

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


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

    1. Initial program 94.6%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 92.6%

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

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

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

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

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

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

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

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

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

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

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

    if -6.4999999999999997e119 < y

    1. Initial program 96.7%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified76.0%

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      2. un-div-inv37.5%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    7. Applied egg-rr76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+119}:\\ \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 11500000:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

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


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

    1. Initial program 98.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 82.2%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified77.9%

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

    if 1.15e7 < y

    1. Initial program 90.7%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 81.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 11500000:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(z - x\right)}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 46.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.49999999999999996e95

    1. Initial program 97.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 64.2%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. add-log-exp25.9%

        \[\leadsto \color{blue}{\log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      2. *-un-lft-identity25.9%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{y \cdot z}{t}}\right)} \]
      3. log-prod25.9%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      4. metadata-eval25.9%

        \[\leadsto \color{blue}{0} + \log \left(e^{\frac{y \cdot z}{t}}\right) \]
      5. add-log-exp46.9%

        \[\leadsto 0 + \color{blue}{\frac{y \cdot z}{t}} \]
      6. associate-/l*44.8%

        \[\leadsto 0 + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Applied egg-rr44.8%

      \[\leadsto \color{blue}{0 + y \cdot \frac{z}{t}} \]
    7. Step-by-step derivation
      1. +-lft-identity44.8%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative44.8%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-*l/46.9%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      4. associate-*r/48.5%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    8. Simplified48.5%

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

    if 1.49999999999999996e95 < x

    1. Initial program 92.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 54.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.5 \cdot 10^{+95}:\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 45.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.7999999999999997e94

    1. Initial program 97.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 64.2%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. add-log-exp25.9%

        \[\leadsto \color{blue}{\log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      2. *-un-lft-identity25.9%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{y \cdot z}{t}}\right)} \]
      3. log-prod25.9%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      4. metadata-eval25.9%

        \[\leadsto \color{blue}{0} + \log \left(e^{\frac{y \cdot z}{t}}\right) \]
      5. add-log-exp46.9%

        \[\leadsto 0 + \color{blue}{\frac{y \cdot z}{t}} \]
      6. associate-/l*44.8%

        \[\leadsto 0 + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Applied egg-rr44.8%

      \[\leadsto \color{blue}{0 + y \cdot \frac{z}{t}} \]
    7. Step-by-step derivation
      1. +-lft-identity44.8%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative44.8%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-*l/46.9%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      4. associate-*r/48.5%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    8. Simplified48.5%

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

    if 5.7999999999999997e94 < x

    1. Initial program 92.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 54.2%

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{t} \]
      2. distribute-lft-neg-out51.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.8 \cdot 10^{+94}:\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(-x\right)}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 44.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-68}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.7000000000000002e-68

    1. Initial program 97.3%

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

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

    if -2.7000000000000002e-68 < x

    1. Initial program 96.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 66.1%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    6. Simplified47.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{-68}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 46.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-70}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.99999999999999949e-70

    1. Initial program 97.3%

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

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

    if -6.99999999999999949e-70 < x

    1. Initial program 96.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 66.1%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. add-log-exp25.8%

        \[\leadsto \color{blue}{\log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      2. *-un-lft-identity25.8%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{y \cdot z}{t}}\right)} \]
      3. log-prod25.8%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{y \cdot z}{t}}\right)} \]
      4. metadata-eval25.8%

        \[\leadsto \color{blue}{0} + \log \left(e^{\frac{y \cdot z}{t}}\right) \]
      5. add-log-exp49.3%

        \[\leadsto 0 + \color{blue}{\frac{y \cdot z}{t}} \]
      6. associate-/l*47.8%

        \[\leadsto 0 + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Applied egg-rr47.8%

      \[\leadsto \color{blue}{0 + y \cdot \frac{z}{t}} \]
    7. Step-by-step derivation
      1. +-lft-identity47.8%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative47.8%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-*l/49.3%

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
      4. associate-*r/51.7%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    8. Simplified51.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{-70}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t} \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 44.7% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.3000000000000002e-71

    1. Initial program 97.3%

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

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

    if -3.3000000000000002e-71 < x

    1. Initial program 96.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 66.1%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    6. Simplified47.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-71}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 44.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-69}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.50000000000000094e-69

    1. Initial program 97.3%

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

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

    if -9.50000000000000094e-69 < x

    1. Initial program 96.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 66.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{-69}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 38.1% 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 96.4%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification36.7%

    \[\leadsto x \]
  5. Add Preprocessing

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 2024066 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

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

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