Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C

Percentage Accurate: 99.9% → 99.9%
Time: 1.5s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[x \cdot \left(y + z\right) + z \cdot 5 \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (+ (* x (+ y z)) (* z 5.0)))
double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * (y + z)) + (z * 5.0d0)
end function
public static double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
def code(x, y, z):
	return (x * (y + z)) + (z * 5.0)
function code(x, y, z)
	return Float64(Float64(x * Float64(y + z)) + Float64(z * 5.0))
end
function tmp = code(x, y, z)
	tmp = (x * (y + z)) + (z * 5.0);
end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	(x * (y + z)) + (z * (5))
END code
x \cdot \left(y + z\right) + z \cdot 5

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 8 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: 99.9% accurate, 1.0× speedup?

\[x \cdot \left(y + z\right) + z \cdot 5 \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (+ (* x (+ y z)) (* z 5.0)))
double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * (y + z)) + (z * 5.0d0)
end function
public static double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
def code(x, y, z):
	return (x * (y + z)) + (z * 5.0)
function code(x, y, z)
	return Float64(Float64(x * Float64(y + z)) + Float64(z * 5.0))
end
function tmp = code(x, y, z)
	tmp = (x * (y + z)) + (z * 5.0);
end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	(x * (y + z)) + (z * (5))
END code
x \cdot \left(y + z\right) + z \cdot 5

Alternative 1: 98.9% accurate, 1.1× speedup?

\[\mathsf{fma}\left(z, x - -5, y \cdot x\right) \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (fma z (- x -5.0) (* y x)))
double code(double x, double y, double z) {
	return fma(z, (x - -5.0), (y * x));
}
function code(x, y, z)
	return fma(z, Float64(x - -5.0), Float64(y * x))
end
code[x_, y_, z_] := N[(z * N[(x - -5.0), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	(z * (x - (-5))) + (y * x)
END code
\mathsf{fma}\left(z, x - -5, y \cdot x\right)
Derivation
  1. Initial program 99.9%

    \[x \cdot \left(y + z\right) + z \cdot 5 \]
  2. Step-by-step derivation
    1. Applied rewrites98.8%

      \[\leadsto \mathsf{fma}\left(z, x - -5, y \cdot x\right) \]
    2. Add Preprocessing

    Alternative 2: 98.8% accurate, 1.1× speedup?

    \[\mathsf{fma}\left(x, y, z \cdot \left(5 + x\right)\right) \]
    (FPCore (x y z)
      :precision binary64
      :pre TRUE
      (fma x y (* z (+ 5.0 x))))
    double code(double x, double y, double z) {
    	return fma(x, y, (z * (5.0 + x)));
    }
    
    function code(x, y, z)
    	return fma(x, y, Float64(z * Float64(5.0 + x)))
    end
    
    code[x_, y_, z_] := N[(x * y + N[(z * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    f(x, y, z):
    	x in [-inf, +inf],
    	y in [-inf, +inf],
    	z in [-inf, +inf]
    code: THEORY
    BEGIN
    f(x, y, z: real): real =
    	(x * y) + (z * ((5) + x))
    END code
    \mathsf{fma}\left(x, y, z \cdot \left(5 + x\right)\right)
    
    Derivation
    1. Initial program 99.9%

      \[x \cdot \left(y + z\right) + z \cdot 5 \]
    2. Taylor expanded in z around 0

      \[\leadsto x \cdot y + z \cdot \left(5 + x\right) \]
    3. Step-by-step derivation
      1. Applied rewrites98.9%

        \[\leadsto \mathsf{fma}\left(x, y, z \cdot \left(5 + x\right)\right) \]
      2. Add Preprocessing

      Alternative 3: 98.8% accurate, 0.7× speedup?

      \[\begin{array}{l} t_0 := x \cdot \left(y + z\right)\\ \mathbf{if}\;x \leq -14298.649587223466:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 0.00053302600741813:\\ \;\;\;\;\mathsf{fma}\left(x, y, z \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
      (FPCore (x y z)
        :precision binary64
        :pre TRUE
        (let* ((t_0 (* x (+ y z))))
        (if (<= x -14298.649587223466)
          t_0
          (if (<= x 0.00053302600741813) (fma x y (* z 5.0)) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = x * (y + z);
      	double tmp;
      	if (x <= -14298.649587223466) {
      		tmp = t_0;
      	} else if (x <= 0.00053302600741813) {
      		tmp = fma(x, y, (z * 5.0));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	t_0 = Float64(x * Float64(y + z))
      	tmp = 0.0
      	if (x <= -14298.649587223466)
      		tmp = t_0;
      	elseif (x <= 0.00053302600741813)
      		tmp = fma(x, y, Float64(z * 5.0));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -14298.649587223466], t$95$0, If[LessEqual[x, 0.00053302600741813], N[(x * y + N[(z * 5.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      f(x, y, z):
      	x in [-inf, +inf],
      	y in [-inf, +inf],
      	z in [-inf, +inf]
      code: THEORY
      BEGIN
      f(x, y, z: real): real =
      	LET t_0 = (x * (y + z)) IN
      		LET tmp_1 = IF (x <= (533026007418130050134752462298592945444397628307342529296875e-63)) THEN ((x * y) + (z * (5))) ELSE t_0 ENDIF IN
      		LET tmp = IF (x <= (-14298649587223466369323432445526123046875e-36)) THEN t_0 ELSE tmp_1 ENDIF IN
      	tmp
      END code
      \begin{array}{l}
      t_0 := x \cdot \left(y + z\right)\\
      \mathbf{if}\;x \leq -14298.649587223466:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x \leq 0.00053302600741813:\\
      \;\;\;\;\mathsf{fma}\left(x, y, z \cdot 5\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -14298.649587223466 or 5.3302600741813005e-4 < x

        1. Initial program 99.9%

          \[x \cdot \left(y + z\right) + z \cdot 5 \]
        2. Taylor expanded in x around inf

          \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
        3. Step-by-step derivation
          1. Applied rewrites88.5%

            \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
          2. Taylor expanded in x around inf

            \[\leadsto x \cdot \left(y + z\right) \]
          3. Step-by-step derivation
            1. Applied rewrites64.7%

              \[\leadsto x \cdot \left(y + z\right) \]

            if -14298.649587223466 < x < 5.3302600741813005e-4

            1. Initial program 99.9%

              \[x \cdot \left(y + z\right) + z \cdot 5 \]
            2. Taylor expanded in z around 0

              \[\leadsto x \cdot y + z \cdot \left(5 + x\right) \]
            3. Step-by-step derivation
              1. Applied rewrites98.9%

                \[\leadsto \mathsf{fma}\left(x, y, z \cdot \left(5 + x\right)\right) \]
              2. Taylor expanded in x around 0

                \[\leadsto \mathsf{fma}\left(x, y, z \cdot 5\right) \]
              3. Step-by-step derivation
                1. Applied rewrites75.7%

                  \[\leadsto \mathsf{fma}\left(x, y, z \cdot 5\right) \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 4: 84.6% accurate, 0.7× speedup?

              \[\begin{array}{l} t_0 := x \cdot \left(y + z\right)\\ \mathbf{if}\;x \leq -2.8368855981903414 \cdot 10^{-51}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8858021122195.69:\\ \;\;\;\;\mathsf{fma}\left(5, z, x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
              (FPCore (x y z)
                :precision binary64
                :pre TRUE
                (let* ((t_0 (* x (+ y z))))
                (if (<= x -2.8368855981903414e-51)
                  t_0
                  (if (<= x 8858021122195.69) (fma 5.0 z (* x z)) t_0))))
              double code(double x, double y, double z) {
              	double t_0 = x * (y + z);
              	double tmp;
              	if (x <= -2.8368855981903414e-51) {
              		tmp = t_0;
              	} else if (x <= 8858021122195.69) {
              		tmp = fma(5.0, z, (x * z));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	t_0 = Float64(x * Float64(y + z))
              	tmp = 0.0
              	if (x <= -2.8368855981903414e-51)
              		tmp = t_0;
              	elseif (x <= 8858021122195.69)
              		tmp = fma(5.0, z, Float64(x * z));
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8368855981903414e-51], t$95$0, If[LessEqual[x, 8858021122195.69], N[(5.0 * z + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              f(x, y, z):
              	x in [-inf, +inf],
              	y in [-inf, +inf],
              	z in [-inf, +inf]
              code: THEORY
              BEGIN
              f(x, y, z: real): real =
              	LET t_0 = (x * (y + z)) IN
              		LET tmp_1 = IF (x <= (8858021122195689453125e-9)) THEN (((5) * z) + (x * z)) ELSE t_0 ENDIF IN
              		LET tmp = IF (x <= (-28368855981903414102920337465896913142028897505741484614367286972627935745057502704794255345263793652131194254318143559929623156480593682005064692930318415164947509765625e-220)) THEN t_0 ELSE tmp_1 ENDIF IN
              	tmp
              END code
              \begin{array}{l}
              t_0 := x \cdot \left(y + z\right)\\
              \mathbf{if}\;x \leq -2.8368855981903414 \cdot 10^{-51}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq 8858021122195.69:\\
              \;\;\;\;\mathsf{fma}\left(5, z, x \cdot z\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -2.8368855981903414e-51 or 8858021122195.6895 < x

                1. Initial program 99.9%

                  \[x \cdot \left(y + z\right) + z \cdot 5 \]
                2. Taylor expanded in x around inf

                  \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites88.5%

                    \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
                  2. Taylor expanded in x around inf

                    \[\leadsto x \cdot \left(y + z\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites64.7%

                      \[\leadsto x \cdot \left(y + z\right) \]

                    if -2.8368855981903414e-51 < x < 8858021122195.6895

                    1. Initial program 99.9%

                      \[x \cdot \left(y + z\right) + z \cdot 5 \]
                    2. Taylor expanded in y around 0

                      \[\leadsto 5 \cdot z + x \cdot z \]
                    3. Step-by-step derivation
                      1. Applied rewrites62.4%

                        \[\leadsto \mathsf{fma}\left(5, z, x \cdot z\right) \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 5: 84.3% accurate, 0.9× speedup?

                    \[\begin{array}{l} t_0 := x \cdot \left(y + z\right)\\ \mathbf{if}\;x \leq -2.8368855981903414 \cdot 10^{-51}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8858021122195.69:\\ \;\;\;\;z \cdot \left(5 + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                    (FPCore (x y z)
                      :precision binary64
                      :pre TRUE
                      (let* ((t_0 (* x (+ y z))))
                      (if (<= x -2.8368855981903414e-51)
                        t_0
                        (if (<= x 8858021122195.69) (* z (+ 5.0 x)) t_0))))
                    double code(double x, double y, double z) {
                    	double t_0 = x * (y + z);
                    	double tmp;
                    	if (x <= -2.8368855981903414e-51) {
                    		tmp = t_0;
                    	} else if (x <= 8858021122195.69) {
                    		tmp = z * (5.0 + x);
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(x, y, z)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = x * (y + z)
                        if (x <= (-2.8368855981903414d-51)) then
                            tmp = t_0
                        else if (x <= 8858021122195.69d0) then
                            tmp = z * (5.0d0 + x)
                        else
                            tmp = t_0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z) {
                    	double t_0 = x * (y + z);
                    	double tmp;
                    	if (x <= -2.8368855981903414e-51) {
                    		tmp = t_0;
                    	} else if (x <= 8858021122195.69) {
                    		tmp = z * (5.0 + x);
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z):
                    	t_0 = x * (y + z)
                    	tmp = 0
                    	if x <= -2.8368855981903414e-51:
                    		tmp = t_0
                    	elif x <= 8858021122195.69:
                    		tmp = z * (5.0 + x)
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(x, y, z)
                    	t_0 = Float64(x * Float64(y + z))
                    	tmp = 0.0
                    	if (x <= -2.8368855981903414e-51)
                    		tmp = t_0;
                    	elseif (x <= 8858021122195.69)
                    		tmp = Float64(z * Float64(5.0 + x));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z)
                    	t_0 = x * (y + z);
                    	tmp = 0.0;
                    	if (x <= -2.8368855981903414e-51)
                    		tmp = t_0;
                    	elseif (x <= 8858021122195.69)
                    		tmp = z * (5.0 + x);
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8368855981903414e-51], t$95$0, If[LessEqual[x, 8858021122195.69], N[(z * N[(5.0 + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    f(x, y, z):
                    	x in [-inf, +inf],
                    	y in [-inf, +inf],
                    	z in [-inf, +inf]
                    code: THEORY
                    BEGIN
                    f(x, y, z: real): real =
                    	LET t_0 = (x * (y + z)) IN
                    		LET tmp_1 = IF (x <= (8858021122195689453125e-9)) THEN (z * ((5) + x)) ELSE t_0 ENDIF IN
                    		LET tmp = IF (x <= (-28368855981903414102920337465896913142028897505741484614367286972627935745057502704794255345263793652131194254318143559929623156480593682005064692930318415164947509765625e-220)) THEN t_0 ELSE tmp_1 ENDIF IN
                    	tmp
                    END code
                    \begin{array}{l}
                    t_0 := x \cdot \left(y + z\right)\\
                    \mathbf{if}\;x \leq -2.8368855981903414 \cdot 10^{-51}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;x \leq 8858021122195.69:\\
                    \;\;\;\;z \cdot \left(5 + x\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if x < -2.8368855981903414e-51 or 8858021122195.6895 < x

                      1. Initial program 99.9%

                        \[x \cdot \left(y + z\right) + z \cdot 5 \]
                      2. Taylor expanded in x around inf

                        \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites88.5%

                          \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
                        2. Taylor expanded in x around inf

                          \[\leadsto x \cdot \left(y + z\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites64.7%

                            \[\leadsto x \cdot \left(y + z\right) \]

                          if -2.8368855981903414e-51 < x < 8858021122195.6895

                          1. Initial program 99.9%

                            \[x \cdot \left(y + z\right) + z \cdot 5 \]
                          2. Taylor expanded in z around inf

                            \[\leadsto z \cdot \left(5 + x\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites62.4%

                              \[\leadsto z \cdot \left(5 + x\right) \]
                          4. Recombined 2 regimes into one program.
                          5. Add Preprocessing

                          Alternative 6: 84.3% accurate, 0.9× speedup?

                          \[\begin{array}{l} t_0 := x \cdot \left(y + z\right)\\ \mathbf{if}\;x \leq -2.8368855981903414 \cdot 10^{-51}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 9.957315309628584 \cdot 10^{-34}:\\ \;\;\;\;5 \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                          (FPCore (x y z)
                            :precision binary64
                            :pre TRUE
                            (let* ((t_0 (* x (+ y z))))
                            (if (<= x -2.8368855981903414e-51)
                              t_0
                              (if (<= x 9.957315309628584e-34) (* 5.0 z) t_0))))
                          double code(double x, double y, double z) {
                          	double t_0 = x * (y + z);
                          	double tmp;
                          	if (x <= -2.8368855981903414e-51) {
                          		tmp = t_0;
                          	} else if (x <= 9.957315309628584e-34) {
                          		tmp = 5.0 * z;
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, y, z)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8) :: t_0
                              real(8) :: tmp
                              t_0 = x * (y + z)
                              if (x <= (-2.8368855981903414d-51)) then
                                  tmp = t_0
                              else if (x <= 9.957315309628584d-34) then
                                  tmp = 5.0d0 * z
                              else
                                  tmp = t_0
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z) {
                          	double t_0 = x * (y + z);
                          	double tmp;
                          	if (x <= -2.8368855981903414e-51) {
                          		tmp = t_0;
                          	} else if (x <= 9.957315309628584e-34) {
                          		tmp = 5.0 * z;
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z):
                          	t_0 = x * (y + z)
                          	tmp = 0
                          	if x <= -2.8368855981903414e-51:
                          		tmp = t_0
                          	elif x <= 9.957315309628584e-34:
                          		tmp = 5.0 * z
                          	else:
                          		tmp = t_0
                          	return tmp
                          
                          function code(x, y, z)
                          	t_0 = Float64(x * Float64(y + z))
                          	tmp = 0.0
                          	if (x <= -2.8368855981903414e-51)
                          		tmp = t_0;
                          	elseif (x <= 9.957315309628584e-34)
                          		tmp = Float64(5.0 * z);
                          	else
                          		tmp = t_0;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z)
                          	t_0 = x * (y + z);
                          	tmp = 0.0;
                          	if (x <= -2.8368855981903414e-51)
                          		tmp = t_0;
                          	elseif (x <= 9.957315309628584e-34)
                          		tmp = 5.0 * z;
                          	else
                          		tmp = t_0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8368855981903414e-51], t$95$0, If[LessEqual[x, 9.957315309628584e-34], N[(5.0 * z), $MachinePrecision], t$95$0]]]
                          
                          f(x, y, z):
                          	x in [-inf, +inf],
                          	y in [-inf, +inf],
                          	z in [-inf, +inf]
                          code: THEORY
                          BEGIN
                          f(x, y, z: real): real =
                          	LET t_0 = (x * (y + z)) IN
                          		LET tmp_1 = IF (x <= (995731530962858429324473884117268777133337992305983115666935440622549596510538661930608296535272216942757950164377689361572265625e-162)) THEN ((5) * z) ELSE t_0 ENDIF IN
                          		LET tmp = IF (x <= (-28368855981903414102920337465896913142028897505741484614367286972627935745057502704794255345263793652131194254318143559929623156480593682005064692930318415164947509765625e-220)) THEN t_0 ELSE tmp_1 ENDIF IN
                          	tmp
                          END code
                          \begin{array}{l}
                          t_0 := x \cdot \left(y + z\right)\\
                          \mathbf{if}\;x \leq -2.8368855981903414 \cdot 10^{-51}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;x \leq 9.957315309628584 \cdot 10^{-34}:\\
                          \;\;\;\;5 \cdot z\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_0\\
                          
                          
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -2.8368855981903414e-51 or 9.9573153096285843e-34 < x

                            1. Initial program 99.9%

                              \[x \cdot \left(y + z\right) + z \cdot 5 \]
                            2. Taylor expanded in x around inf

                              \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites88.5%

                                \[\leadsto x \cdot \left(y + \left(z + 5 \cdot \frac{z}{x}\right)\right) \]
                              2. Taylor expanded in x around inf

                                \[\leadsto x \cdot \left(y + z\right) \]
                              3. Step-by-step derivation
                                1. Applied rewrites64.7%

                                  \[\leadsto x \cdot \left(y + z\right) \]

                                if -2.8368855981903414e-51 < x < 9.9573153096285843e-34

                                1. Initial program 99.9%

                                  \[x \cdot \left(y + z\right) + z \cdot 5 \]
                                2. Taylor expanded in x around 0

                                  \[\leadsto 5 \cdot z \]
                                3. Step-by-step derivation
                                  1. Applied rewrites36.9%

                                    \[\leadsto 5 \cdot z \]
                                4. Recombined 2 regimes into one program.
                                5. Add Preprocessing

                                Alternative 7: 36.9% accurate, 3.0× speedup?

                                \[5 \cdot z \]
                                (FPCore (x y z)
                                  :precision binary64
                                  :pre TRUE
                                  (* 5.0 z))
                                double code(double x, double y, double z) {
                                	return 5.0 * z;
                                }
                                
                                real(8) function code(x, y, z)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    code = 5.0d0 * z
                                end function
                                
                                public static double code(double x, double y, double z) {
                                	return 5.0 * z;
                                }
                                
                                def code(x, y, z):
                                	return 5.0 * z
                                
                                function code(x, y, z)
                                	return Float64(5.0 * z)
                                end
                                
                                function tmp = code(x, y, z)
                                	tmp = 5.0 * z;
                                end
                                
                                code[x_, y_, z_] := N[(5.0 * z), $MachinePrecision]
                                
                                f(x, y, z):
                                	x in [-inf, +inf],
                                	y in [-inf, +inf],
                                	z in [-inf, +inf]
                                code: THEORY
                                BEGIN
                                f(x, y, z: real): real =
                                	(5) * z
                                END code
                                5 \cdot z
                                
                                Derivation
                                1. Initial program 99.9%

                                  \[x \cdot \left(y + z\right) + z \cdot 5 \]
                                2. Taylor expanded in x around 0

                                  \[\leadsto 5 \cdot z \]
                                3. Step-by-step derivation
                                  1. Applied rewrites36.9%

                                    \[\leadsto 5 \cdot z \]
                                  2. Add Preprocessing

                                  Reproduce

                                  ?
                                  herbie shell --seed 2026092 
                                  (FPCore (x y z)
                                    :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
                                    :precision binary64
                                    (+ (* x (+ y z)) (* z 5.0)))