
(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 (fma (- t x) (- y z) x))
double code(double x, double y, double z, double t) {
return fma((t - x), (y - z), x);
}
function code(x, y, z, t) return fma(Float64(t - x), Float64(y - z), x) end
code[x_, y_, z_, t_] := N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t - x, y - z, x\right)
\end{array}
Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-rgt-identityN/A
associate-+l+N/A
+-commutativeN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
distribute-rgt-out--N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64100.0
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t x) y)))
(if (<= y -3.2e-13)
t_1
(if (<= y 1.06e-150)
(fma x z x)
(if (<= y 92000000000.0) (* z (- x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (t - x) * y;
double tmp;
if (y <= -3.2e-13) {
tmp = t_1;
} else if (y <= 1.06e-150) {
tmp = fma(x, z, x);
} else if (y <= 92000000000.0) {
tmp = z * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(t - x) * y) tmp = 0.0 if (y <= -3.2e-13) tmp = t_1; elseif (y <= 1.06e-150) tmp = fma(x, z, x); elseif (y <= 92000000000.0) tmp = Float64(z * Float64(x - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.2e-13], t$95$1, If[LessEqual[y, 1.06e-150], N[(x * z + x), $MachinePrecision], If[LessEqual[y, 92000000000.0], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot y\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{-150}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{elif}\;y \leq 92000000000:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2e-13 or 9.2e10 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.7
Simplified78.7%
if -3.2e-13 < y < 1.05999999999999996e-150Initial program 100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6473.4
Simplified73.4%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6473.4
Simplified73.4%
if 1.05999999999999996e-150 < y < 9.2e10Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6468.4
Simplified68.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))))
(if (<= y -2.2e+263)
(* t y)
(if (<= y -1.55e+142) t_1 (if (<= y 0.72) (fma x z x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (y <= -2.2e+263) {
tmp = t * y;
} else if (y <= -1.55e+142) {
tmp = t_1;
} else if (y <= 0.72) {
tmp = fma(x, z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -2.2e+263) tmp = Float64(t * y); elseif (y <= -1.55e+142) tmp = t_1; elseif (y <= 0.72) tmp = fma(x, z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -2.2e+263], N[(t * y), $MachinePrecision], If[LessEqual[y, -1.55e+142], t$95$1, If[LessEqual[y, 0.72], N[(x * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+263}:\\
\;\;\;\;t \cdot y\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.72:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e263Initial program 99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6468.2
Simplified68.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6467.5
Simplified67.5%
if -2.2e263 < y < -1.55e142 or 0.71999999999999997 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6483.3
Simplified83.3%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6450.3
Simplified50.3%
if -1.55e142 < y < 0.71999999999999997Initial program 100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6464.5
Simplified64.5%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6460.8
Simplified60.8%
Final simplification57.5%
(FPCore (x y z t) :precision binary64 (if (<= x -0.000105) (fma x z x) (if (<= x -6e-100) (* t y) (if (<= x 1.26e-48) (- (* t z)) (fma x z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.000105) {
tmp = fma(x, z, x);
} else if (x <= -6e-100) {
tmp = t * y;
} else if (x <= 1.26e-48) {
tmp = -(t * z);
} else {
tmp = fma(x, z, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -0.000105) tmp = fma(x, z, x); elseif (x <= -6e-100) tmp = Float64(t * y); elseif (x <= 1.26e-48) tmp = Float64(-Float64(t * z)); else tmp = fma(x, z, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.000105], N[(x * z + x), $MachinePrecision], If[LessEqual[x, -6e-100], N[(t * y), $MachinePrecision], If[LessEqual[x, 1.26e-48], (-N[(t * z), $MachinePrecision]), N[(x * z + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000105:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-100}:\\
\;\;\;\;t \cdot y\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{-48}:\\
\;\;\;\;-t \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\end{array}
\end{array}
if x < -1.05e-4 or 1.2599999999999999e-48 < x Initial program 100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6484.7
Simplified84.7%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6460.9
Simplified60.9%
if -1.05e-4 < x < -6.0000000000000001e-100Initial program 100.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6459.6
Simplified59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6446.0
Simplified46.0%
if -6.0000000000000001e-100 < x < 1.2599999999999999e-48Initial program 99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6477.9
Simplified77.9%
Taylor expanded in y around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6447.7
Simplified47.7%
Final simplification55.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -6e+102) t_1 (if (<= z 9e+22) (fma (- t x) y x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -6e+102) {
tmp = t_1;
} else if (z <= 9e+22) {
tmp = fma((t - x), y, 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 <= -6e+102) tmp = t_1; elseif (z <= 9e+22) tmp = fma(Float64(t - x), y, 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, -6e+102], t$95$1, If[LessEqual[z, 9e+22], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.9999999999999996e102 or 8.9999999999999996e22 < z Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6483.6
Simplified83.6%
if -5.9999999999999996e102 < z < 8.9999999999999996e22Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6488.7
Simplified88.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma x (- z y) x))) (if (<= x -2.7e-5) t_1 (if (<= x 1.22e-17) (* t (- y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, (z - y), x);
double tmp;
if (x <= -2.7e-5) {
tmp = t_1;
} else if (x <= 1.22e-17) {
tmp = t * (y - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, Float64(z - y), x) tmp = 0.0 if (x <= -2.7e-5) tmp = t_1; elseif (x <= 1.22e-17) tmp = Float64(t * Float64(y - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z - y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[x, -2.7e-5], t$95$1, If[LessEqual[x, 1.22e-17], N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, z - y, x\right)\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-17}:\\
\;\;\;\;t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.6999999999999999e-5 or 1.22e-17 < x Initial program 100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6487.6
Simplified87.6%
if -2.6999999999999999e-5 < x < 1.22e-17Initial program 100.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6474.0
Simplified74.0%
(FPCore (x y z t) :precision binary64 (if (<= x -0.00038) (fma x z x) (if (<= x 4.5e+45) (* t (- y z)) (fma x z x))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.00038) {
tmp = fma(x, z, x);
} else if (x <= 4.5e+45) {
tmp = t * (y - z);
} else {
tmp = fma(x, z, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -0.00038) tmp = fma(x, z, x); elseif (x <= 4.5e+45) tmp = Float64(t * Float64(y - z)); else tmp = fma(x, z, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.00038], N[(x * z + x), $MachinePrecision], If[LessEqual[x, 4.5e+45], N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x * z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00038:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\end{array}
\end{array}
if x < -3.8000000000000002e-4 or 4.4999999999999998e45 < x Initial program 100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6490.7
Simplified90.7%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6465.4
Simplified65.4%
if -3.8000000000000002e-4 < x < 4.4999999999999998e45Initial program 100.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6470.6
Simplified70.6%
(FPCore (x y z t) :precision binary64 (if (<= y -3.7e+116) (* t y) (if (<= y 1.5e-27) (fma x z x) (* t y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.7e+116) {
tmp = t * y;
} else if (y <= 1.5e-27) {
tmp = fma(x, z, x);
} else {
tmp = t * y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3.7e+116) tmp = Float64(t * y); elseif (y <= 1.5e-27) tmp = fma(x, z, x); else tmp = Float64(t * y); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.7e+116], N[(t * y), $MachinePrecision], If[LessEqual[y, 1.5e-27], N[(x * z + x), $MachinePrecision], N[(t * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+116}:\\
\;\;\;\;t \cdot y\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot y\\
\end{array}
\end{array}
if y < -3.7000000000000001e116 or 1.5000000000000001e-27 < y Initial program 100.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6454.7
Simplified54.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6441.5
Simplified41.5%
if -3.7000000000000001e116 < y < 1.5000000000000001e-27Initial program 100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6466.8
Simplified66.8%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6462.8
Simplified62.8%
Final simplification53.0%
(FPCore (x y z t) :precision binary64 (if (<= x -0.000105) (* x z) (if (<= x 4.5e+45) (* t y) (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.000105) {
tmp = x * z;
} else if (x <= 4.5e+45) {
tmp = t * y;
} 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 (x <= (-0.000105d0)) then
tmp = x * z
else if (x <= 4.5d+45) then
tmp = t * y
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 (x <= -0.000105) {
tmp = x * z;
} else if (x <= 4.5e+45) {
tmp = t * y;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.000105: tmp = x * z elif x <= 4.5e+45: tmp = t * y else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.000105) tmp = Float64(x * z); elseif (x <= 4.5e+45) tmp = Float64(t * y); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -0.000105) tmp = x * z; elseif (x <= 4.5e+45) tmp = t * y; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.000105], N[(x * z), $MachinePrecision], If[LessEqual[x, 4.5e+45], N[(t * y), $MachinePrecision], N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000105:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;t \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if x < -1.05e-4 or 4.4999999999999998e45 < x Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6443.3
Simplified43.3%
Taylor expanded in x around inf
lower-*.f6440.1
Simplified40.1%
if -1.05e-4 < x < 4.4999999999999998e45Initial program 100.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f6470.6
Simplified70.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6438.5
Simplified38.5%
Final simplification39.3%
(FPCore (x y z t) :precision binary64 (* x z))
double code(double x, double y, double z, double t) {
return x * 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 * z
end function
public static double code(double x, double y, double z, double t) {
return x * z;
}
def code(x, y, z, t): return x * z
function code(x, y, z, t) return Float64(x * z) end
function tmp = code(x, y, z, t) tmp = x * z; end
code[x_, y_, z_, t_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6445.8
Simplified45.8%
Taylor expanded in x around inf
lower-*.f6425.5
Simplified25.5%
(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 2024215
(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))))