
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -7.4e-12) (fma y (- t x) x) (if (<= y 2.2e+19) (fma z (- x t) x) (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.4e-12) {
tmp = fma(y, (t - x), x);
} else if (y <= 2.2e+19) {
tmp = fma(z, (x - t), x);
} else {
tmp = y * (t - x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -7.4e-12) tmp = fma(y, Float64(t - x), x); elseif (y <= 2.2e+19) tmp = fma(z, Float64(x - t), x); else tmp = Float64(y * Float64(t - x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.4e-12], N[(y * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.2e+19], N[(z * N[(x - t), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(y, t - x, x\right)\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(z, x - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < -7.39999999999999997e-12Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6484.1
Simplified84.1%
if -7.39999999999999997e-12 < y < 2.2e19Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6490.6
Simplified90.6%
if 2.2e19 < y Initial program 100.0%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6486.7
Simplified86.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -7800000000000.0) t_1 (if (<= z 9.5e+29) (fma y (- t x) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -7800000000000.0) {
tmp = t_1;
} else if (z <= 9.5e+29) {
tmp = fma(y, (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -7800000000000.0) tmp = t_1; elseif (z <= 9.5e+29) tmp = fma(y, Float64(t - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7800000000000.0], t$95$1, If[LessEqual[z, 9.5e+29], N[(y * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -7800000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(y, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.8e12 or 9.5000000000000003e29 < z Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6479.6
Simplified79.6%
if -7.8e12 < z < 9.5000000000000003e29Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6489.3
Simplified89.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (- t x)))) (if (<= y -260000000.0) t_1 (if (<= y 6.5e+19) (* z (- x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -260000000.0) {
tmp = t_1;
} else if (y <= 6.5e+19) {
tmp = z * (x - 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 = y * (t - x)
if (y <= (-260000000.0d0)) then
tmp = t_1
else if (y <= 6.5d+19) then
tmp = z * (x - 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 = y * (t - x);
double tmp;
if (y <= -260000000.0) {
tmp = t_1;
} else if (y <= 6.5e+19) {
tmp = z * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -260000000.0: tmp = t_1 elif y <= 6.5e+19: tmp = z * (x - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -260000000.0) tmp = t_1; elseif (y <= 6.5e+19) tmp = Float64(z * Float64(x - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -260000000.0) tmp = t_1; elseif (y <= 6.5e+19) tmp = z * (x - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -260000000.0], t$95$1, If[LessEqual[y, 6.5e+19], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -260000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+19}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.6e8 or 6.5e19 < y Initial program 100.0%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.8
Applied egg-rr99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6485.8
Simplified85.8%
if -2.6e8 < y < 6.5e19Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6467.0
Simplified67.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (- t x)))) (if (<= y -0.245) t_1 (if (<= y 0.41) (fma z x x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -0.245) {
tmp = t_1;
} else if (y <= 0.41) {
tmp = fma(z, x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -0.245) tmp = t_1; elseif (y <= 0.41) tmp = fma(z, x, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.245], t$95$1, If[LessEqual[y, 0.41], N[(z * x + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -0.245:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.41:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -0.245 or 0.409999999999999976 < y Initial program 100.0%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.8
Applied egg-rr99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6482.5
Simplified82.5%
if -0.245 < y < 0.409999999999999976Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6490.9
Simplified90.9%
Taylor expanded in x around inf
Simplified53.2%
(FPCore (x y z t) :precision binary64 (if (<= t -0.048) (fma y t x) (if (<= t 2.1e-12) (* x (- 1.0 y)) (fma y t x))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.048) {
tmp = fma(y, t, x);
} else if (t <= 2.1e-12) {
tmp = x * (1.0 - y);
} else {
tmp = fma(y, t, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -0.048) tmp = fma(y, t, x); elseif (t <= 2.1e-12) tmp = Float64(x * Float64(1.0 - y)); else tmp = fma(y, t, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.048], N[(y * t + x), $MachinePrecision], If[LessEqual[t, 2.1e-12], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(y * t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.048:\\
\;\;\;\;\mathsf{fma}\left(y, t, x\right)\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, t, x\right)\\
\end{array}
\end{array}
if t < -0.048000000000000001 or 2.09999999999999994e-12 < t Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6459.0
Simplified59.0%
Taylor expanded in t around inf
Simplified55.1%
if -0.048000000000000001 < t < 2.09999999999999994e-12Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6461.3
Simplified61.3%
Taylor expanded in t around 0
*-rgt-identityN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6453.7
Simplified53.7%
(FPCore (x y z t) :precision binary64 (if (<= z -7.2e+56) (* x z) (if (<= z 1.9e+135) (fma y t x) (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.2e+56) {
tmp = x * z;
} else if (z <= 1.9e+135) {
tmp = fma(y, t, x);
} else {
tmp = x * z;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -7.2e+56) tmp = Float64(x * z); elseif (z <= 1.9e+135) tmp = fma(y, t, x); else tmp = Float64(x * z); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.2e+56], N[(x * z), $MachinePrecision], If[LessEqual[z, 1.9e+135], N[(y * t + x), $MachinePrecision], N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+56}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(y, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -7.19999999999999996e56 or 1.9000000000000001e135 < z Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6485.3
Simplified85.3%
Taylor expanded in x around inf
Simplified46.7%
if -7.19999999999999996e56 < z < 1.9000000000000001e135Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6479.4
Simplified79.4%
Taylor expanded in t around inf
Simplified53.1%
Final simplification50.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.6e+57) (* x z) (if (<= z 8.5e+134) (* y t) (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+57) {
tmp = x * z;
} else if (z <= 8.5e+134) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.6d+57)) then
tmp = x * z
else if (z <= 8.5d+134) then
tmp = y * t
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+57) {
tmp = x * z;
} else if (z <= 8.5e+134) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e+57: tmp = x * z elif z <= 8.5e+134: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e+57) tmp = Float64(x * z); elseif (z <= 8.5e+134) tmp = Float64(y * t); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.6e+57) tmp = x * z; elseif (z <= 8.5e+134) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e+57], N[(x * z), $MachinePrecision], If[LessEqual[z, 8.5e+134], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+57}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+134}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -1.60000000000000015e57 or 8.50000000000000024e134 < z Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6485.3
Simplified85.3%
Taylor expanded in x around inf
Simplified46.7%
if -1.60000000000000015e57 < z < 8.50000000000000024e134Initial program 100.0%
Taylor expanded in x around 0
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6452.8
Simplified52.8%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6435.1
Simplified35.1%
Final simplification39.2%
(FPCore (x y z t) :precision binary64 (if (<= y -4.3e-39) (* y t) (if (<= y 1e-5) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e-39) {
tmp = y * t;
} else if (y <= 1e-5) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.3d-39)) then
tmp = y * t
else if (y <= 1d-5) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e-39) {
tmp = y * t;
} else if (y <= 1e-5) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.3e-39: tmp = y * t elif y <= 1e-5: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.3e-39) tmp = Float64(y * t); elseif (y <= 1e-5) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.3e-39) tmp = y * t; elseif (y <= 1e-5) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.3e-39], N[(y * t), $MachinePrecision], If[LessEqual[y, 1e-5], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-39}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -4.2999999999999999e-39 or 1.00000000000000008e-5 < y Initial program 100.0%
Taylor expanded in x around 0
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6455.1
Simplified55.1%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6444.2
Simplified44.2%
if -4.2999999999999999e-39 < y < 1.00000000000000008e-5Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6434.0
Simplified34.0%
Taylor expanded in y around 0
Simplified27.1%
(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}
Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6460.1
Simplified60.1%
Taylor expanded in y around 0
Simplified13.8%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (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 * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024198
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
(+ x (* (- y z) (- t x))))