Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.5% → 96.2%
Time: 6.6s
Alternatives: 10
Speedup: 0.9×

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: 96.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.06 \cdot 10^{+108}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y - x, x\right)\\

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


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

    1. Initial program 94.5%

      \[x + \frac{\left(y - x\right) \cdot z}{t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{x + \frac{\left(y - x\right) \cdot z}{t}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t} + x} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} + x \]
      4. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t}} + x \]
      6. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \left(y - x\right)} + x \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, y - x, x\right)} \]
      8. lower-/.f6498.3

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

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

    if 1.06e108 < z

    1. Initial program 94.7%

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      5. lower--.f6499.5

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

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

Alternative 2: 75.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - \frac{z}{t}\right) \cdot x\\ t_2 := \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{-28}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-145}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-70}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y - x}{t} \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- 1.0 (/ z t)) x)) (t_2 (* (/ z t) (- y x))))
   (if (<= z -2.2e-28)
     t_2
     (if (<= z 2.1e-145)
       t_1
       (if (<= z 3.2e-70) t_2 (if (<= z 4.2e-16) t_1 (* (/ (- y x) t) z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (1.0 - (z / t)) * x;
	double t_2 = (z / t) * (y - x);
	double tmp;
	if (z <= -2.2e-28) {
		tmp = t_2;
	} else if (z <= 2.1e-145) {
		tmp = t_1;
	} else if (z <= 3.2e-70) {
		tmp = t_2;
	} else if (z <= 4.2e-16) {
		tmp = t_1;
	} else {
		tmp = ((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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (1.0d0 - (z / t)) * x
    t_2 = (z / t) * (y - x)
    if (z <= (-2.2d-28)) then
        tmp = t_2
    else if (z <= 2.1d-145) then
        tmp = t_1
    else if (z <= 3.2d-70) then
        tmp = t_2
    else if (z <= 4.2d-16) then
        tmp = t_1
    else
        tmp = ((y - x) / t) * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (1.0 - (z / t)) * x;
	double t_2 = (z / t) * (y - x);
	double tmp;
	if (z <= -2.2e-28) {
		tmp = t_2;
	} else if (z <= 2.1e-145) {
		tmp = t_1;
	} else if (z <= 3.2e-70) {
		tmp = t_2;
	} else if (z <= 4.2e-16) {
		tmp = t_1;
	} else {
		tmp = ((y - x) / t) * z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (1.0 - (z / t)) * x
	t_2 = (z / t) * (y - x)
	tmp = 0
	if z <= -2.2e-28:
		tmp = t_2
	elif z <= 2.1e-145:
		tmp = t_1
	elif z <= 3.2e-70:
		tmp = t_2
	elif z <= 4.2e-16:
		tmp = t_1
	else:
		tmp = ((y - x) / t) * z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(1.0 - Float64(z / t)) * x)
	t_2 = Float64(Float64(z / t) * Float64(y - x))
	tmp = 0.0
	if (z <= -2.2e-28)
		tmp = t_2;
	elseif (z <= 2.1e-145)
		tmp = t_1;
	elseif (z <= 3.2e-70)
		tmp = t_2;
	elseif (z <= 4.2e-16)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(y - x) / t) * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (1.0 - (z / t)) * x;
	t_2 = (z / t) * (y - x);
	tmp = 0.0;
	if (z <= -2.2e-28)
		tmp = t_2;
	elseif (z <= 2.1e-145)
		tmp = t_1;
	elseif (z <= 3.2e-70)
		tmp = t_2;
	elseif (z <= 4.2e-16)
		tmp = t_1;
	else
		tmp = ((y - x) / t) * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e-28], t$95$2, If[LessEqual[z, 2.1e-145], t$95$1, If[LessEqual[z, 3.2e-70], t$95$2, If[LessEqual[z, 4.2e-16], t$95$1, N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(1 - \frac{z}{t}\right) \cdot x\\
t_2 := \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-28}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-70}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.19999999999999996e-28 or 2.09999999999999991e-145 < z < 3.1999999999999997e-70

    1. Initial program 87.5%

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
      5. lower--.f6478.2

        \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
    5. Applied rewrites78.2%

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

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

      if -2.19999999999999996e-28 < z < 2.09999999999999991e-145 or 3.1999999999999997e-70 < z < 4.2000000000000002e-16

      1. Initial program 98.9%

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

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
        3. fp-cancel-sign-sub-invN/A

          \[\leadsto \color{blue}{\left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{z}{t}\right)} \cdot x \]
        4. metadata-evalN/A

          \[\leadsto \left(1 - \color{blue}{1} \cdot \frac{z}{t}\right) \cdot x \]
        5. *-lft-identityN/A

          \[\leadsto \left(1 - \color{blue}{\frac{z}{t}}\right) \cdot x \]
        6. lower--.f64N/A

          \[\leadsto \color{blue}{\left(1 - \frac{z}{t}\right)} \cdot x \]
        7. lower-/.f6480.1

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

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

      if 4.2000000000000002e-16 < z

      1. Initial program 96.0%

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. Step-by-step derivation
        1. div-subN/A

          \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
        5. lower--.f6491.3

          \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
      5. Applied rewrites91.3%

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

    Alternative 3: 74.4% accurate, 0.7× speedup?

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

      1. Initial program 91.5%

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. Step-by-step derivation
        1. div-subN/A

          \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
        5. lower--.f6478.9

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

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      6. Step-by-step derivation
        1. Applied rewrites79.3%

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

        if -2.19999999999999996e-28 < z < 2.09999999999999991e-145

        1. Initial program 98.8%

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

          \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
          3. fp-cancel-sign-sub-invN/A

            \[\leadsto \color{blue}{\left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{z}{t}\right)} \cdot x \]
          4. metadata-evalN/A

            \[\leadsto \left(1 - \color{blue}{1} \cdot \frac{z}{t}\right) \cdot x \]
          5. *-lft-identityN/A

            \[\leadsto \left(1 - \color{blue}{\frac{z}{t}}\right) \cdot x \]
          6. lower--.f64N/A

            \[\leadsto \color{blue}{\left(1 - \frac{z}{t}\right)} \cdot x \]
          7. lower-/.f6479.5

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-28} \lor \neg \left(z \leq 2.1 \cdot 10^{-145}\right):\\ \;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{z}{t}\right) \cdot x\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 73.7% accurate, 0.7× speedup?

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

        1. Initial program 93.2%

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

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

            \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
          3. lower-/.f6462.4

            \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
        5. Applied rewrites62.4%

          \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
        6. Step-by-step derivation
          1. Applied rewrites67.8%

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

          if -4.00000000000000018e42 < y < 1.04999999999999997e27

          1. Initial program 95.7%

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

            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
            3. fp-cancel-sign-sub-invN/A

              \[\leadsto \color{blue}{\left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{z}{t}\right)} \cdot x \]
            4. metadata-evalN/A

              \[\leadsto \left(1 - \color{blue}{1} \cdot \frac{z}{t}\right) \cdot x \]
            5. *-lft-identityN/A

              \[\leadsto \left(1 - \color{blue}{\frac{z}{t}}\right) \cdot x \]
            6. lower--.f64N/A

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+42} \lor \neg \left(y \leq 1.05 \cdot 10^{+27}\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{z}{t}\right) \cdot x\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 83.8% accurate, 0.7× speedup?

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

          1. Initial program 84.7%

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

            \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
          4. Step-by-step derivation
            1. div-subN/A

              \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
            4. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
            5. lower--.f6482.8

              \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
          5. Applied rewrites82.8%

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

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

            if -5.49999999999999967e-28 < z < 1.59999999999999997e78

            1. Initial program 99.0%

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

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

                \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
              2. lower-*.f6488.1

                \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
            5. Applied rewrites88.1%

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

            if 1.59999999999999997e78 < z

            1. Initial program 95.0%

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

              \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
            4. Step-by-step derivation
              1. div-subN/A

                \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
              4. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
              5. lower--.f6497.6

                \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
            5. Applied rewrites97.6%

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

          Alternative 6: 73.2% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-28}:\\ \;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-145}:\\ \;\;\;\;\left(1 - \frac{z}{t}\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= z -2.2e-28)
             (* (/ z t) (- y x))
             (if (<= z 2.1e-145) (* (- 1.0 (/ z t)) x) (/ (* (- y x) z) t))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (z <= -2.2e-28) {
          		tmp = (z / t) * (y - x);
          	} else if (z <= 2.1e-145) {
          		tmp = (1.0 - (z / t)) * x;
          	} else {
          		tmp = ((y - x) * 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 <= (-2.2d-28)) then
                  tmp = (z / t) * (y - x)
              else if (z <= 2.1d-145) then
                  tmp = (1.0d0 - (z / t)) * x
              else
                  tmp = ((y - x) * z) / t
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (z <= -2.2e-28) {
          		tmp = (z / t) * (y - x);
          	} else if (z <= 2.1e-145) {
          		tmp = (1.0 - (z / t)) * x;
          	} else {
          		tmp = ((y - x) * z) / t;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if z <= -2.2e-28:
          		tmp = (z / t) * (y - x)
          	elif z <= 2.1e-145:
          		tmp = (1.0 - (z / t)) * x
          	else:
          		tmp = ((y - x) * z) / t
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (z <= -2.2e-28)
          		tmp = Float64(Float64(z / t) * Float64(y - x));
          	elseif (z <= 2.1e-145)
          		tmp = Float64(Float64(1.0 - Float64(z / t)) * x);
          	else
          		tmp = Float64(Float64(Float64(y - x) * z) / t);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (z <= -2.2e-28)
          		tmp = (z / t) * (y - x);
          	elseif (z <= 2.1e-145)
          		tmp = (1.0 - (z / t)) * x;
          	else
          		tmp = ((y - x) * z) / t;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e-28], N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-145], N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -2.2 \cdot 10^{-28}:\\
          \;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\
          
          \mathbf{elif}\;z \leq 2.1 \cdot 10^{-145}:\\
          \;\;\;\;\left(1 - \frac{z}{t}\right) \cdot x\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -2.19999999999999996e-28

            1. Initial program 84.7%

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

              \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
            4. Step-by-step derivation
              1. div-subN/A

                \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
              4. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
              5. lower--.f6482.8

                \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
            5. Applied rewrites82.8%

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

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

              if -2.19999999999999996e-28 < z < 2.09999999999999991e-145

              1. Initial program 98.8%

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

                \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{z}{t}\right) \cdot x} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto \color{blue}{\left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{z}{t}\right)} \cdot x \]
                4. metadata-evalN/A

                  \[\leadsto \left(1 - \color{blue}{1} \cdot \frac{z}{t}\right) \cdot x \]
                5. *-lft-identityN/A

                  \[\leadsto \left(1 - \color{blue}{\frac{z}{t}}\right) \cdot x \]
                6. lower--.f64N/A

                  \[\leadsto \color{blue}{\left(1 - \frac{z}{t}\right)} \cdot x \]
                7. lower-/.f6479.5

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

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

              if 2.09999999999999991e-145 < z

              1. Initial program 97.3%

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

                \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
              4. Step-by-step derivation
                1. div-subN/A

                  \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                3. lower-*.f64N/A

                  \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                4. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
                5. lower--.f6475.4

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

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

                  \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} \]
              7. Recombined 3 regimes into one program.
              8. Add Preprocessing

              Alternative 7: 49.2% accurate, 0.7× speedup?

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

                1. Initial program 92.8%

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

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

                    \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                  3. lower-/.f6458.7

                    \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
                5. Applied rewrites58.7%

                  \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                6. Step-by-step derivation
                  1. Applied rewrites63.3%

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

                  if -1.84999999999999991e-5 < y < 1.45e13

                  1. Initial program 96.5%

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

                    \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
                  4. Step-by-step derivation
                    1. div-subN/A

                      \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
                    2. *-commutativeN/A

                      \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                    3. lower-*.f64N/A

                      \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                    4. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
                    5. lower--.f6446.8

                      \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
                  5. Applied rewrites46.8%

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

                    \[\leadsto \frac{-1 \cdot x}{t} \cdot z \]
                  7. Step-by-step derivation
                    1. Applied rewrites37.9%

                      \[\leadsto \frac{-x}{t} \cdot z \]
                    2. Step-by-step derivation
                      1. Applied rewrites38.4%

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

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

                    Alternative 8: 49.4% accurate, 0.7× speedup?

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

                      1. Initial program 92.8%

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

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

                          \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                        2. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                        3. lower-/.f6458.7

                          \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
                      5. Applied rewrites58.7%

                        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                      6. Step-by-step derivation
                        1. Applied rewrites63.3%

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

                        if -1.84999999999999991e-5 < y < 1.45e13

                        1. Initial program 96.5%

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

                          \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
                        4. Step-by-step derivation
                          1. div-subN/A

                            \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
                          2. *-commutativeN/A

                            \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                          3. lower-*.f64N/A

                            \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                          4. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
                          5. lower--.f6446.8

                            \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
                        5. Applied rewrites46.8%

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

                          \[\leadsto \frac{-1 \cdot x}{t} \cdot z \]
                        7. Step-by-step derivation
                          1. Applied rewrites37.9%

                            \[\leadsto \frac{-x}{t} \cdot z \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification51.3%

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

                        Alternative 9: 50.0% accurate, 0.7× speedup?

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

                          1. Initial program 92.8%

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

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

                              \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                            2. lower-*.f64N/A

                              \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                            3. lower-/.f6458.7

                              \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
                          5. Applied rewrites58.7%

                            \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                          6. Step-by-step derivation
                            1. Applied rewrites63.3%

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

                            if -2.00000000000000016e-5 < y < 1.45e13

                            1. Initial program 96.5%

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

                              \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
                            4. Step-by-step derivation
                              1. div-subN/A

                                \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
                              2. *-commutativeN/A

                                \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                              3. lower-*.f64N/A

                                \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
                              4. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{y - x}{t}} \cdot z \]
                              5. lower--.f6446.8

                                \[\leadsto \frac{\color{blue}{y - x}}{t} \cdot z \]
                            5. Applied rewrites46.8%

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

                              \[\leadsto \frac{-1 \cdot x}{t} \cdot z \]
                            7. Step-by-step derivation
                              1. Applied rewrites37.9%

                                \[\leadsto \frac{-x}{t} \cdot z \]
                              2. Step-by-step derivation
                                1. Applied rewrites36.5%

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

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

                              Alternative 10: 40.8% accurate, 1.4× speedup?

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

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

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

                                  \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                                2. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                                3. lower-/.f6438.2

                                  \[\leadsto \color{blue}{\frac{y}{t}} \cdot z \]
                              5. Applied rewrites38.2%

                                \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                              6. Step-by-step derivation
                                1. Applied rewrites41.4%

                                  \[\leadsto y \cdot \color{blue}{\frac{z}{t}} \]
                                2. Add Preprocessing

                                Developer Target 1: 97.9% accurate, 0.6× 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 2024326 
                                (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)))