Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.5% → 97.9%
Time: 8.9s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 97.9% accurate, 1.0× speedup?

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

\\
x + \frac{y - x}{\frac{t}{z}}
\end{array}
Derivation
  1. Initial program 91.8%

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

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

    \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \frac{z}{t}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num98.0%

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
  6. Applied egg-rr98.1%

    \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
  7. Add Preprocessing

Alternative 2: 94.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.40000000000000006e-79 or 1.11999999999999997e-181 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \frac{y - x}{t}} \]
    7. Simplified95.8%

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

    if -2.40000000000000006e-79 < z < 1.11999999999999997e-181

    1. Initial program 97.7%

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

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

      \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \frac{z}{t}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.8%

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
    6. Applied egg-rr98.9%

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

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

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

Alternative 3: 85.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+68} \lor \neg \left(x \leq 4.2 \cdot 10^{-12}\right):\\
\;\;\;\;x - x \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.5999999999999999e68 or 4.19999999999999988e-12 < x

    1. Initial program 89.5%

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

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

      \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \frac{z}{t}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.9%

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
    6. Applied egg-rr99.9%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
      3. distribute-lft-out--89.8%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{t}} \]
      4. *-rgt-identity89.8%

        \[\leadsto \color{blue}{x} - x \cdot \frac{z}{t} \]
    9. Simplified89.8%

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

    if -3.5999999999999999e68 < x < 4.19999999999999988e-12

    1. Initial program 94.4%

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

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

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

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

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

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

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

Alternative 4: 85.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.28 \cdot 10^{+69} \lor \neg \left(x \leq 1.08 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.27999999999999998e69 or 1.08000000000000004e-14 < x

    1. Initial program 89.5%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    7. Simplified89.8%

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

    if -1.27999999999999998e69 < x < 1.08000000000000004e-14

    1. Initial program 94.4%

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

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

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

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

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

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

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

Alternative 5: 74.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{-102} \lor \neg \left(x \leq 1.08 \cdot 10^{-91}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.6500000000000001e-102 or 1.07999999999999998e-91 < x

    1. Initial program 90.9%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    7. Simplified84.4%

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

    if -2.6500000000000001e-102 < x < 1.07999999999999998e-91

    1. Initial program 93.8%

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    7. Simplified84.7%

      \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    8. Taylor expanded in y around inf 86.0%

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{z}{t} + \frac{x}{y}\right)} \]
    10. Simplified86.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.65 \cdot 10^{-102} \lor \neg \left(x \leq 1.08 \cdot 10^{-91}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 55.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{-33} \lor \neg \left(z \leq 6.6 \cdot 10^{-90}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.3500000000000001e-33 or 6.6e-90 < z

    1. Initial program 86.5%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    8. Taylor expanded in y around inf 66.3%

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

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

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

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

    if -2.3500000000000001e-33 < z < 6.6e-90

    1. Initial program 98.2%

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{-33} \lor \neg \left(z \leq 6.6 \cdot 10^{-90}\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 52.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -185:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-91}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -185

    1. Initial program 87.2%

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

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

      \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \frac{z}{t}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.2%

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
    6. Applied egg-rr96.1%

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot z\right)}}{t} \]
    10. Step-by-step derivation
      1. neg-mul-150.0%

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

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

        \[\leadsto \frac{\color{blue}{z \cdot \left(-x\right)}}{t} \]
    11. Simplified50.0%

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

    if -185 < z < 5.49999999999999965e-91

    1. Initial program 98.3%

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

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

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

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

    if 5.49999999999999965e-91 < z

    1. Initial program 84.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    7. Simplified65.1%

      \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    8. Taylor expanded in y around inf 69.1%

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

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

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

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

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

Alternative 8: 54.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-37}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-89}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.59999999999999964e-37

    1. Initial program 88.7%

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

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

      \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \frac{z}{t}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.6%

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

        \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
    6. Applied egg-rr96.6%

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

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

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

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

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

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

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

    if -6.59999999999999964e-37 < z < 8.49999999999999937e-89

    1. Initial program 98.2%

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

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

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

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

    if 8.49999999999999937e-89 < z

    1. Initial program 84.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    7. Simplified65.1%

      \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    8. Taylor expanded in y around inf 69.1%

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 97.8% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 10: 39.5% 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 91.8%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer Target 1: 97.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
\;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\

\mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024185 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< x -1805102239106601/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- x (* (/ z t) (- x y))) (if (< x 855006432740143/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z))))))

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