
(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 (+ (* (- t x) (- y z)) x))
double code(double x, double y, double z, double t) {
return ((t - x) * (y - 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 = ((t - x) * (y - z)) + x
end function
public static double code(double x, double y, double z, double t) {
return ((t - x) * (y - z)) + x;
}
def code(x, y, z, t): return ((t - x) * (y - z)) + x
function code(x, y, z, t) return Float64(Float64(Float64(t - x) * Float64(y - z)) + x) end
function tmp = code(x, y, z, t) tmp = ((t - x) * (y - z)) + x; end
code[x_, y_, z_, t_] := N[(N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(t - x\right) \cdot \left(y - z\right) + x
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t x) y)))
(if (<= y -5.4e+24)
t_1
(if (<= y -1e-142)
(fma z x x)
(if (<= y -1.35e-242)
(* (- x t) z)
(if (<= y 4.55e-7) (fma z x x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (t - x) * y;
double tmp;
if (y <= -5.4e+24) {
tmp = t_1;
} else if (y <= -1e-142) {
tmp = fma(z, x, x);
} else if (y <= -1.35e-242) {
tmp = (x - t) * z;
} else if (y <= 4.55e-7) {
tmp = fma(z, x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(t - x) * y) tmp = 0.0 if (y <= -5.4e+24) tmp = t_1; elseif (y <= -1e-142) tmp = fma(z, x, x); elseif (y <= -1.35e-242) tmp = Float64(Float64(x - t) * z); elseif (y <= 4.55e-7) tmp = fma(z, x, x); 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, -5.4e+24], t$95$1, If[LessEqual[y, -1e-142], N[(z * x + x), $MachinePrecision], If[LessEqual[y, -1.35e-242], N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[y, 4.55e-7], N[(z * x + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot y\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-142}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-242}:\\
\;\;\;\;\left(x - t\right) \cdot z\\
\mathbf{elif}\;y \leq 4.55 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.4e24 or 4.5499999999999998e-7 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.9
Applied rewrites77.9%
if -5.4e24 < y < -1e-142 or -1.35e-242 < y < 4.5499999999999998e-7Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/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--.f6488.7
Applied rewrites88.7%
Taylor expanded in t around 0
Applied rewrites65.1%
if -1e-142 < y < -1.35e-242Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/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--.f6480.0
Applied rewrites80.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t x) y)))
(if (<= y -9.5e+66)
t_1
(if (<= y -2.5e-12)
(* (- x t) z)
(if (<= y 116.0) (fma (- t) z x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (t - x) * y;
double tmp;
if (y <= -9.5e+66) {
tmp = t_1;
} else if (y <= -2.5e-12) {
tmp = (x - t) * z;
} else if (y <= 116.0) {
tmp = fma(-t, z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(t - x) * y) tmp = 0.0 if (y <= -9.5e+66) tmp = t_1; elseif (y <= -2.5e-12) tmp = Float64(Float64(x - t) * z); elseif (y <= 116.0) tmp = fma(Float64(-t), z, x); 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, -9.5e+66], t$95$1, If[LessEqual[y, -2.5e-12], N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[y, 116.0], N[((-t) * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot y\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-12}:\\
\;\;\;\;\left(x - t\right) \cdot z\\
\mathbf{elif}\;y \leq 116:\\
\;\;\;\;\mathsf{fma}\left(-t, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.50000000000000051e66 or 116 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6482.9
Applied rewrites82.9%
if -9.50000000000000051e66 < y < -2.49999999999999985e-12Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/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--.f6466.8
Applied rewrites66.8%
if -2.49999999999999985e-12 < y < 116Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/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--.f6489.2
Applied rewrites89.2%
Taylor expanded in t around inf
Applied rewrites70.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- x t) z x)))
(if (<= z -1400000000000.0)
t_1
(if (<= z 1.15e+41) (fma (- t x) y x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma((x - t), z, x);
double tmp;
if (z <= -1400000000000.0) {
tmp = t_1;
} else if (z <= 1.15e+41) {
tmp = fma((t - x), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(x - t), z, x) tmp = 0.0 if (z <= -1400000000000.0) tmp = t_1; elseif (z <= 1.15e+41) 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[(N[(x - t), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[z, -1400000000000.0], t$95$1, If[LessEqual[z, 1.15e+41], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - t, z, x\right)\\
\mathbf{if}\;z \leq -1400000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.4e12 or 1.1499999999999999e41 < z Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/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--.f6485.0
Applied rewrites85.0%
if -1.4e12 < z < 1.1499999999999999e41Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6489.2
Applied rewrites89.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x t) z)))
(if (<= z -1500000000000.0)
t_1
(if (<= z 1.15e+41) (fma (- t x) y x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x - t) * z;
double tmp;
if (z <= -1500000000000.0) {
tmp = t_1;
} else if (z <= 1.15e+41) {
tmp = fma((t - x), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - t) * z) tmp = 0.0 if (z <= -1500000000000.0) tmp = t_1; elseif (z <= 1.15e+41) 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[(N[(x - t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1500000000000.0], t$95$1, If[LessEqual[z, 1.15e+41], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - t\right) \cdot z\\
\mathbf{if}\;z \leq -1500000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5e12 or 1.1499999999999999e41 < z Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/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--.f6484.9
Applied rewrites84.9%
if -1.5e12 < z < 1.1499999999999999e41Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6489.2
Applied rewrites89.2%
(FPCore (x y z t) :precision binary64 (if (<= x -0.0035) (fma z x x) (if (<= x 0.2) (* t (- y z)) (fma z x x))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.0035) {
tmp = fma(z, x, x);
} else if (x <= 0.2) {
tmp = t * (y - z);
} else {
tmp = fma(z, x, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -0.0035) tmp = fma(z, x, x); elseif (x <= 0.2) tmp = Float64(t * Float64(y - z)); else tmp = fma(z, x, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.0035], N[(z * x + x), $MachinePrecision], If[LessEqual[x, 0.2], N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(z * x + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0035:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{elif}\;x \leq 0.2:\\
\;\;\;\;t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\end{array}
\end{array}
if x < -0.00350000000000000007 or 0.20000000000000001 < x Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/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--.f6471.5
Applied rewrites71.5%
Taylor expanded in t around 0
Applied rewrites66.0%
if -0.00350000000000000007 < x < 0.20000000000000001Initial program 100.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6472.1
Applied rewrites72.1%
(FPCore (x y z t) :precision binary64 (if (<= t -2.5e+61) (* (- t) z) (if (<= t 4.2e+112) (fma z x x) (* t y))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.5e+61) {
tmp = -t * z;
} else if (t <= 4.2e+112) {
tmp = fma(z, x, x);
} else {
tmp = t * y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -2.5e+61) tmp = Float64(Float64(-t) * z); elseif (t <= 4.2e+112) tmp = fma(z, x, x); else tmp = Float64(t * y); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.5e+61], N[((-t) * z), $MachinePrecision], If[LessEqual[t, 4.2e+112], N[(z * x + x), $MachinePrecision], N[(t * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+61}:\\
\;\;\;\;\left(-t\right) \cdot z\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot y\\
\end{array}
\end{array}
if t < -2.50000000000000009e61Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/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--.f6457.0
Applied rewrites57.0%
Taylor expanded in t around inf
Applied rewrites52.9%
if -2.50000000000000009e61 < t < 4.1999999999999998e112Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/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.9
Applied rewrites66.9%
Taylor expanded in t around 0
Applied rewrites56.1%
if 4.1999999999999998e112 < t Initial program 100.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6482.5
Applied rewrites82.5%
Taylor expanded in z around 0
Applied rewrites51.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1e+76) (* t y) (if (<= y 4.55e-7) (fma z x x) (* t y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e+76) {
tmp = t * y;
} else if (y <= 4.55e-7) {
tmp = fma(z, x, x);
} else {
tmp = t * y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1e+76) tmp = Float64(t * y); elseif (y <= 4.55e-7) tmp = fma(z, x, x); else tmp = Float64(t * y); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e+76], N[(t * y), $MachinePrecision], If[LessEqual[y, 4.55e-7], N[(z * x + x), $MachinePrecision], N[(t * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+76}:\\
\;\;\;\;t \cdot y\\
\mathbf{elif}\;y \leq 4.55 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot y\\
\end{array}
\end{array}
if y < -1e76 or 4.5499999999999998e-7 < y Initial program 100.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6454.2
Applied rewrites54.2%
Taylor expanded in z around 0
Applied rewrites45.4%
if -1e76 < y < 4.5499999999999998e-7Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/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--.f6485.4
Applied rewrites85.4%
Taylor expanded in t around 0
Applied rewrites57.6%
(FPCore (x y z t) :precision binary64 (if (<= z -5.5e+24) (* z x) (if (<= z 2.8e+41) (* t y) (* z x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+24) {
tmp = z * x;
} else if (z <= 2.8e+41) {
tmp = t * y;
} else {
tmp = z * 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.5d+24)) then
tmp = z * x
else if (z <= 2.8d+41) then
tmp = t * y
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+24) {
tmp = z * x;
} else if (z <= 2.8e+41) {
tmp = t * y;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.5e+24: tmp = z * x elif z <= 2.8e+41: tmp = t * y else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e+24) tmp = Float64(z * x); elseif (z <= 2.8e+41) tmp = Float64(t * y); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.5e+24) tmp = z * x; elseif (z <= 2.8e+41) tmp = t * y; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+24], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.8e+41], N[(t * y), $MachinePrecision], N[(z * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+24}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+41}:\\
\;\;\;\;t \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -5.5000000000000002e24 or 2.7999999999999999e41 < z Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/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--.f6484.8
Applied rewrites84.8%
Taylor expanded in t around 0
Applied rewrites45.0%
if -5.5000000000000002e24 < z < 2.7999999999999999e41Initial program 100.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6442.0
Applied rewrites42.0%
Taylor expanded in z around 0
Applied rewrites33.1%
(FPCore (x y z t) :precision binary64 (* t y))
double code(double x, double y, double z, double t) {
return t * 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 = t * y
end function
public static double code(double x, double y, double z, double t) {
return t * y;
}
def code(x, y, z, t): return t * y
function code(x, y, z, t) return Float64(t * y) end
function tmp = code(x, y, z, t) tmp = t * y; end
code[x_, y_, z_, t_] := N[(t * y), $MachinePrecision]
\begin{array}{l}
\\
t \cdot y
\end{array}
Initial program 100.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6445.7
Applied rewrites45.7%
Taylor expanded in z around 0
Applied rewrites24.6%
(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 2024240
(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))))