
(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 13 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 (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* x (+ (- z y) 1.0))))
(if (<= y -6.1e+96)
t_1
(if (<= y -3.5e-12)
t_2
(if (<= y -1.6e-266) (- x (* z t)) (if (<= y 4.6e+26) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x * ((z - y) + 1.0);
double tmp;
if (y <= -6.1e+96) {
tmp = t_1;
} else if (y <= -3.5e-12) {
tmp = t_2;
} else if (y <= -1.6e-266) {
tmp = x - (z * t);
} else if (y <= 4.6e+26) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x * ((z - y) + 1.0d0)
if (y <= (-6.1d+96)) then
tmp = t_1
else if (y <= (-3.5d-12)) then
tmp = t_2
else if (y <= (-1.6d-266)) then
tmp = x - (z * t)
else if (y <= 4.6d+26) then
tmp = t_2
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 t_2 = x * ((z - y) + 1.0);
double tmp;
if (y <= -6.1e+96) {
tmp = t_1;
} else if (y <= -3.5e-12) {
tmp = t_2;
} else if (y <= -1.6e-266) {
tmp = x - (z * t);
} else if (y <= 4.6e+26) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x * ((z - y) + 1.0) tmp = 0 if y <= -6.1e+96: tmp = t_1 elif y <= -3.5e-12: tmp = t_2 elif y <= -1.6e-266: tmp = x - (z * t) elif y <= 4.6e+26: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x * Float64(Float64(z - y) + 1.0)) tmp = 0.0 if (y <= -6.1e+96) tmp = t_1; elseif (y <= -3.5e-12) tmp = t_2; elseif (y <= -1.6e-266) tmp = Float64(x - Float64(z * t)); elseif (y <= 4.6e+26) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x * ((z - y) + 1.0); tmp = 0.0; if (y <= -6.1e+96) tmp = t_1; elseif (y <= -3.5e-12) tmp = t_2; elseif (y <= -1.6e-266) tmp = x - (z * t); elseif (y <= 4.6e+26) tmp = t_2; 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]}, Block[{t$95$2 = N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.1e+96], t$95$1, If[LessEqual[y, -3.5e-12], t$95$2, If[LessEqual[y, -1.6e-266], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+26], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-12}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-266}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+26}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.09999999999999984e96 or 4.6000000000000001e26 < y Initial program 100.0%
Taylor expanded in y around inf 81.8%
*-commutative81.8%
Simplified81.8%
*-commutative81.8%
sub-neg81.8%
distribute-lft-in76.4%
Applied egg-rr76.4%
associate-+r+76.4%
distribute-rgt-neg-out76.4%
unsub-neg76.4%
+-commutative76.4%
Applied egg-rr76.4%
Taylor expanded in y around inf 81.8%
if -6.09999999999999984e96 < y < -3.5e-12 or -1.6e-266 < y < 4.6000000000000001e26Initial program 100.0%
Taylor expanded in x around inf 69.0%
mul-1-neg69.0%
unsub-neg69.0%
Simplified69.0%
if -3.5e-12 < y < -1.6e-266Initial program 100.0%
Taylor expanded in y around 0 95.3%
mul-1-neg95.3%
unsub-neg95.3%
Simplified95.3%
Taylor expanded in t around inf 72.6%
*-commutative72.6%
Simplified72.6%
Final simplification75.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.6e+107)
(* y t)
(if (<= y -4.8e-112)
(* z x)
(if (<= y 7.4e-128) x (if (<= y 2500000000.0) (* z x) (* x (- y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+107) {
tmp = y * t;
} else if (y <= -4.8e-112) {
tmp = z * x;
} else if (y <= 7.4e-128) {
tmp = x;
} else if (y <= 2500000000.0) {
tmp = z * x;
} else {
tmp = x * -y;
}
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 <= (-2.6d+107)) then
tmp = y * t
else if (y <= (-4.8d-112)) then
tmp = z * x
else if (y <= 7.4d-128) then
tmp = x
else if (y <= 2500000000.0d0) then
tmp = z * x
else
tmp = x * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+107) {
tmp = y * t;
} else if (y <= -4.8e-112) {
tmp = z * x;
} else if (y <= 7.4e-128) {
tmp = x;
} else if (y <= 2500000000.0) {
tmp = z * x;
} else {
tmp = x * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e+107: tmp = y * t elif y <= -4.8e-112: tmp = z * x elif y <= 7.4e-128: tmp = x elif y <= 2500000000.0: tmp = z * x else: tmp = x * -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e+107) tmp = Float64(y * t); elseif (y <= -4.8e-112) tmp = Float64(z * x); elseif (y <= 7.4e-128) tmp = x; elseif (y <= 2500000000.0) tmp = Float64(z * x); else tmp = Float64(x * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e+107) tmp = y * t; elseif (y <= -4.8e-112) tmp = z * x; elseif (y <= 7.4e-128) tmp = x; elseif (y <= 2500000000.0) tmp = z * x; else tmp = x * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e+107], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.8e-112], N[(z * x), $MachinePrecision], If[LessEqual[y, 7.4e-128], x, If[LessEqual[y, 2500000000.0], N[(z * x), $MachinePrecision], N[(x * (-y)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+107}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-112}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-128}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2500000000:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\end{array}
\end{array}
if y < -2.6000000000000001e107Initial program 100.0%
Taylor expanded in y around inf 76.9%
*-commutative76.9%
Simplified76.9%
*-commutative76.9%
sub-neg76.9%
distribute-lft-in68.4%
Applied egg-rr68.4%
associate-+r+68.4%
distribute-rgt-neg-out68.4%
unsub-neg68.4%
+-commutative68.4%
Applied egg-rr68.4%
Taylor expanded in t around inf 50.0%
*-commutative50.0%
Simplified50.0%
if -2.6000000000000001e107 < y < -4.8000000000000001e-112 or 7.4e-128 < y < 2.5e9Initial program 100.0%
Taylor expanded in x around inf 53.0%
mul-1-neg53.0%
unsub-neg53.0%
Simplified53.0%
associate--r-53.0%
distribute-rgt-in53.0%
Applied egg-rr53.0%
Taylor expanded in z around inf 34.7%
if -4.8000000000000001e-112 < y < 7.4e-128Initial program 100.0%
Taylor expanded in y around inf 50.3%
*-commutative50.3%
Simplified50.3%
Taylor expanded in y around 0 47.8%
if 2.5e9 < y Initial program 100.0%
Taylor expanded in y around inf 85.9%
*-commutative85.9%
Simplified85.9%
*-commutative85.9%
sub-neg85.9%
distribute-lft-in82.8%
Applied egg-rr82.8%
Taylor expanded in t around 0 54.4%
associate-*r*54.4%
mul-1-neg54.4%
Simplified54.4%
Taylor expanded in y around inf 53.5%
associate-*r*53.5%
mul-1-neg53.5%
Simplified53.5%
Final simplification46.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.7e+107)
(* y t)
(if (<= y -4.1e-112)
(* z x)
(if (<= y 6.5e-128) x (if (<= y 3.1e+33) (* z x) (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e+107) {
tmp = y * t;
} else if (y <= -4.1e-112) {
tmp = z * x;
} else if (y <= 6.5e-128) {
tmp = x;
} else if (y <= 3.1e+33) {
tmp = z * 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 <= (-2.7d+107)) then
tmp = y * t
else if (y <= (-4.1d-112)) then
tmp = z * x
else if (y <= 6.5d-128) then
tmp = x
else if (y <= 3.1d+33) then
tmp = z * 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 <= -2.7e+107) {
tmp = y * t;
} else if (y <= -4.1e-112) {
tmp = z * x;
} else if (y <= 6.5e-128) {
tmp = x;
} else if (y <= 3.1e+33) {
tmp = z * x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.7e+107: tmp = y * t elif y <= -4.1e-112: tmp = z * x elif y <= 6.5e-128: tmp = x elif y <= 3.1e+33: tmp = z * x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.7e+107) tmp = Float64(y * t); elseif (y <= -4.1e-112) tmp = Float64(z * x); elseif (y <= 6.5e-128) tmp = x; elseif (y <= 3.1e+33) tmp = Float64(z * x); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.7e+107) tmp = y * t; elseif (y <= -4.1e-112) tmp = z * x; elseif (y <= 6.5e-128) tmp = x; elseif (y <= 3.1e+33) tmp = z * x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.7e+107], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.1e-112], N[(z * x), $MachinePrecision], If[LessEqual[y, 6.5e-128], x, If[LessEqual[y, 3.1e+33], N[(z * x), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+107}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-112}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-128}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+33}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.7000000000000001e107 or 3.1e33 < y Initial program 100.0%
Taylor expanded in y around inf 82.3%
*-commutative82.3%
Simplified82.3%
*-commutative82.3%
sub-neg82.3%
distribute-lft-in76.7%
Applied egg-rr76.7%
associate-+r+76.7%
distribute-rgt-neg-out76.7%
unsub-neg76.7%
+-commutative76.7%
Applied egg-rr76.7%
Taylor expanded in t around inf 45.8%
*-commutative45.8%
Simplified45.8%
if -2.7000000000000001e107 < y < -4.09999999999999996e-112 or 6.49999999999999977e-128 < y < 3.1e33Initial program 99.9%
Taylor expanded in x around inf 55.6%
mul-1-neg55.6%
unsub-neg55.6%
Simplified55.6%
associate--r-55.6%
distribute-rgt-in55.6%
Applied egg-rr55.6%
Taylor expanded in z around inf 34.3%
if -4.09999999999999996e-112 < y < 6.49999999999999977e-128Initial program 100.0%
Taylor expanded in y around inf 50.3%
*-commutative50.3%
Simplified50.3%
Taylor expanded in y around 0 47.8%
Final simplification43.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -3.25e+66)
t_1
(if (<= y -5e-266)
(- x (* z t))
(if (<= y 75000000.0) (* x (+ z 1.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -3.25e+66) {
tmp = t_1;
} else if (y <= -5e-266) {
tmp = x - (z * t);
} else if (y <= 75000000.0) {
tmp = x * (z + 1.0);
} 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 <= (-3.25d+66)) then
tmp = t_1
else if (y <= (-5d-266)) then
tmp = x - (z * t)
else if (y <= 75000000.0d0) then
tmp = x * (z + 1.0d0)
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 <= -3.25e+66) {
tmp = t_1;
} else if (y <= -5e-266) {
tmp = x - (z * t);
} else if (y <= 75000000.0) {
tmp = x * (z + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -3.25e+66: tmp = t_1 elif y <= -5e-266: tmp = x - (z * t) elif y <= 75000000.0: tmp = x * (z + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -3.25e+66) tmp = t_1; elseif (y <= -5e-266) tmp = Float64(x - Float64(z * t)); elseif (y <= 75000000.0) tmp = Float64(x * Float64(z + 1.0)); 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 <= -3.25e+66) tmp = t_1; elseif (y <= -5e-266) tmp = x - (z * t); elseif (y <= 75000000.0) tmp = x * (z + 1.0); 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, -3.25e+66], t$95$1, If[LessEqual[y, -5e-266], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 75000000.0], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -3.25 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-266}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 75000000:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2500000000000001e66 or 7.5e7 < y Initial program 100.0%
Taylor expanded in y around inf 77.3%
*-commutative77.3%
Simplified77.3%
*-commutative77.3%
sub-neg77.3%
distribute-lft-in72.6%
Applied egg-rr72.6%
associate-+r+72.6%
distribute-rgt-neg-out72.6%
unsub-neg72.6%
+-commutative72.6%
Applied egg-rr72.6%
Taylor expanded in y around inf 76.9%
if -3.2500000000000001e66 < y < -4.99999999999999992e-266Initial program 100.0%
Taylor expanded in y around 0 87.9%
mul-1-neg87.9%
unsub-neg87.9%
Simplified87.9%
Taylor expanded in t around inf 65.4%
*-commutative65.4%
Simplified65.4%
if -4.99999999999999992e-266 < y < 7.5e7Initial program 100.0%
Taylor expanded in x around inf 71.1%
mul-1-neg71.1%
unsub-neg71.1%
Simplified71.1%
Taylor expanded in y around 0 69.4%
+-commutative69.4%
Simplified69.4%
Final simplification72.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.94) (not (<= t 4.8e-76))) (+ x (* (- y z) t)) (* x (+ (- z y) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.94) || !(t <= 4.8e-76)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z - y) + 1.0);
}
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 ((t <= (-0.94d0)) .or. (.not. (t <= 4.8d-76))) then
tmp = x + ((y - z) * t)
else
tmp = x * ((z - y) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.94) || !(t <= 4.8e-76)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z - y) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.94) or not (t <= 4.8e-76): tmp = x + ((y - z) * t) else: tmp = x * ((z - y) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.94) || !(t <= 4.8e-76)) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x * Float64(Float64(z - y) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -0.94) || ~((t <= 4.8e-76))) tmp = x + ((y - z) * t); else tmp = x * ((z - y) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.94], N[Not[LessEqual[t, 4.8e-76]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.94 \lor \neg \left(t \leq 4.8 \cdot 10^{-76}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\end{array}
\end{array}
if t < -0.93999999999999995 or 4.80000000000000026e-76 < t Initial program 100.0%
Taylor expanded in t around inf 82.8%
if -0.93999999999999995 < t < 4.80000000000000026e-76Initial program 100.0%
Taylor expanded in x around inf 84.9%
mul-1-neg84.9%
unsub-neg84.9%
Simplified84.9%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.7e+22) (not (<= z 6.2e+75))) (- x (* z (- t x))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e+22) || !(z <= 6.2e+75)) {
tmp = x - (z * (t - x));
} else {
tmp = x + (y * (t - 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 <= (-1.7d+22)) .or. (.not. (z <= 6.2d+75))) then
tmp = x - (z * (t - x))
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e+22) || !(z <= 6.2e+75)) {
tmp = x - (z * (t - x));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.7e+22) or not (z <= 6.2e+75): tmp = x - (z * (t - x)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.7e+22) || !(z <= 6.2e+75)) tmp = Float64(x - Float64(z * Float64(t - x))); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.7e+22) || ~((z <= 6.2e+75))) tmp = x - (z * (t - x)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e+22], N[Not[LessEqual[z, 6.2e+75]], $MachinePrecision]], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+22} \lor \neg \left(z \leq 6.2 \cdot 10^{+75}\right):\\
\;\;\;\;x - z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -1.7e22 or 6.2000000000000002e75 < z Initial program 100.0%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
unsub-neg81.8%
Simplified81.8%
if -1.7e22 < z < 6.2000000000000002e75Initial program 100.0%
Taylor expanded in y around inf 93.0%
*-commutative93.0%
Simplified93.0%
Final simplification87.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.2e+27) (not (<= y 40000000.0))) (* y (- t x)) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.2e+27) || !(y <= 40000000.0)) {
tmp = y * (t - x);
} else {
tmp = x * (z + 1.0);
}
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 <= (-1.2d+27)) .or. (.not. (y <= 40000000.0d0))) then
tmp = y * (t - x)
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.2e+27) || !(y <= 40000000.0)) {
tmp = y * (t - x);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.2e+27) or not (y <= 40000000.0): tmp = y * (t - x) else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.2e+27) || !(y <= 40000000.0)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.2e+27) || ~((y <= 40000000.0))) tmp = y * (t - x); else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.2e+27], N[Not[LessEqual[y, 40000000.0]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+27} \lor \neg \left(y \leq 40000000\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if y < -1.19999999999999999e27 or 4e7 < y Initial program 100.0%
Taylor expanded in y around inf 75.7%
*-commutative75.7%
Simplified75.7%
*-commutative75.7%
sub-neg75.7%
distribute-lft-in70.5%
Applied egg-rr70.5%
associate-+r+70.5%
distribute-rgt-neg-out70.5%
unsub-neg70.5%
+-commutative70.5%
Applied egg-rr70.5%
Taylor expanded in y around inf 75.3%
if -1.19999999999999999e27 < y < 4e7Initial program 100.0%
Taylor expanded in x around inf 66.0%
mul-1-neg66.0%
unsub-neg66.0%
Simplified66.0%
Taylor expanded in y around 0 64.2%
+-commutative64.2%
Simplified64.2%
Final simplification70.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.6e+107) (* y t) (if (<= y 5000000000.0) (* x (+ z 1.0)) (* x (- y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+107) {
tmp = y * t;
} else if (y <= 5000000000.0) {
tmp = x * (z + 1.0);
} else {
tmp = x * -y;
}
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 <= (-2.6d+107)) then
tmp = y * t
else if (y <= 5000000000.0d0) then
tmp = x * (z + 1.0d0)
else
tmp = x * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+107) {
tmp = y * t;
} else if (y <= 5000000000.0) {
tmp = x * (z + 1.0);
} else {
tmp = x * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e+107: tmp = y * t elif y <= 5000000000.0: tmp = x * (z + 1.0) else: tmp = x * -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e+107) tmp = Float64(y * t); elseif (y <= 5000000000.0) tmp = Float64(x * Float64(z + 1.0)); else tmp = Float64(x * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e+107) tmp = y * t; elseif (y <= 5000000000.0) tmp = x * (z + 1.0); else tmp = x * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e+107], N[(y * t), $MachinePrecision], If[LessEqual[y, 5000000000.0], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * (-y)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+107}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 5000000000:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\end{array}
\end{array}
if y < -2.6000000000000001e107Initial program 100.0%
Taylor expanded in y around inf 76.9%
*-commutative76.9%
Simplified76.9%
*-commutative76.9%
sub-neg76.9%
distribute-lft-in68.4%
Applied egg-rr68.4%
associate-+r+68.4%
distribute-rgt-neg-out68.4%
unsub-neg68.4%
+-commutative68.4%
Applied egg-rr68.4%
Taylor expanded in t around inf 50.0%
*-commutative50.0%
Simplified50.0%
if -2.6000000000000001e107 < y < 5e9Initial program 100.0%
Taylor expanded in x around inf 64.6%
mul-1-neg64.6%
unsub-neg64.6%
Simplified64.6%
Taylor expanded in y around 0 60.1%
+-commutative60.1%
Simplified60.1%
if 5e9 < y Initial program 100.0%
Taylor expanded in y around inf 85.9%
*-commutative85.9%
Simplified85.9%
*-commutative85.9%
sub-neg85.9%
distribute-lft-in82.8%
Applied egg-rr82.8%
Taylor expanded in t around 0 54.4%
associate-*r*54.4%
mul-1-neg54.4%
Simplified54.4%
Taylor expanded in y around inf 53.5%
associate-*r*53.5%
mul-1-neg53.5%
Simplified53.5%
Final simplification56.6%
(FPCore (x y z t) :precision binary64 (if (<= y -2.8e+107) (* y t) (if (<= y 130000000.0) (* x (+ z 1.0)) (* x (- 1.0 y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e+107) {
tmp = y * t;
} else if (y <= 130000000.0) {
tmp = x * (z + 1.0);
} else {
tmp = x * (1.0 - y);
}
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 <= (-2.8d+107)) then
tmp = y * t
else if (y <= 130000000.0d0) then
tmp = x * (z + 1.0d0)
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e+107) {
tmp = y * t;
} else if (y <= 130000000.0) {
tmp = x * (z + 1.0);
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e+107: tmp = y * t elif y <= 130000000.0: tmp = x * (z + 1.0) else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e+107) tmp = Float64(y * t); elseif (y <= 130000000.0) tmp = Float64(x * Float64(z + 1.0)); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.8e+107) tmp = y * t; elseif (y <= 130000000.0) tmp = x * (z + 1.0); else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e+107], N[(y * t), $MachinePrecision], If[LessEqual[y, 130000000.0], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+107}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 130000000:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
if y < -2.79999999999999985e107Initial program 100.0%
Taylor expanded in y around inf 76.9%
*-commutative76.9%
Simplified76.9%
*-commutative76.9%
sub-neg76.9%
distribute-lft-in68.4%
Applied egg-rr68.4%
associate-+r+68.4%
distribute-rgt-neg-out68.4%
unsub-neg68.4%
+-commutative68.4%
Applied egg-rr68.4%
Taylor expanded in t around inf 50.0%
*-commutative50.0%
Simplified50.0%
if -2.79999999999999985e107 < y < 1.3e8Initial program 100.0%
Taylor expanded in x around inf 64.6%
mul-1-neg64.6%
unsub-neg64.6%
Simplified64.6%
Taylor expanded in y around 0 60.1%
+-commutative60.1%
Simplified60.1%
if 1.3e8 < y Initial program 100.0%
Taylor expanded in x around inf 63.5%
mul-1-neg63.5%
unsub-neg63.5%
Simplified63.5%
Taylor expanded in z around 0 54.4%
Final simplification56.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.62e-15) (not (<= z 110.0))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.62e-15) || !(z <= 110.0)) {
tmp = z * x;
} else {
tmp = 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 <= (-1.62d-15)) .or. (.not. (z <= 110.0d0))) then
tmp = z * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.62e-15) || !(z <= 110.0)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.62e-15) or not (z <= 110.0): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.62e-15) || !(z <= 110.0)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.62e-15) || ~((z <= 110.0))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.62e-15], N[Not[LessEqual[z, 110.0]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.62 \cdot 10^{-15} \lor \neg \left(z \leq 110\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.62000000000000009e-15 or 110 < z Initial program 100.0%
Taylor expanded in x around inf 56.3%
mul-1-neg56.3%
unsub-neg56.3%
Simplified56.3%
associate--r-56.3%
distribute-rgt-in49.9%
Applied egg-rr49.9%
Taylor expanded in z around inf 42.2%
if -1.62000000000000009e-15 < z < 110Initial program 100.0%
Taylor expanded in y around inf 95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in y around 0 38.0%
Final simplification40.3%
(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%
Final simplification100.0%
(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 y around inf 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in y around 0 18.6%
Final simplification18.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 2024053
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))