
(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 14 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-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* y (- x))) (t_3 (* x (+ z 1.0))))
(if (<= y -9.5e+162)
(* y t)
(if (<= y -1.9e+77)
t_2
(if (<= y -9.5e+24)
(* y t)
(if (<= y -1650.0)
t_2
(if (<= y -1.4e-15)
t_1
(if (<= y -2.05e-215)
t_3
(if (<= y -1.05e-236)
t_1
(if (<= y 8.5e+14) t_3 (* y t)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * -x;
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -9.5e+162) {
tmp = y * t;
} else if (y <= -1.9e+77) {
tmp = t_2;
} else if (y <= -9.5e+24) {
tmp = y * t;
} else if (y <= -1650.0) {
tmp = t_2;
} else if (y <= -1.4e-15) {
tmp = t_1;
} else if (y <= -2.05e-215) {
tmp = t_3;
} else if (y <= -1.05e-236) {
tmp = t_1;
} else if (y <= 8.5e+14) {
tmp = t_3;
} 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z * -t
t_2 = y * -x
t_3 = x * (z + 1.0d0)
if (y <= (-9.5d+162)) then
tmp = y * t
else if (y <= (-1.9d+77)) then
tmp = t_2
else if (y <= (-9.5d+24)) then
tmp = y * t
else if (y <= (-1650.0d0)) then
tmp = t_2
else if (y <= (-1.4d-15)) then
tmp = t_1
else if (y <= (-2.05d-215)) then
tmp = t_3
else if (y <= (-1.05d-236)) then
tmp = t_1
else if (y <= 8.5d+14) then
tmp = t_3
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * -x;
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -9.5e+162) {
tmp = y * t;
} else if (y <= -1.9e+77) {
tmp = t_2;
} else if (y <= -9.5e+24) {
tmp = y * t;
} else if (y <= -1650.0) {
tmp = t_2;
} else if (y <= -1.4e-15) {
tmp = t_1;
} else if (y <= -2.05e-215) {
tmp = t_3;
} else if (y <= -1.05e-236) {
tmp = t_1;
} else if (y <= 8.5e+14) {
tmp = t_3;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = y * -x t_3 = x * (z + 1.0) tmp = 0 if y <= -9.5e+162: tmp = y * t elif y <= -1.9e+77: tmp = t_2 elif y <= -9.5e+24: tmp = y * t elif y <= -1650.0: tmp = t_2 elif y <= -1.4e-15: tmp = t_1 elif y <= -2.05e-215: tmp = t_3 elif y <= -1.05e-236: tmp = t_1 elif y <= 8.5e+14: tmp = t_3 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(y * Float64(-x)) t_3 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -9.5e+162) tmp = Float64(y * t); elseif (y <= -1.9e+77) tmp = t_2; elseif (y <= -9.5e+24) tmp = Float64(y * t); elseif (y <= -1650.0) tmp = t_2; elseif (y <= -1.4e-15) tmp = t_1; elseif (y <= -2.05e-215) tmp = t_3; elseif (y <= -1.05e-236) tmp = t_1; elseif (y <= 8.5e+14) tmp = t_3; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = y * -x; t_3 = x * (z + 1.0); tmp = 0.0; if (y <= -9.5e+162) tmp = y * t; elseif (y <= -1.9e+77) tmp = t_2; elseif (y <= -9.5e+24) tmp = y * t; elseif (y <= -1650.0) tmp = t_2; elseif (y <= -1.4e-15) tmp = t_1; elseif (y <= -2.05e-215) tmp = t_3; elseif (y <= -1.05e-236) tmp = t_1; elseif (y <= 8.5e+14) tmp = t_3; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e+162], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.9e+77], t$95$2, If[LessEqual[y, -9.5e+24], N[(y * t), $MachinePrecision], If[LessEqual[y, -1650.0], t$95$2, If[LessEqual[y, -1.4e-15], t$95$1, If[LessEqual[y, -2.05e-215], t$95$3, If[LessEqual[y, -1.05e-236], t$95$1, If[LessEqual[y, 8.5e+14], t$95$3, N[(y * t), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := y \cdot \left(-x\right)\\
t_3 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+162}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{+77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{+24}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1650:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-215}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-236}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+14}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -9.50000000000000021e162 or -1.9000000000000001e77 < y < -9.5000000000000001e24 or 8.5e14 < y Initial program 100.0%
Taylor expanded in t around inf 68.8%
Taylor expanded in y around inf 59.4%
if -9.50000000000000021e162 < y < -1.9000000000000001e77 or -9.5000000000000001e24 < y < -1650Initial program 100.0%
Taylor expanded in x around inf 75.4%
*-commutative75.4%
mul-1-neg75.4%
unsub-neg75.4%
distribute-lft-out--75.4%
*-rgt-identity75.4%
Simplified75.4%
Taylor expanded in z around 0 71.8%
Taylor expanded in y around inf 55.9%
mul-1-neg55.9%
distribute-rgt-neg-in55.9%
Simplified55.9%
if -1650 < y < -1.40000000000000007e-15 or -2.04999999999999992e-215 < y < -1.04999999999999989e-236Initial program 100.0%
Taylor expanded in t around inf 94.2%
Taylor expanded in z around inf 77.5%
mul-1-neg77.5%
distribute-rgt-neg-out77.5%
Simplified77.5%
if -1.40000000000000007e-15 < y < -2.04999999999999992e-215 or -1.04999999999999989e-236 < y < 8.5e14Initial program 100.0%
Taylor expanded in y around 0 93.0%
+-commutative93.0%
mul-1-neg93.0%
unsub-neg93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in x around -inf 62.9%
Final simplification61.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -2.1e+210)
t_1
(if (<= z -8e+159)
(* z x)
(if (<= z -2.2e-28)
t_1
(if (<= z -1.52e-89)
(* y t)
(if (<= z -3.2e-184)
(* y (- x))
(if (<= z 2.95e-301) x (if (<= z 1.65e+21) (* y t) t_1)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -2.1e+210) {
tmp = t_1;
} else if (z <= -8e+159) {
tmp = z * x;
} else if (z <= -2.2e-28) {
tmp = t_1;
} else if (z <= -1.52e-89) {
tmp = y * t;
} else if (z <= -3.2e-184) {
tmp = y * -x;
} else if (z <= 2.95e-301) {
tmp = x;
} else if (z <= 1.65e+21) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * -t
if (z <= (-2.1d+210)) then
tmp = t_1
else if (z <= (-8d+159)) then
tmp = z * x
else if (z <= (-2.2d-28)) then
tmp = t_1
else if (z <= (-1.52d-89)) then
tmp = y * t
else if (z <= (-3.2d-184)) then
tmp = y * -x
else if (z <= 2.95d-301) then
tmp = x
else if (z <= 1.65d+21) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -2.1e+210) {
tmp = t_1;
} else if (z <= -8e+159) {
tmp = z * x;
} else if (z <= -2.2e-28) {
tmp = t_1;
} else if (z <= -1.52e-89) {
tmp = y * t;
} else if (z <= -3.2e-184) {
tmp = y * -x;
} else if (z <= 2.95e-301) {
tmp = x;
} else if (z <= 1.65e+21) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -2.1e+210: tmp = t_1 elif z <= -8e+159: tmp = z * x elif z <= -2.2e-28: tmp = t_1 elif z <= -1.52e-89: tmp = y * t elif z <= -3.2e-184: tmp = y * -x elif z <= 2.95e-301: tmp = x elif z <= 1.65e+21: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -2.1e+210) tmp = t_1; elseif (z <= -8e+159) tmp = Float64(z * x); elseif (z <= -2.2e-28) tmp = t_1; elseif (z <= -1.52e-89) tmp = Float64(y * t); elseif (z <= -3.2e-184) tmp = Float64(y * Float64(-x)); elseif (z <= 2.95e-301) tmp = x; elseif (z <= 1.65e+21) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -2.1e+210) tmp = t_1; elseif (z <= -8e+159) tmp = z * x; elseif (z <= -2.2e-28) tmp = t_1; elseif (z <= -1.52e-89) tmp = y * t; elseif (z <= -3.2e-184) tmp = y * -x; elseif (z <= 2.95e-301) tmp = x; elseif (z <= 1.65e+21) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -2.1e+210], t$95$1, If[LessEqual[z, -8e+159], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.2e-28], t$95$1, If[LessEqual[z, -1.52e-89], N[(y * t), $MachinePrecision], If[LessEqual[z, -3.2e-184], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.95e-301], x, If[LessEqual[z, 1.65e+21], N[(y * t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+210}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+159}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.52 \cdot 10^{-89}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-184}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{-301}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+21}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.0999999999999999e210 or -7.9999999999999994e159 < z < -2.19999999999999996e-28 or 1.65e21 < z Initial program 100.0%
Taylor expanded in t around inf 64.9%
Taylor expanded in z around inf 53.7%
mul-1-neg53.7%
distribute-rgt-neg-out53.7%
Simplified53.7%
if -2.0999999999999999e210 < z < -7.9999999999999994e159Initial program 100.0%
Taylor expanded in x around inf 59.4%
*-commutative59.4%
mul-1-neg59.4%
unsub-neg59.4%
distribute-lft-out--59.4%
*-rgt-identity59.4%
Simplified59.4%
Taylor expanded in z around inf 58.7%
if -2.19999999999999996e-28 < z < -1.52e-89 or 2.9499999999999999e-301 < z < 1.65e21Initial program 100.0%
Taylor expanded in t around inf 82.1%
Taylor expanded in y around inf 47.4%
if -1.52e-89 < z < -3.2e-184Initial program 100.0%
Taylor expanded in x around inf 83.6%
*-commutative83.6%
mul-1-neg83.6%
unsub-neg83.6%
distribute-lft-out--83.6%
*-rgt-identity83.6%
Simplified83.6%
Taylor expanded in z around 0 83.6%
Taylor expanded in y around inf 67.4%
mul-1-neg67.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
if -3.2e-184 < z < 2.9499999999999999e-301Initial program 100.0%
Taylor expanded in t around inf 84.4%
Taylor expanded in x around inf 58.3%
Final simplification53.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y t))) (t_2 (* z (- t))))
(if (<= z -6.5e+210)
t_2
(if (<= z -6.4e+171)
(* z x)
(if (<= z -1.95e+43)
t_2
(if (<= z -4.5e-87)
t_1
(if (<= z -4.3e-184)
(- x (* y x))
(if (<= z 1.35e+19) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double t_2 = z * -t;
double tmp;
if (z <= -6.5e+210) {
tmp = t_2;
} else if (z <= -6.4e+171) {
tmp = z * x;
} else if (z <= -1.95e+43) {
tmp = t_2;
} else if (z <= -4.5e-87) {
tmp = t_1;
} else if (z <= -4.3e-184) {
tmp = x - (y * x);
} else if (z <= 1.35e+19) {
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 + (y * t)
t_2 = z * -t
if (z <= (-6.5d+210)) then
tmp = t_2
else if (z <= (-6.4d+171)) then
tmp = z * x
else if (z <= (-1.95d+43)) then
tmp = t_2
else if (z <= (-4.5d-87)) then
tmp = t_1
else if (z <= (-4.3d-184)) then
tmp = x - (y * x)
else if (z <= 1.35d+19) 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 + (y * t);
double t_2 = z * -t;
double tmp;
if (z <= -6.5e+210) {
tmp = t_2;
} else if (z <= -6.4e+171) {
tmp = z * x;
} else if (z <= -1.95e+43) {
tmp = t_2;
} else if (z <= -4.5e-87) {
tmp = t_1;
} else if (z <= -4.3e-184) {
tmp = x - (y * x);
} else if (z <= 1.35e+19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * t) t_2 = z * -t tmp = 0 if z <= -6.5e+210: tmp = t_2 elif z <= -6.4e+171: tmp = z * x elif z <= -1.95e+43: tmp = t_2 elif z <= -4.5e-87: tmp = t_1 elif z <= -4.3e-184: tmp = x - (y * x) elif z <= 1.35e+19: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * t)) t_2 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -6.5e+210) tmp = t_2; elseif (z <= -6.4e+171) tmp = Float64(z * x); elseif (z <= -1.95e+43) tmp = t_2; elseif (z <= -4.5e-87) tmp = t_1; elseif (z <= -4.3e-184) tmp = Float64(x - Float64(y * x)); elseif (z <= 1.35e+19) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * t); t_2 = z * -t; tmp = 0.0; if (z <= -6.5e+210) tmp = t_2; elseif (z <= -6.4e+171) tmp = z * x; elseif (z <= -1.95e+43) tmp = t_2; elseif (z <= -4.5e-87) tmp = t_1; elseif (z <= -4.3e-184) tmp = x - (y * x); elseif (z <= 1.35e+19) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -6.5e+210], t$95$2, If[LessEqual[z, -6.4e+171], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.95e+43], t$95$2, If[LessEqual[z, -4.5e-87], t$95$1, If[LessEqual[z, -4.3e-184], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+19], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot t\\
t_2 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+210}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{+171}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{+43}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-184}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -6.4999999999999996e210 or -6.40000000000000022e171 < z < -1.95e43 or 1.35e19 < z Initial program 100.0%
Taylor expanded in t around inf 61.4%
Taylor expanded in z around inf 54.5%
mul-1-neg54.5%
distribute-rgt-neg-out54.5%
Simplified54.5%
if -6.4999999999999996e210 < z < -6.40000000000000022e171Initial program 100.0%
Taylor expanded in x around inf 59.4%
*-commutative59.4%
mul-1-neg59.4%
unsub-neg59.4%
distribute-lft-out--59.4%
*-rgt-identity59.4%
Simplified59.4%
Taylor expanded in z around inf 58.7%
if -1.95e43 < z < -4.49999999999999958e-87 or -4.30000000000000007e-184 < z < 1.35e19Initial program 100.0%
Taylor expanded in t around inf 83.7%
Taylor expanded in z around 0 76.3%
if -4.49999999999999958e-87 < z < -4.30000000000000007e-184Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in t around 0 83.6%
mul-1-neg83.6%
sub-neg83.6%
Simplified83.6%
Final simplification66.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))) (t_2 (+ x (* y t))))
(if (<= z -2.3e+216)
(* z (- t))
(if (<= z -1.1e+153)
(* z x)
(if (<= z -3.5e-28)
t_1
(if (<= z -5.8e-91)
t_2
(if (<= z -6e-188) (- x (* y x)) (if (<= z 1.4e+19) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double t_2 = x + (y * t);
double tmp;
if (z <= -2.3e+216) {
tmp = z * -t;
} else if (z <= -1.1e+153) {
tmp = z * x;
} else if (z <= -3.5e-28) {
tmp = t_1;
} else if (z <= -5.8e-91) {
tmp = t_2;
} else if (z <= -6e-188) {
tmp = x - (y * x);
} else if (z <= 1.4e+19) {
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 = x - (z * t)
t_2 = x + (y * t)
if (z <= (-2.3d+216)) then
tmp = z * -t
else if (z <= (-1.1d+153)) then
tmp = z * x
else if (z <= (-3.5d-28)) then
tmp = t_1
else if (z <= (-5.8d-91)) then
tmp = t_2
else if (z <= (-6d-188)) then
tmp = x - (y * x)
else if (z <= 1.4d+19) 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 = x - (z * t);
double t_2 = x + (y * t);
double tmp;
if (z <= -2.3e+216) {
tmp = z * -t;
} else if (z <= -1.1e+153) {
tmp = z * x;
} else if (z <= -3.5e-28) {
tmp = t_1;
} else if (z <= -5.8e-91) {
tmp = t_2;
} else if (z <= -6e-188) {
tmp = x - (y * x);
} else if (z <= 1.4e+19) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) t_2 = x + (y * t) tmp = 0 if z <= -2.3e+216: tmp = z * -t elif z <= -1.1e+153: tmp = z * x elif z <= -3.5e-28: tmp = t_1 elif z <= -5.8e-91: tmp = t_2 elif z <= -6e-188: tmp = x - (y * x) elif z <= 1.4e+19: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) t_2 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -2.3e+216) tmp = Float64(z * Float64(-t)); elseif (z <= -1.1e+153) tmp = Float64(z * x); elseif (z <= -3.5e-28) tmp = t_1; elseif (z <= -5.8e-91) tmp = t_2; elseif (z <= -6e-188) tmp = Float64(x - Float64(y * x)); elseif (z <= 1.4e+19) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); t_2 = x + (y * t); tmp = 0.0; if (z <= -2.3e+216) tmp = z * -t; elseif (z <= -1.1e+153) tmp = z * x; elseif (z <= -3.5e-28) tmp = t_1; elseif (z <= -5.8e-91) tmp = t_2; elseif (z <= -6e-188) tmp = x - (y * x); elseif (z <= 1.4e+19) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+216], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, -1.1e+153], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.5e-28], t$95$1, If[LessEqual[z, -5.8e-91], t$95$2, If[LessEqual[z, -6e-188], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+19], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
t_2 := x + y \cdot t\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+216}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{+153}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-188}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.29999999999999996e216Initial program 100.0%
Taylor expanded in t around inf 78.6%
Taylor expanded in z around inf 72.2%
mul-1-neg72.2%
distribute-rgt-neg-out72.2%
Simplified72.2%
if -2.29999999999999996e216 < z < -1.1e153Initial program 100.0%
Taylor expanded in x around inf 59.4%
*-commutative59.4%
mul-1-neg59.4%
unsub-neg59.4%
distribute-lft-out--59.4%
*-rgt-identity59.4%
Simplified59.4%
Taylor expanded in z around inf 58.7%
if -1.1e153 < z < -3.5e-28 or 1.4e19 < z Initial program 100.0%
Taylor expanded in y around 0 76.7%
+-commutative76.7%
mul-1-neg76.7%
unsub-neg76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in t around inf 52.6%
*-commutative52.6%
Simplified52.6%
if -3.5e-28 < z < -5.8000000000000001e-91 or -6.00000000000000033e-188 < z < 1.4e19Initial program 100.0%
Taylor expanded in t around inf 82.7%
Taylor expanded in z around 0 79.5%
if -5.8000000000000001e-91 < z < -6.00000000000000033e-188Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in t around 0 83.6%
mul-1-neg83.6%
sub-neg83.6%
Simplified83.6%
Final simplification67.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -4.5e+213)
t_1
(if (<= z -2.15e+164)
(* z x)
(if (<= z -3.5e-28)
t_1
(if (<= z -1.2e-235)
(* y t)
(if (<= z 8.6e-302) x (if (<= z 1.4e+20) (* y t) t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -4.5e+213) {
tmp = t_1;
} else if (z <= -2.15e+164) {
tmp = z * x;
} else if (z <= -3.5e-28) {
tmp = t_1;
} else if (z <= -1.2e-235) {
tmp = y * t;
} else if (z <= 8.6e-302) {
tmp = x;
} else if (z <= 1.4e+20) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * -t
if (z <= (-4.5d+213)) then
tmp = t_1
else if (z <= (-2.15d+164)) then
tmp = z * x
else if (z <= (-3.5d-28)) then
tmp = t_1
else if (z <= (-1.2d-235)) then
tmp = y * t
else if (z <= 8.6d-302) then
tmp = x
else if (z <= 1.4d+20) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -4.5e+213) {
tmp = t_1;
} else if (z <= -2.15e+164) {
tmp = z * x;
} else if (z <= -3.5e-28) {
tmp = t_1;
} else if (z <= -1.2e-235) {
tmp = y * t;
} else if (z <= 8.6e-302) {
tmp = x;
} else if (z <= 1.4e+20) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -4.5e+213: tmp = t_1 elif z <= -2.15e+164: tmp = z * x elif z <= -3.5e-28: tmp = t_1 elif z <= -1.2e-235: tmp = y * t elif z <= 8.6e-302: tmp = x elif z <= 1.4e+20: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -4.5e+213) tmp = t_1; elseif (z <= -2.15e+164) tmp = Float64(z * x); elseif (z <= -3.5e-28) tmp = t_1; elseif (z <= -1.2e-235) tmp = Float64(y * t); elseif (z <= 8.6e-302) tmp = x; elseif (z <= 1.4e+20) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -4.5e+213) tmp = t_1; elseif (z <= -2.15e+164) tmp = z * x; elseif (z <= -3.5e-28) tmp = t_1; elseif (z <= -1.2e-235) tmp = y * t; elseif (z <= 8.6e-302) tmp = x; elseif (z <= 1.4e+20) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -4.5e+213], t$95$1, If[LessEqual[z, -2.15e+164], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.5e-28], t$95$1, If[LessEqual[z, -1.2e-235], N[(y * t), $MachinePrecision], If[LessEqual[z, 8.6e-302], x, If[LessEqual[z, 1.4e+20], N[(y * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+213}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{+164}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-235}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-302}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+20}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.5000000000000002e213 or -2.15e164 < z < -3.5e-28 or 1.4e20 < z Initial program 100.0%
Taylor expanded in t around inf 64.9%
Taylor expanded in z around inf 53.7%
mul-1-neg53.7%
distribute-rgt-neg-out53.7%
Simplified53.7%
if -4.5000000000000002e213 < z < -2.15e164Initial program 100.0%
Taylor expanded in x around inf 59.4%
*-commutative59.4%
mul-1-neg59.4%
unsub-neg59.4%
distribute-lft-out--59.4%
*-rgt-identity59.4%
Simplified59.4%
Taylor expanded in z around inf 58.7%
if -3.5e-28 < z < -1.20000000000000005e-235 or 8.60000000000000041e-302 < z < 1.4e20Initial program 100.0%
Taylor expanded in t around inf 77.2%
Taylor expanded in y around inf 44.6%
if -1.20000000000000005e-235 < z < 8.60000000000000041e-302Initial program 100.0%
Taylor expanded in t around inf 82.9%
Taylor expanded in x around inf 65.4%
Final simplification51.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* (- y z) t))))
(if (<= t -1.35e-64)
t_1
(if (<= t -1.25e-110)
(+ x (* z x))
(if (or (<= t -1.4e-200) (not (<= t 2.6e-35))) t_1 (- x (* y x)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double tmp;
if (t <= -1.35e-64) {
tmp = t_1;
} else if (t <= -1.25e-110) {
tmp = x + (z * x);
} else if ((t <= -1.4e-200) || !(t <= 2.6e-35)) {
tmp = t_1;
} else {
tmp = x - (y * 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) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * t)
if (t <= (-1.35d-64)) then
tmp = t_1
else if (t <= (-1.25d-110)) then
tmp = x + (z * x)
else if ((t <= (-1.4d-200)) .or. (.not. (t <= 2.6d-35))) then
tmp = t_1
else
tmp = x - (y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double tmp;
if (t <= -1.35e-64) {
tmp = t_1;
} else if (t <= -1.25e-110) {
tmp = x + (z * x);
} else if ((t <= -1.4e-200) || !(t <= 2.6e-35)) {
tmp = t_1;
} else {
tmp = x - (y * x);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y - z) * t) tmp = 0 if t <= -1.35e-64: tmp = t_1 elif t <= -1.25e-110: tmp = x + (z * x) elif (t <= -1.4e-200) or not (t <= 2.6e-35): tmp = t_1 else: tmp = x - (y * x) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (t <= -1.35e-64) tmp = t_1; elseif (t <= -1.25e-110) tmp = Float64(x + Float64(z * x)); elseif ((t <= -1.4e-200) || !(t <= 2.6e-35)) tmp = t_1; else tmp = Float64(x - Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y - z) * t); tmp = 0.0; if (t <= -1.35e-64) tmp = t_1; elseif (t <= -1.25e-110) tmp = x + (z * x); elseif ((t <= -1.4e-200) || ~((t <= 2.6e-35))) tmp = t_1; else tmp = x - (y * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e-64], t$95$1, If[LessEqual[t, -1.25e-110], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.4e-200], N[Not[LessEqual[t, 2.6e-35]], $MachinePrecision]], t$95$1, N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-110}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-200} \lor \neg \left(t \leq 2.6 \cdot 10^{-35}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot x\\
\end{array}
\end{array}
if t < -1.34999999999999993e-64 or -1.25e-110 < t < -1.40000000000000003e-200 or 2.60000000000000005e-35 < t Initial program 100.0%
Taylor expanded in t around inf 85.6%
if -1.34999999999999993e-64 < t < -1.25e-110Initial program 100.0%
*-commutative100.0%
flip--73.9%
associate-*r/57.2%
Applied egg-rr57.2%
associate-/l*73.9%
difference-of-squares73.9%
associate-/r*100.0%
*-inverses100.0%
Simplified100.0%
Taylor expanded in y around 0 64.7%
Taylor expanded in t around 0 64.8%
if -1.40000000000000003e-200 < t < 2.60000000000000005e-35Initial program 100.0%
Taylor expanded in z around 0 65.7%
Taylor expanded in t around 0 63.3%
mul-1-neg63.3%
sub-neg63.3%
Simplified63.3%
Final simplification78.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -6.8e+213)
t_1
(if (<= z -4.7e+168)
(* z x)
(if (or (<= z -4.3e+49) (not (<= z 6.2e+21))) t_1 (+ x (* y t)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -6.8e+213) {
tmp = t_1;
} else if (z <= -4.7e+168) {
tmp = z * x;
} else if ((z <= -4.3e+49) || !(z <= 6.2e+21)) {
tmp = t_1;
} else {
tmp = x + (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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (z <= (-6.8d+213)) then
tmp = t_1
else if (z <= (-4.7d+168)) then
tmp = z * x
else if ((z <= (-4.3d+49)) .or. (.not. (z <= 6.2d+21))) then
tmp = t_1
else
tmp = x + (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -6.8e+213) {
tmp = t_1;
} else if (z <= -4.7e+168) {
tmp = z * x;
} else if ((z <= -4.3e+49) || !(z <= 6.2e+21)) {
tmp = t_1;
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -6.8e+213: tmp = t_1 elif z <= -4.7e+168: tmp = z * x elif (z <= -4.3e+49) or not (z <= 6.2e+21): tmp = t_1 else: tmp = x + (y * t) return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -6.8e+213) tmp = t_1; elseif (z <= -4.7e+168) tmp = Float64(z * x); elseif ((z <= -4.3e+49) || !(z <= 6.2e+21)) tmp = t_1; else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -6.8e+213) tmp = t_1; elseif (z <= -4.7e+168) tmp = z * x; elseif ((z <= -4.3e+49) || ~((z <= 6.2e+21))) tmp = t_1; else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -6.8e+213], t$95$1, If[LessEqual[z, -4.7e+168], N[(z * x), $MachinePrecision], If[Or[LessEqual[z, -4.3e+49], N[Not[LessEqual[z, 6.2e+21]], $MachinePrecision]], t$95$1, N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+213}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{+168}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{+49} \lor \neg \left(z \leq 6.2 \cdot 10^{+21}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
if z < -6.79999999999999983e213 or -4.69999999999999961e168 < z < -4.2999999999999999e49 or 6.2e21 < z Initial program 100.0%
Taylor expanded in t around inf 61.4%
Taylor expanded in z around inf 54.5%
mul-1-neg54.5%
distribute-rgt-neg-out54.5%
Simplified54.5%
if -6.79999999999999983e213 < z < -4.69999999999999961e168Initial program 100.0%
Taylor expanded in x around inf 59.4%
*-commutative59.4%
mul-1-neg59.4%
unsub-neg59.4%
distribute-lft-out--59.4%
*-rgt-identity59.4%
Simplified59.4%
Taylor expanded in z around inf 58.7%
if -4.2999999999999999e49 < z < 6.2e21Initial program 100.0%
Taylor expanded in t around inf 79.5%
Taylor expanded in z around 0 72.8%
Final simplification64.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.2e-5) (not (<= y 5.1e+35))) (+ x (* y (- t x))) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.2e-5) || !(y <= 5.1e+35)) {
tmp = x + (y * (t - x));
} else {
tmp = x + ((y - z) * 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 <= (-3.2d-5)) .or. (.not. (y <= 5.1d+35))) then
tmp = x + (y * (t - x))
else
tmp = x + ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.2e-5) || !(y <= 5.1e+35)) {
tmp = x + (y * (t - x));
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.2e-5) or not (y <= 5.1e+35): tmp = x + (y * (t - x)) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.2e-5) || !(y <= 5.1e+35)) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.2e-5) || ~((y <= 5.1e+35))) tmp = x + (y * (t - x)); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.2e-5], N[Not[LessEqual[y, 5.1e+35]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-5} \lor \neg \left(y \leq 5.1 \cdot 10^{+35}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if y < -3.19999999999999986e-5 or 5.10000000000000017e35 < y Initial program 100.0%
Taylor expanded in z around 0 83.6%
if -3.19999999999999986e-5 < y < 5.10000000000000017e35Initial program 100.0%
Taylor expanded in t around inf 79.9%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.6e-63) (not (<= t 2.8e-33))) (+ x (* (- y z) t)) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.6e-63) || !(t <= 2.8e-33)) {
tmp = x + ((y - z) * t);
} 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 <= (-1.6d-63)) .or. (.not. (t <= 2.8d-33))) then
tmp = x + ((y - z) * t)
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 <= -1.6e-63) || !(t <= 2.8e-33)) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.6e-63) or not (t <= 2.8e-33): tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.6e-63) || !(t <= 2.8e-33)) tmp = Float64(x + Float64(Float64(y - z) * t)); 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 <= -1.6e-63) || ~((t <= 2.8e-33))) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.6e-63], N[Not[LessEqual[t, 2.8e-33]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-63} \lor \neg \left(t \leq 2.8 \cdot 10^{-33}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -1.59999999999999994e-63 or 2.8e-33 < t Initial program 100.0%
Taylor expanded in t around inf 88.6%
if -1.59999999999999994e-63 < t < 2.8e-33Initial program 100.0%
Taylor expanded in x around inf 83.9%
*-commutative83.9%
mul-1-neg83.9%
unsub-neg83.9%
distribute-lft-out--83.9%
*-rgt-identity83.9%
Simplified83.9%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -0.0135) (not (<= y 1.05e+35))) (+ x (* y (- t x))) (- x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.0135) || !(y <= 1.05e+35)) {
tmp = x + (y * (t - x));
} else {
tmp = x - (z * (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 ((y <= (-0.0135d0)) .or. (.not. (y <= 1.05d+35))) then
tmp = x + (y * (t - x))
else
tmp = x - (z * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.0135) || !(y <= 1.05e+35)) {
tmp = x + (y * (t - x));
} else {
tmp = x - (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -0.0135) or not (y <= 1.05e+35): tmp = x + (y * (t - x)) else: tmp = x - (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -0.0135) || !(y <= 1.05e+35)) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x - Float64(z * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -0.0135) || ~((y <= 1.05e+35))) tmp = x + (y * (t - x)); else tmp = x - (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -0.0135], N[Not[LessEqual[y, 1.05e+35]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0135 \lor \neg \left(y \leq 1.05 \cdot 10^{+35}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < -0.0134999999999999998 or 1.0499999999999999e35 < y Initial program 100.0%
Taylor expanded in z around 0 83.6%
if -0.0134999999999999998 < y < 1.0499999999999999e35Initial program 100.0%
Taylor expanded in y around 0 91.7%
+-commutative91.7%
mul-1-neg91.7%
unsub-neg91.7%
*-commutative91.7%
Simplified91.7%
Final simplification87.9%
(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 (if (<= y -0.054) (* y t) (if (<= y 1.5e-106) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.054) {
tmp = y * t;
} else if (y <= 1.5e-106) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-0.054d0)) then
tmp = y * t
else if (y <= 1.5d-106) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.054) {
tmp = y * t;
} else if (y <= 1.5e-106) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.054: tmp = y * t elif y <= 1.5e-106: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.054) tmp = Float64(y * t); elseif (y <= 1.5e-106) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -0.054) tmp = y * t; elseif (y <= 1.5e-106) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.054], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.5e-106], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.054:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -0.0539999999999999994 or 1.50000000000000009e-106 < y Initial program 100.0%
Taylor expanded in t around inf 60.7%
Taylor expanded in y around inf 47.6%
if -0.0539999999999999994 < y < 1.50000000000000009e-106Initial program 100.0%
Taylor expanded in t around inf 81.7%
Taylor expanded in x around inf 40.4%
Final simplification44.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 70.3%
Taylor expanded in x around inf 20.5%
Final simplification20.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 2023214
(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))))