
(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 (* (- t x) (- y z))))
double code(double x, double y, double z, double t) {
return x + ((t - 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 - x) * (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t - x) * (y - z));
}
def code(x, y, z, t): return x + ((t - x) * (y - z))
function code(x, y, z, t) return Float64(x + Float64(Float64(t - x) * Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x + ((t - x) * (y - z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right) \cdot \left(y - z\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* x z))) (t_2 (+ x (* (- y z) t))))
(if (<= t -2.3e-35)
t_2
(if (<= t -5.4e-144)
t_1
(if (<= t -4.5e-170)
t_2
(if (<= t 1.4e-272) (- x (* x y)) (if (<= t 2.8e-37) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x + ((y - z) * t);
double tmp;
if (t <= -2.3e-35) {
tmp = t_2;
} else if (t <= -5.4e-144) {
tmp = t_1;
} else if (t <= -4.5e-170) {
tmp = t_2;
} else if (t <= 1.4e-272) {
tmp = x - (x * y);
} else if (t <= 2.8e-37) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = x + (x * z)
t_2 = x + ((y - z) * t)
if (t <= (-2.3d-35)) then
tmp = t_2
else if (t <= (-5.4d-144)) then
tmp = t_1
else if (t <= (-4.5d-170)) then
tmp = t_2
else if (t <= 1.4d-272) then
tmp = x - (x * y)
else if (t <= 2.8d-37) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x + ((y - z) * t);
double tmp;
if (t <= -2.3e-35) {
tmp = t_2;
} else if (t <= -5.4e-144) {
tmp = t_1;
} else if (t <= -4.5e-170) {
tmp = t_2;
} else if (t <= 1.4e-272) {
tmp = x - (x * y);
} else if (t <= 2.8e-37) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * z) t_2 = x + ((y - z) * t) tmp = 0 if t <= -2.3e-35: tmp = t_2 elif t <= -5.4e-144: tmp = t_1 elif t <= -4.5e-170: tmp = t_2 elif t <= 1.4e-272: tmp = x - (x * y) elif t <= 2.8e-37: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * z)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (t <= -2.3e-35) tmp = t_2; elseif (t <= -5.4e-144) tmp = t_1; elseif (t <= -4.5e-170) tmp = t_2; elseif (t <= 1.4e-272) tmp = Float64(x - Float64(x * y)); elseif (t <= 2.8e-37) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * z); t_2 = x + ((y - z) * t); tmp = 0.0; if (t <= -2.3e-35) tmp = t_2; elseif (t <= -5.4e-144) tmp = t_1; elseif (t <= -4.5e-170) tmp = t_2; elseif (t <= 1.4e-272) tmp = x - (x * y); elseif (t <= 2.8e-37) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e-35], t$95$2, If[LessEqual[t, -5.4e-144], t$95$1, If[LessEqual[t, -4.5e-170], t$95$2, If[LessEqual[t, 1.4e-272], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e-37], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{-35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-170}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-272}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.2999999999999999e-35 or -5.3999999999999995e-144 < t < -4.50000000000000002e-170 or 2.8000000000000001e-37 < t Initial program 100.0%
Taylor expanded in t around inf 84.5%
if -2.2999999999999999e-35 < t < -5.3999999999999995e-144 or 1.39999999999999997e-272 < t < 2.8000000000000001e-37Initial program 100.0%
Taylor expanded in y around 0 76.1%
mul-1-neg76.1%
distribute-lft-neg-out76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in t around 0 68.3%
if -4.50000000000000002e-170 < t < 1.39999999999999997e-272Initial program 100.0%
Taylor expanded in t around 0 92.2%
mul-1-neg92.2%
distribute-lft-neg-out92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in z around 0 75.9%
mul-1-neg75.9%
unsub-neg75.9%
Simplified75.9%
Final simplification78.7%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -2.05e+67)
(and (not (<= z -6.8e+34)) (or (<= z -5.2e+19) (not (<= z 2.2e+94)))))
(+ x (* z (- x t)))
(+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.05e+67) || (!(z <= -6.8e+34) && ((z <= -5.2e+19) || !(z <= 2.2e+94)))) {
tmp = x + (z * (x - t));
} 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 <= (-2.05d+67)) .or. (.not. (z <= (-6.8d+34))) .and. (z <= (-5.2d+19)) .or. (.not. (z <= 2.2d+94))) then
tmp = x + (z * (x - t))
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 <= -2.05e+67) || (!(z <= -6.8e+34) && ((z <= -5.2e+19) || !(z <= 2.2e+94)))) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.05e+67) or (not (z <= -6.8e+34) and ((z <= -5.2e+19) or not (z <= 2.2e+94))): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.05e+67) || (!(z <= -6.8e+34) && ((z <= -5.2e+19) || !(z <= 2.2e+94)))) tmp = Float64(x + Float64(z * Float64(x - t))); 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 <= -2.05e+67) || (~((z <= -6.8e+34)) && ((z <= -5.2e+19) || ~((z <= 2.2e+94))))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.05e+67], And[N[Not[LessEqual[z, -6.8e+34]], $MachinePrecision], Or[LessEqual[z, -5.2e+19], N[Not[LessEqual[z, 2.2e+94]], $MachinePrecision]]]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+67} \lor \neg \left(z \leq -6.8 \cdot 10^{+34}\right) \land \left(z \leq -5.2 \cdot 10^{+19} \lor \neg \left(z \leq 2.2 \cdot 10^{+94}\right)\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -2.0499999999999999e67 or -6.7999999999999999e34 < z < -5.2e19 or 2.20000000000000012e94 < z Initial program 100.0%
Taylor expanded in y around 0 85.4%
mul-1-neg85.4%
distribute-lft-neg-out85.4%
*-commutative85.4%
Simplified85.4%
if -2.0499999999999999e67 < z < -6.7999999999999999e34 or -5.2e19 < z < 2.20000000000000012e94Initial program 100.0%
Taylor expanded in y around inf 90.6%
*-commutative90.6%
Simplified90.6%
Final simplification88.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))))
(if (<= z -9.6e+68)
t_1
(if (<= z 1.75e+16)
(+ x (* y t))
(if (<= z 2.5e+96)
(- x (* x y))
(if (<= z 1.45e+165) t_1 (+ x (* x z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (z <= -9.6e+68) {
tmp = t_1;
} else if (z <= 1.75e+16) {
tmp = x + (y * t);
} else if (z <= 2.5e+96) {
tmp = x - (x * y);
} else if (z <= 1.45e+165) {
tmp = t_1;
} else {
tmp = x + (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) :: t_1
real(8) :: tmp
t_1 = x - (z * t)
if (z <= (-9.6d+68)) then
tmp = t_1
else if (z <= 1.75d+16) then
tmp = x + (y * t)
else if (z <= 2.5d+96) then
tmp = x - (x * y)
else if (z <= 1.45d+165) then
tmp = t_1
else
tmp = x + (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (z <= -9.6e+68) {
tmp = t_1;
} else if (z <= 1.75e+16) {
tmp = x + (y * t);
} else if (z <= 2.5e+96) {
tmp = x - (x * y);
} else if (z <= 1.45e+165) {
tmp = t_1;
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) tmp = 0 if z <= -9.6e+68: tmp = t_1 elif z <= 1.75e+16: tmp = x + (y * t) elif z <= 2.5e+96: tmp = x - (x * y) elif z <= 1.45e+165: tmp = t_1 else: tmp = x + (x * z) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) tmp = 0.0 if (z <= -9.6e+68) tmp = t_1; elseif (z <= 1.75e+16) tmp = Float64(x + Float64(y * t)); elseif (z <= 2.5e+96) tmp = Float64(x - Float64(x * y)); elseif (z <= 1.45e+165) tmp = t_1; else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); tmp = 0.0; if (z <= -9.6e+68) tmp = t_1; elseif (z <= 1.75e+16) tmp = x + (y * t); elseif (z <= 2.5e+96) tmp = x - (x * y); elseif (z <= 1.45e+165) tmp = t_1; else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+68], t$95$1, If[LessEqual[z, 1.75e+16], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+96], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+165], t$95$1, N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+16}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+96}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if z < -9.60000000000000031e68 or 2.5000000000000002e96 < z < 1.45000000000000003e165Initial program 100.0%
Taylor expanded in t around inf 63.5%
Taylor expanded in y around 0 52.7%
mul-1-neg52.7%
unsub-neg52.7%
*-commutative52.7%
Simplified52.7%
if -9.60000000000000031e68 < z < 1.75e16Initial program 100.0%
Taylor expanded in y around inf 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in t around inf 71.3%
*-commutative71.3%
Simplified71.3%
if 1.75e16 < z < 2.5000000000000002e96Initial program 100.0%
Taylor expanded in t around 0 70.4%
mul-1-neg70.4%
distribute-lft-neg-out70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in z around 0 53.4%
mul-1-neg53.4%
unsub-neg53.4%
Simplified53.4%
if 1.45000000000000003e165 < z Initial program 99.9%
Taylor expanded in y around 0 88.5%
mul-1-neg88.5%
distribute-lft-neg-out88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in t around 0 54.1%
Final simplification63.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y t))))
(if (<= t -6e-63)
t_1
(if (<= t 2.1e-274)
(- x (* x y))
(if (<= t 1.3e+51) (+ x (* x z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double tmp;
if (t <= -6e-63) {
tmp = t_1;
} else if (t <= 2.1e-274) {
tmp = x - (x * y);
} else if (t <= 1.3e+51) {
tmp = x + (x * z);
} 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 = x + (y * t)
if (t <= (-6d-63)) then
tmp = t_1
else if (t <= 2.1d-274) then
tmp = x - (x * y)
else if (t <= 1.3d+51) then
tmp = x + (x * z)
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 = x + (y * t);
double tmp;
if (t <= -6e-63) {
tmp = t_1;
} else if (t <= 2.1e-274) {
tmp = x - (x * y);
} else if (t <= 1.3e+51) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * t) tmp = 0 if t <= -6e-63: tmp = t_1 elif t <= 2.1e-274: tmp = x - (x * y) elif t <= 1.3e+51: tmp = x + (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * t)) tmp = 0.0 if (t <= -6e-63) tmp = t_1; elseif (t <= 2.1e-274) tmp = Float64(x - Float64(x * y)); elseif (t <= 1.3e+51) tmp = Float64(x + Float64(x * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * t); tmp = 0.0; if (t <= -6e-63) tmp = t_1; elseif (t <= 2.1e-274) tmp = x - (x * y); elseif (t <= 1.3e+51) tmp = x + (x * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e-63], t$95$1, If[LessEqual[t, 2.1e-274], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+51], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot t\\
\mathbf{if}\;t \leq -6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-274}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+51}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.99999999999999959e-63 or 1.3000000000000001e51 < t Initial program 100.0%
Taylor expanded in y around inf 62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in t around inf 54.3%
*-commutative54.3%
Simplified54.3%
if -5.99999999999999959e-63 < t < 2.09999999999999994e-274Initial program 100.0%
Taylor expanded in t around 0 85.8%
mul-1-neg85.8%
distribute-lft-neg-out85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in z around 0 67.2%
mul-1-neg67.2%
unsub-neg67.2%
Simplified67.2%
if 2.09999999999999994e-274 < t < 1.3000000000000001e51Initial program 100.0%
Taylor expanded in y around 0 75.5%
mul-1-neg75.5%
distribute-lft-neg-out75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in t around 0 62.7%
Final simplification59.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.5e-13) (not (<= t 1.95e+51))) (+ x (* t (- y z))) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e-13) || !(t <= 1.95e+51)) {
tmp = x + (t * (y - z));
} else {
tmp = x + (x * (z - 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 ((t <= (-3.5d-13)) .or. (.not. (t <= 1.95d+51))) then
tmp = x + (t * (y - z))
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e-13) || !(t <= 1.95e+51)) {
tmp = x + (t * (y - z));
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.5e-13) or not (t <= 1.95e+51): tmp = x + (t * (y - z)) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.5e-13) || !(t <= 1.95e+51)) tmp = Float64(x + Float64(t * Float64(y - z))); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.5e-13) || ~((t <= 1.95e+51))) tmp = x + (t * (y - z)); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.5e-13], N[Not[LessEqual[t, 1.95e+51]], $MachinePrecision]], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-13} \lor \neg \left(t \leq 1.95 \cdot 10^{+51}\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -3.5000000000000002e-13 or 1.94999999999999992e51 < t Initial program 100.0%
Taylor expanded in t around inf 87.9%
if -3.5000000000000002e-13 < t < 1.94999999999999992e51Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in95.5%
Applied egg-rr95.5%
Taylor expanded in t around 0 76.2%
mul-1-neg76.2%
distribute-rgt-neg-in76.2%
mul-1-neg76.2%
distribute-lft-in80.7%
+-commutative80.7%
mul-1-neg80.7%
sub-neg80.7%
Simplified80.7%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.4e+25) (not (<= y 5.5e+57))) (* y t) (+ x (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.4e+25) || !(y <= 5.5e+57)) {
tmp = y * t;
} else {
tmp = x + (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 ((y <= (-6.4d+25)) .or. (.not. (y <= 5.5d+57))) then
tmp = y * t
else
tmp = x + (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.4e+25) || !(y <= 5.5e+57)) {
tmp = y * t;
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.4e+25) or not (y <= 5.5e+57): tmp = y * t else: tmp = x + (x * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.4e+25) || !(y <= 5.5e+57)) tmp = Float64(y * t); else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.4e+25) || ~((y <= 5.5e+57))) tmp = y * t; else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.4e+25], N[Not[LessEqual[y, 5.5e+57]], $MachinePrecision]], N[(y * t), $MachinePrecision], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+25} \lor \neg \left(y \leq 5.5 \cdot 10^{+57}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if y < -6.3999999999999999e25 or 5.5000000000000002e57 < y Initial program 100.0%
Taylor expanded in y around inf 78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in t around inf 47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in x around 0 47.5%
if -6.3999999999999999e25 < y < 5.5000000000000002e57Initial program 100.0%
Taylor expanded in y around 0 89.8%
mul-1-neg89.8%
distribute-lft-neg-out89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in t around 0 61.3%
Final simplification55.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.4e-35) (not (<= t 2.55e+51))) (+ x (* y t)) (+ x (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.4e-35) || !(t <= 2.55e+51)) {
tmp = x + (y * t);
} else {
tmp = x + (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 ((t <= (-8.4d-35)) .or. (.not. (t <= 2.55d+51))) then
tmp = x + (y * t)
else
tmp = x + (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.4e-35) || !(t <= 2.55e+51)) {
tmp = x + (y * t);
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.4e-35) or not (t <= 2.55e+51): tmp = x + (y * t) else: tmp = x + (x * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.4e-35) || !(t <= 2.55e+51)) tmp = Float64(x + Float64(y * t)); else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.4e-35) || ~((t <= 2.55e+51))) tmp = x + (y * t); else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.4e-35], N[Not[LessEqual[t, 2.55e+51]], $MachinePrecision]], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{-35} \lor \neg \left(t \leq 2.55 \cdot 10^{+51}\right):\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if t < -8.3999999999999999e-35 or 2.55000000000000005e51 < t Initial program 100.0%
Taylor expanded in y around inf 63.5%
*-commutative63.5%
Simplified63.5%
Taylor expanded in t around inf 55.2%
*-commutative55.2%
Simplified55.2%
if -8.3999999999999999e-35 < t < 2.55000000000000005e51Initial program 100.0%
Taylor expanded in y around 0 69.9%
mul-1-neg69.9%
distribute-lft-neg-out69.9%
*-commutative69.9%
Simplified69.9%
Taylor expanded in t around 0 58.7%
Final simplification57.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.8e+22) (not (<= y 0.0038))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e+22) || !(y <= 0.0038)) {
tmp = y * t;
} 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 ((y <= (-1.8d+22)) .or. (.not. (y <= 0.0038d0))) then
tmp = y * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e+22) || !(y <= 0.0038)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.8e+22) or not (y <= 0.0038): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.8e+22) || !(y <= 0.0038)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.8e+22) || ~((y <= 0.0038))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.8e+22], N[Not[LessEqual[y, 0.0038]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+22} \lor \neg \left(y \leq 0.0038\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.8e22 or 0.00379999999999999999 < y Initial program 100.0%
Taylor expanded in y around inf 74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in t around inf 45.6%
*-commutative45.6%
Simplified45.6%
Taylor expanded in x around 0 45.2%
if -1.8e22 < y < 0.00379999999999999999Initial program 100.0%
Taylor expanded in t around inf 75.8%
Taylor expanded in x around inf 41.4%
Final simplification43.3%
(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 t around inf 67.4%
Taylor expanded in x around inf 21.9%
Final simplification21.9%
(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 2023332
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))