Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23

Percentage Accurate: 99.9% → 99.9%
Time: 4.7s
Alternatives: 6
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 6 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?

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

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

Alternative 1: 99.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (fma y x z) y t))
double code(double x, double y, double z, double t) {
	return fma(fma(y, x, z), y, t);
}
function code(x, y, z, t)
	return fma(fma(y, x, z), y, t)
end
code[x_, y_, z_, t_] := N[(N[(y * x + z), $MachinePrecision] * y + t), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, t\right)
\end{array}
Derivation
  1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot y + z\right) \cdot y} + t \]
    3. lower-fma.f6499.9

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot x} + z, y, t\right) \]
    7. lower-fma.f6499.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(y, x, z\right)}, y, t\right) \]
  4. Applied rewrites99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, t\right)} \]
  5. Add Preprocessing

Alternative 2: 90.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + z\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+143} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+60}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (+ (* x y) z) y)))
   (if (or (<= t_1 -1e+143) (not (<= t_1 5e+60)))
     (* (fma y x z) y)
     (fma z y t))))
double code(double x, double y, double z, double t) {
	double t_1 = ((x * y) + z) * y;
	double tmp;
	if ((t_1 <= -1e+143) || !(t_1 <= 5e+60)) {
		tmp = fma(y, x, z) * y;
	} else {
		tmp = fma(z, y, t);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(x * y) + z) * y)
	tmp = 0.0
	if ((t_1 <= -1e+143) || !(t_1 <= 5e+60))
		tmp = Float64(fma(y, x, z) * y);
	else
		tmp = fma(z, y, t);
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+143], N[Not[LessEqual[t$95$1, 5e+60]], $MachinePrecision]], N[(N[(y * x + z), $MachinePrecision] * y), $MachinePrecision], N[(z * y + t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot y + z\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+143} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+60}\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, z\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (+.f64 (*.f64 x y) z) y) < -1e143 or 4.99999999999999975e60 < (*.f64 (+.f64 (*.f64 x y) z) y)

    1. Initial program 99.9%

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

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

        \[\leadsto {y}^{2} \cdot \color{blue}{\left(\frac{z}{y} + x\right)} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{{y}^{2} \cdot \frac{z}{y} + {y}^{2} \cdot x} \]
    5. Applied rewrites93.9%

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

    if -1e143 < (*.f64 (+.f64 (*.f64 x y) z) y) < 4.99999999999999975e60

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{z \cdot y} + t \]
      3. lower-fma.f6493.6

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    5. Applied rewrites93.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + z\right) \cdot y \leq -1 \cdot 10^{+143} \lor \neg \left(\left(x \cdot y + z\right) \cdot y \leq 5 \cdot 10^{+60}\right):\\ \;\;\;\;\mathsf{fma}\left(y, x, z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + z\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+143} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+284}\right):\\ \;\;\;\;\left(x \cdot y\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (+ (* x y) z) y)))
   (if (or (<= t_1 -1e+143) (not (<= t_1 4e+284))) (* (* x y) y) (fma z y t))))
double code(double x, double y, double z, double t) {
	double t_1 = ((x * y) + z) * y;
	double tmp;
	if ((t_1 <= -1e+143) || !(t_1 <= 4e+284)) {
		tmp = (x * y) * y;
	} else {
		tmp = fma(z, y, t);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(x * y) + z) * y)
	tmp = 0.0
	if ((t_1 <= -1e+143) || !(t_1 <= 4e+284))
		tmp = Float64(Float64(x * y) * y);
	else
		tmp = fma(z, y, t);
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+143], N[Not[LessEqual[t$95$1, 4e+284]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision], N[(z * y + t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot y + z\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+143} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+284}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (+.f64 (*.f64 x y) z) y) < -1e143 or 4.00000000000000032e284 < (*.f64 (+.f64 (*.f64 x y) z) y)

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(x \cdot y + z\right) \cdot y} + t \]
      3. lower-fma.f6499.9

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot x} + z, y, t\right) \]
      7. lower-fma.f6499.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(y, x, z\right)}, y, t\right) \]
    4. Applied rewrites99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, t\right)} \]
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{{y}^{2} \cdot x} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{{y}^{2} \cdot x} \]
      3. unpow2N/A

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot x \]
      4. lower-*.f6474.4

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot x \]
    7. Applied rewrites74.4%

      \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot x} \]
    8. Step-by-step derivation
      1. Applied rewrites77.9%

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

      if -1e143 < (*.f64 (+.f64 (*.f64 x y) z) y) < 4.00000000000000032e284

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{z \cdot y} + t \]
        3. lower-fma.f6487.7

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
      5. Applied rewrites87.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    9. Recombined 2 regimes into one program.
    10. Final simplification83.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + z\right) \cdot y \leq -1 \cdot 10^{+143} \lor \neg \left(\left(x \cdot y + z\right) \cdot y \leq 4 \cdot 10^{+284}\right):\\ \;\;\;\;\left(x \cdot y\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 4: 81.1% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + z\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+225} \lor \neg \left(t\_1 \leq 10^{+296}\right):\\ \;\;\;\;\left(y \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* (+ (* x y) z) y)))
       (if (or (<= t_1 -1e+225) (not (<= t_1 1e+296))) (* (* y y) x) (fma z y t))))
    double code(double x, double y, double z, double t) {
    	double t_1 = ((x * y) + z) * y;
    	double tmp;
    	if ((t_1 <= -1e+225) || !(t_1 <= 1e+296)) {
    		tmp = (y * y) * x;
    	} else {
    		tmp = fma(z, y, t);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(Float64(x * y) + z) * y)
    	tmp = 0.0
    	if ((t_1 <= -1e+225) || !(t_1 <= 1e+296))
    		tmp = Float64(Float64(y * y) * x);
    	else
    		tmp = fma(z, y, t);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+225], N[Not[LessEqual[t$95$1, 1e+296]], $MachinePrecision]], N[(N[(y * y), $MachinePrecision] * x), $MachinePrecision], N[(z * y + t), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(x \cdot y + z\right) \cdot y\\
    \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+225} \lor \neg \left(t\_1 \leq 10^{+296}\right):\\
    \;\;\;\;\left(y \cdot y\right) \cdot x\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (+.f64 (*.f64 x y) z) y) < -9.99999999999999928e224 or 9.99999999999999981e295 < (*.f64 (+.f64 (*.f64 x y) z) y)

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{x \cdot {y}^{2}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{{y}^{2} \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{{y}^{2} \cdot x} \]
        3. unpow2N/A

          \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot x \]
        4. lower-*.f6482.3

          \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot x \]
      5. Applied rewrites82.3%

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

      if -9.99999999999999928e224 < (*.f64 (+.f64 (*.f64 x y) z) y) < 9.99999999999999981e295

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{z \cdot y} + t \]
        3. lower-fma.f6483.5

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
      5. Applied rewrites83.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification83.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + z\right) \cdot y \leq -1 \cdot 10^{+225} \lor \neg \left(\left(x \cdot y + z\right) \cdot y \leq 10^{+296}\right):\\ \;\;\;\;\left(y \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 66.3% accurate, 2.4× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(z, y, t\right) \end{array} \]
    (FPCore (x y z t) :precision binary64 (fma z y t))
    double code(double x, double y, double z, double t) {
    	return fma(z, y, t);
    }
    
    function code(x, y, z, t)
    	return fma(z, y, t)
    end
    
    code[x_, y_, z_, t_] := N[(z * y + t), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \mathsf{fma}\left(z, y, t\right)
    \end{array}
    
    Derivation
    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{z \cdot y} + t \]
      3. lower-fma.f6467.0

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    5. Applied rewrites67.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    6. Add Preprocessing

    Alternative 6: 29.5% accurate, 2.8× speedup?

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

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

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

        \[\leadsto {y}^{2} \cdot \color{blue}{\left(\frac{z}{y} + x\right)} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{{y}^{2} \cdot \frac{z}{y} + {y}^{2} \cdot x} \]
    5. Applied rewrites59.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, z\right) \cdot y} \]
    6. Taylor expanded in x around 0

      \[\leadsto y \cdot \color{blue}{z} \]
    7. Step-by-step derivation
      1. Applied rewrites26.9%

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

      Reproduce

      ?
      herbie shell --seed 2024320 
      (FPCore (x y z t)
        :name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
        :precision binary64
        (+ (* (+ (* x y) z) y) t))