Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3

Percentage Accurate: 83.5% → 97.1%
Time: 10.5s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 97.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 2: 61.6% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+101}:\\
\;\;\;\;y \cdot \frac{x}{-z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.1e42

    1. Initial program 72.2%

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

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

        \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}}{t - z} \]
      2. neg-lowering-neg.f6458.5

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot t}}{z} + x \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{t}{z}} + x \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{t}{z}, x\right)} \]
      5. /-lowering-/.f6469.6

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{t}{z}}, x\right) \]
    8. Simplified69.6%

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

    if -4.1e42 < z < 2.5500000000000001e23

    1. Initial program 93.8%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y - z}}{t - z} \cdot x \]
      6. --lowering--.f6495.3

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

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

      \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
    6. Step-by-step derivation
      1. /-lowering-/.f6461.4

        \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
    7. Simplified61.4%

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

    if 2.5500000000000001e23 < z < 8.1999999999999999e101

    1. Initial program 84.4%

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \left(y - z\right)}{z}\right)} \]
      2. neg-sub0N/A

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

        \[\leadsto 0 - \color{blue}{x \cdot \frac{y - z}{z}} \]
      4. div-subN/A

        \[\leadsto 0 - x \cdot \color{blue}{\left(\frac{y}{z} - \frac{z}{z}\right)} \]
      5. sub-negN/A

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

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

        \[\leadsto 0 - x \cdot \left(\frac{y}{z} + \color{blue}{-1}\right) \]
      8. distribute-rgt-inN/A

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

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

        \[\leadsto 0 - \left(\color{blue}{\frac{x \cdot y}{z}} + -1 \cdot x\right) \]
      11. mul-1-negN/A

        \[\leadsto 0 - \left(\frac{x \cdot y}{z} + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
      12. unsub-negN/A

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

        \[\leadsto \color{blue}{\left(0 - \frac{x \cdot y}{z}\right) + x} \]
      14. neg-sub0N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot y}{z}\right)\right)} + x \]
      15. mul-1-negN/A

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{z}} + x \]
      16. +-commutativeN/A

        \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{z}} \]
      17. mul-1-negN/A

        \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot y}{z}\right)\right)} \]
      18. unsub-negN/A

        \[\leadsto \color{blue}{x - \frac{x \cdot y}{z}} \]
      19. --lowering--.f64N/A

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

        \[\leadsto x - \frac{\color{blue}{y \cdot x}}{z} \]
      21. associate-/l*N/A

        \[\leadsto x - \color{blue}{y \cdot \frac{x}{z}} \]
      22. *-lowering-*.f64N/A

        \[\leadsto x - \color{blue}{y \cdot \frac{x}{z}} \]
      23. /-lowering-/.f6473.3

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{y \cdot \frac{x}{z}}\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)} \]
      5. mul-1-negN/A

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

        \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{x}{z}\right)} \]
      7. mul-1-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)} \]
      8. distribute-neg-frac2N/A

        \[\leadsto y \cdot \color{blue}{\frac{x}{\mathsf{neg}\left(z\right)}} \]
      9. mul-1-negN/A

        \[\leadsto y \cdot \frac{x}{\color{blue}{-1 \cdot z}} \]
      10. /-lowering-/.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{x}{-1 \cdot z}} \]
      11. mul-1-negN/A

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      12. neg-lowering-neg.f6462.4

        \[\leadsto y \cdot \frac{x}{\color{blue}{-z}} \]
    8. Simplified62.4%

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

    if 8.1999999999999999e101 < z

    1. Initial program 71.2%

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

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified56.7%

        \[\leadsto \color{blue}{x} \]
    5. Recombined 4 regimes into one program.
    6. Final simplification62.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+42}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{+23}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+101}:\\ \;\;\;\;y \cdot \frac{x}{-z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 61.3% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.7 \cdot 10^{+43}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{y \cdot x}{-z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -5.7e+43)
       (fma x (/ t z) x)
       (if (<= z 3.6e+21) (* x (/ y t)) (if (<= z 7.5e+101) (/ (* y x) (- z)) x))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -5.7e+43) {
    		tmp = fma(x, (t / z), x);
    	} else if (z <= 3.6e+21) {
    		tmp = x * (y / t);
    	} else if (z <= 7.5e+101) {
    		tmp = (y * x) / -z;
    	} else {
    		tmp = x;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -5.7e+43)
    		tmp = fma(x, Float64(t / z), x);
    	elseif (z <= 3.6e+21)
    		tmp = Float64(x * Float64(y / t));
    	elseif (z <= 7.5e+101)
    		tmp = Float64(Float64(y * x) / Float64(-z));
    	else
    		tmp = x;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -5.7e+43], N[(x * N[(t / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 3.6e+21], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+101], N[(N[(y * x), $MachinePrecision] / (-z)), $MachinePrecision], x]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -5.7 \cdot 10^{+43}:\\
    \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\
    
    \mathbf{elif}\;z \leq 3.6 \cdot 10^{+21}:\\
    \;\;\;\;x \cdot \frac{y}{t}\\
    
    \mathbf{elif}\;z \leq 7.5 \cdot 10^{+101}:\\
    \;\;\;\;\frac{y \cdot x}{-z}\\
    
    \mathbf{else}:\\
    \;\;\;\;x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if z < -5.6999999999999999e43

      1. Initial program 72.2%

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

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

          \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}}{t - z} \]
        2. neg-lowering-neg.f6458.5

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

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

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

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

          \[\leadsto \frac{\color{blue}{x \cdot t}}{z} + x \]
        3. associate-/l*N/A

          \[\leadsto \color{blue}{x \cdot \frac{t}{z}} + x \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{t}{z}, x\right)} \]
        5. /-lowering-/.f6469.6

          \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{t}{z}}, x\right) \]
      8. Simplified69.6%

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

      if -5.6999999999999999e43 < z < 3.6e21

      1. Initial program 93.8%

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{y - z}}{t - z} \cdot x \]
        6. --lowering--.f6495.3

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

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

        \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
      6. Step-by-step derivation
        1. /-lowering-/.f6461.4

          \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
      7. Simplified61.4%

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

      if 3.6e21 < z < 7.4999999999999995e101

      1. Initial program 84.4%

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

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

          \[\leadsto \color{blue}{\frac{1}{t - z} \cdot \left(x \cdot \left(y - z\right)\right)} \]
        3. flip3--N/A

          \[\leadsto \frac{1}{\color{blue}{\frac{{t}^{3} - {z}^{3}}{t \cdot t + \left(z \cdot z + t \cdot z\right)}}} \cdot \left(x \cdot \left(y - z\right)\right) \]
        4. clear-numN/A

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{{t}^{3} - {z}^{3}}{t \cdot t + \left(z \cdot z + t \cdot z\right)}}} \cdot \left(x \cdot \left(y - z\right)\right) \]
        7. flip3--N/A

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

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

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

          \[\leadsto \frac{1}{t - z} \cdot \color{blue}{\left(x \cdot \left(y - z\right)\right)} \]
        11. --lowering--.f6484.2

          \[\leadsto \frac{1}{t - z} \cdot \left(x \cdot \color{blue}{\left(y - z\right)}\right) \]
      4. Applied egg-rr84.2%

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
        3. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot y}{z}\right)} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot y}{z}\right)} \]
          3. /-lowering-/.f64N/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{x \cdot y}{z}}\right) \]
          4. *-lowering-*.f6452.3

            \[\leadsto -\frac{\color{blue}{x \cdot y}}{z} \]
        4. Simplified52.3%

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

        if 7.4999999999999995e101 < z

        1. Initial program 71.2%

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

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified56.7%

            \[\leadsto \color{blue}{x} \]
        5. Recombined 4 regimes into one program.
        6. Final simplification61.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.7 \cdot 10^{+43}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{y \cdot x}{-z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
        7. Add Preprocessing

        Alternative 4: 74.9% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{t - z}\\ \mathbf{if}\;y \leq -3600:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+100}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* x (/ y (- t z)))))
           (if (<= y -3600.0) t_1 (if (<= y 7e+100) (* x (/ z (- z t))) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = x * (y / (t - z));
        	double tmp;
        	if (y <= -3600.0) {
        		tmp = t_1;
        	} else if (y <= 7e+100) {
        		tmp = x * (z / (z - t));
        	} else {
        		tmp = t_1;
        	}
        	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) :: tmp
            t_1 = x * (y / (t - z))
            if (y <= (-3600.0d0)) then
                tmp = t_1
            else if (y <= 7d+100) then
                tmp = x * (z / (z - t))
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = x * (y / (t - z));
        	double tmp;
        	if (y <= -3600.0) {
        		tmp = t_1;
        	} else if (y <= 7e+100) {
        		tmp = x * (z / (z - t));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = x * (y / (t - z))
        	tmp = 0
        	if y <= -3600.0:
        		tmp = t_1
        	elif y <= 7e+100:
        		tmp = x * (z / (z - t))
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(x * Float64(y / Float64(t - z)))
        	tmp = 0.0
        	if (y <= -3600.0)
        		tmp = t_1;
        	elseif (y <= 7e+100)
        		tmp = Float64(x * Float64(z / Float64(z - t)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = x * (y / (t - z));
        	tmp = 0.0;
        	if (y <= -3600.0)
        		tmp = t_1;
        	elseif (y <= 7e+100)
        		tmp = x * (z / (z - t));
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3600.0], t$95$1, If[LessEqual[y, 7e+100], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := x \cdot \frac{y}{t - z}\\
        \mathbf{if}\;y \leq -3600:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq 7 \cdot 10^{+100}:\\
        \;\;\;\;x \cdot \frac{z}{z - t}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -3600 or 6.99999999999999953e100 < y

          1. Initial program 85.8%

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

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

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

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

              \[\leadsto x \cdot \color{blue}{\frac{y}{t - z}} \]
            4. --lowering--.f6484.9

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

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

          if -3600 < y < 6.99999999999999953e100

          1. Initial program 84.9%

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

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

              \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}}{t - z} \]
            2. neg-lowering-neg.f6465.8

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

            \[\leadsto \frac{x \cdot \color{blue}{\left(-z\right)}}{t - z} \]
          6. Step-by-step derivation
            1. associate-/l*N/A

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

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(z\right)}{t - z} \cdot x} \]
            3. *-lowering-*.f64N/A

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{z}{t - z}\right)\right)} \cdot x \]
            5. distribute-frac-neg2N/A

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

              \[\leadsto \color{blue}{\frac{z}{\mathsf{neg}\left(\left(t - z\right)\right)}} \cdot x \]
            7. neg-sub0N/A

              \[\leadsto \frac{z}{\color{blue}{0 - \left(t - z\right)}} \cdot x \]
            8. sub-negN/A

              \[\leadsto \frac{z}{0 - \color{blue}{\left(t + \left(\mathsf{neg}\left(z\right)\right)\right)}} \cdot x \]
            9. +-commutativeN/A

              \[\leadsto \frac{z}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + t\right)}} \cdot x \]
            10. associate--r+N/A

              \[\leadsto \frac{z}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(z\right)\right)\right) - t}} \cdot x \]
            11. neg-sub0N/A

              \[\leadsto \frac{z}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} - t} \cdot x \]
            12. remove-double-negN/A

              \[\leadsto \frac{z}{\color{blue}{z} - t} \cdot x \]
            13. --lowering--.f6478.3

              \[\leadsto \frac{z}{\color{blue}{z - t}} \cdot x \]
          7. Applied egg-rr78.3%

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

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

        Alternative 5: 69.6% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+45}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+137}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= z -1.45e+45)
           (fma x (/ t z) x)
           (if (<= z 7.5e+137) (* x (/ y (- t z))) x)))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= -1.45e+45) {
        		tmp = fma(x, (t / z), x);
        	} else if (z <= 7.5e+137) {
        		tmp = x * (y / (t - z));
        	} else {
        		tmp = x;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (z <= -1.45e+45)
        		tmp = fma(x, Float64(t / z), x);
        	elseif (z <= 7.5e+137)
        		tmp = Float64(x * Float64(y / Float64(t - z)));
        	else
        		tmp = x;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[z, -1.45e+45], N[(x * N[(t / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 7.5e+137], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -1.45 \cdot 10^{+45}:\\
        \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\
        
        \mathbf{elif}\;z \leq 7.5 \cdot 10^{+137}:\\
        \;\;\;\;x \cdot \frac{y}{t - z}\\
        
        \mathbf{else}:\\
        \;\;\;\;x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -1.4499999999999999e45

          1. Initial program 72.2%

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

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

              \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}}{t - z} \]
            2. neg-lowering-neg.f6458.5

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

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

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

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

              \[\leadsto \frac{\color{blue}{x \cdot t}}{z} + x \]
            3. associate-/l*N/A

              \[\leadsto \color{blue}{x \cdot \frac{t}{z}} + x \]
            4. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{t}{z}, x\right)} \]
            5. /-lowering-/.f6469.6

              \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{t}{z}}, x\right) \]
          8. Simplified69.6%

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

          if -1.4499999999999999e45 < z < 7.50000000000000025e137

          1. Initial program 92.2%

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

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

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

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

              \[\leadsto x \cdot \color{blue}{\frac{y}{t - z}} \]
            4. --lowering--.f6473.4

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

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

          if 7.50000000000000025e137 < z

          1. Initial program 64.1%

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

            \[\leadsto \color{blue}{x} \]
          4. Step-by-step derivation
            1. Simplified68.3%

              \[\leadsto \color{blue}{x} \]
          5. Recombined 3 regimes into one program.
          6. Add Preprocessing

          Alternative 6: 61.8% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+43}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+72}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= z -1.05e+43) (fma x (/ t z) x) (if (<= z 5.7e+72) (* x (/ y t)) x)))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (z <= -1.05e+43) {
          		tmp = fma(x, (t / z), x);
          	} else if (z <= 5.7e+72) {
          		tmp = x * (y / t);
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (z <= -1.05e+43)
          		tmp = fma(x, Float64(t / z), x);
          	elseif (z <= 5.7e+72)
          		tmp = Float64(x * Float64(y / t));
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[z, -1.05e+43], N[(x * N[(t / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.7e+72], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -1.05 \cdot 10^{+43}:\\
          \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\
          
          \mathbf{elif}\;z \leq 5.7 \cdot 10^{+72}:\\
          \;\;\;\;x \cdot \frac{y}{t}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -1.05000000000000001e43

            1. Initial program 72.2%

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

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

                \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}}{t - z} \]
              2. neg-lowering-neg.f6458.5

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

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

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

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

                \[\leadsto \frac{\color{blue}{x \cdot t}}{z} + x \]
              3. associate-/l*N/A

                \[\leadsto \color{blue}{x \cdot \frac{t}{z}} + x \]
              4. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{t}{z}, x\right)} \]
              5. /-lowering-/.f6469.6

                \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{t}{z}}, x\right) \]
            8. Simplified69.6%

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

            if -1.05000000000000001e43 < z < 5.6999999999999997e72

            1. Initial program 93.5%

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

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

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

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

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

                \[\leadsto \frac{\color{blue}{y - z}}{t - z} \cdot x \]
              6. --lowering--.f6495.6

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

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

              \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
            6. Step-by-step derivation
              1. /-lowering-/.f6459.9

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

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

            if 5.6999999999999997e72 < z

            1. Initial program 72.6%

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

              \[\leadsto \color{blue}{x} \]
            4. Step-by-step derivation
              1. Simplified49.3%

                \[\leadsto \color{blue}{x} \]
            5. Recombined 3 regimes into one program.
            6. Final simplification59.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+43}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{t}{z}, x\right)\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+72}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
            7. Add Preprocessing

            Alternative 7: 61.8% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+73}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (<= z -1.35e+43) x (if (<= z 1.15e+73) (* x (/ y t)) x)))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if (z <= -1.35e+43) {
            		tmp = x;
            	} else if (z <= 1.15e+73) {
            		tmp = x * (y / t);
            	} else {
            		tmp = x;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: tmp
                if (z <= (-1.35d+43)) then
                    tmp = x
                else if (z <= 1.15d+73) then
                    tmp = x * (y / t)
                else
                    tmp = x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double tmp;
            	if (z <= -1.35e+43) {
            		tmp = x;
            	} else if (z <= 1.15e+73) {
            		tmp = x * (y / t);
            	} else {
            		tmp = x;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	tmp = 0
            	if z <= -1.35e+43:
            		tmp = x
            	elif z <= 1.15e+73:
            		tmp = x * (y / t)
            	else:
            		tmp = x
            	return tmp
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if (z <= -1.35e+43)
            		tmp = x;
            	elseif (z <= 1.15e+73)
            		tmp = Float64(x * Float64(y / t));
            	else
            		tmp = x;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if (z <= -1.35e+43)
            		tmp = x;
            	elseif (z <= 1.15e+73)
            		tmp = x * (y / t);
            	else
            		tmp = x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+43], x, If[LessEqual[z, 1.15e+73], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -1.35 \cdot 10^{+43}:\\
            \;\;\;\;x\\
            
            \mathbf{elif}\;z \leq 1.15 \cdot 10^{+73}:\\
            \;\;\;\;x \cdot \frac{y}{t}\\
            
            \mathbf{else}:\\
            \;\;\;\;x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -1.3500000000000001e43 or 1.15e73 < z

              1. Initial program 72.4%

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

                \[\leadsto \color{blue}{x} \]
              4. Step-by-step derivation
                1. Simplified58.9%

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

                if -1.3500000000000001e43 < z < 1.15e73

                1. Initial program 93.5%

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

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

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

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

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

                    \[\leadsto \frac{\color{blue}{y - z}}{t - z} \cdot x \]
                  6. --lowering--.f6495.6

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

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

                  \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
                6. Step-by-step derivation
                  1. /-lowering-/.f6459.9

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

                  \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
              5. Recombined 2 regimes into one program.
              6. Final simplification59.5%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+73}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
              7. Add Preprocessing

              Alternative 8: 60.3% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+42}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+76}:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (<= z -5.8e+42) x (if (<= z 2.45e+76) (* y (/ x t)) x)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if (z <= -5.8e+42) {
              		tmp = x;
              	} else if (z <= 2.45e+76) {
              		tmp = y * (x / t);
              	} else {
              		tmp = x;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: tmp
                  if (z <= (-5.8d+42)) then
                      tmp = x
                  else if (z <= 2.45d+76) then
                      tmp = y * (x / t)
                  else
                      tmp = x
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double tmp;
              	if (z <= -5.8e+42) {
              		tmp = x;
              	} else if (z <= 2.45e+76) {
              		tmp = y * (x / t);
              	} else {
              		tmp = x;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	tmp = 0
              	if z <= -5.8e+42:
              		tmp = x
              	elif z <= 2.45e+76:
              		tmp = y * (x / t)
              	else:
              		tmp = x
              	return tmp
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if (z <= -5.8e+42)
              		tmp = x;
              	elseif (z <= 2.45e+76)
              		tmp = Float64(y * Float64(x / t));
              	else
              		tmp = x;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	tmp = 0.0;
              	if (z <= -5.8e+42)
              		tmp = x;
              	elseif (z <= 2.45e+76)
              		tmp = y * (x / t);
              	else
              		tmp = x;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := If[LessEqual[z, -5.8e+42], x, If[LessEqual[z, 2.45e+76], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -5.8 \cdot 10^{+42}:\\
              \;\;\;\;x\\
              
              \mathbf{elif}\;z \leq 2.45 \cdot 10^{+76}:\\
              \;\;\;\;y \cdot \frac{x}{t}\\
              
              \mathbf{else}:\\
              \;\;\;\;x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -5.79999999999999961e42 or 2.45000000000000013e76 < z

                1. Initial program 71.8%

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

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Simplified60.1%

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

                  if -5.79999999999999961e42 < z < 2.45000000000000013e76

                  1. Initial program 93.6%

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

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

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

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

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

                      \[\leadsto \frac{\color{blue}{y - z}}{t - z} \cdot x \]
                    6. --lowering--.f6495.6

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

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

                    \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
                  6. Step-by-step derivation
                    1. /-lowering-/.f6459.2

                      \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
                  7. Simplified59.2%

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

                      \[\leadsto \color{blue}{x \cdot \frac{y}{t}} \]
                    2. clear-numN/A

                      \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
                    3. associate-/r/N/A

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

                      \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t}\right) \cdot y} \]
                    5. div-invN/A

                      \[\leadsto \color{blue}{\frac{x}{t}} \cdot y \]
                    6. *-lowering-*.f64N/A

                      \[\leadsto \color{blue}{\frac{x}{t} \cdot y} \]
                    7. /-lowering-/.f6455.9

                      \[\leadsto \color{blue}{\frac{x}{t}} \cdot y \]
                  9. Applied egg-rr55.9%

                    \[\leadsto \color{blue}{\frac{x}{t} \cdot y} \]
                5. Recombined 2 regimes into one program.
                6. Final simplification57.5%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+42}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+76}:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                7. Add Preprocessing

                Alternative 9: 64.2% accurate, 0.8× speedup?

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

                  1. Initial program 84.7%

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

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

                      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{\mathsf{neg}\left(z\right)}} \]
                    2. neg-lowering-neg.f6443.8

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

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

                  if 2.7999999999999999e-270 < x

                  1. Initial program 85.9%

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

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

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

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

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

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

                      \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot \left(y - z\right) \]
                    7. --lowering--.f6491.4

                      \[\leadsto \frac{x}{t - z} \cdot \color{blue}{\left(y - z\right)} \]
                  4. Applied egg-rr91.4%

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

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

                Alternative 10: 35.9% accurate, 23.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 85.3%

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

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Simplified29.8%

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

                  Developer Target 1: 97.0% accurate, 0.8× speedup?

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

                  Reproduce

                  ?
                  herbie shell --seed 2024205 
                  (FPCore (x y z t)
                    :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
                    :precision binary64
                  
                    :alt
                    (! :herbie-platform default (/ x (/ (- t z) (- y z))))
                  
                    (/ (* x (- y z)) (- t z)))