
(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-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z 1.0))) (t_2 (* y (- t x))) (t_3 (* z (- t))))
(if (<= y -8.2e+39)
t_2
(if (<= y -6.5e-129)
t_3
(if (<= y -1.34e-188)
t_1
(if (<= y -3.2e-266)
t_3
(if (<= y 2.3e-180)
t_1
(if (<= y 9.5e-98)
t_3
(if (<= y 6.6e-56)
t_1
(if (<= y 3.15e-49) t_3 (if (<= y 1.2) t_1 t_2)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double t_2 = y * (t - x);
double t_3 = z * -t;
double tmp;
if (y <= -8.2e+39) {
tmp = t_2;
} else if (y <= -6.5e-129) {
tmp = t_3;
} else if (y <= -1.34e-188) {
tmp = t_1;
} else if (y <= -3.2e-266) {
tmp = t_3;
} else if (y <= 2.3e-180) {
tmp = t_1;
} else if (y <= 9.5e-98) {
tmp = t_3;
} else if (y <= 6.6e-56) {
tmp = t_1;
} else if (y <= 3.15e-49) {
tmp = t_3;
} else if (y <= 1.2) {
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) :: t_3
real(8) :: tmp
t_1 = x * (z + 1.0d0)
t_2 = y * (t - x)
t_3 = z * -t
if (y <= (-8.2d+39)) then
tmp = t_2
else if (y <= (-6.5d-129)) then
tmp = t_3
else if (y <= (-1.34d-188)) then
tmp = t_1
else if (y <= (-3.2d-266)) then
tmp = t_3
else if (y <= 2.3d-180) then
tmp = t_1
else if (y <= 9.5d-98) then
tmp = t_3
else if (y <= 6.6d-56) then
tmp = t_1
else if (y <= 3.15d-49) then
tmp = t_3
else if (y <= 1.2d0) 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 * (z + 1.0);
double t_2 = y * (t - x);
double t_3 = z * -t;
double tmp;
if (y <= -8.2e+39) {
tmp = t_2;
} else if (y <= -6.5e-129) {
tmp = t_3;
} else if (y <= -1.34e-188) {
tmp = t_1;
} else if (y <= -3.2e-266) {
tmp = t_3;
} else if (y <= 2.3e-180) {
tmp = t_1;
} else if (y <= 9.5e-98) {
tmp = t_3;
} else if (y <= 6.6e-56) {
tmp = t_1;
} else if (y <= 3.15e-49) {
tmp = t_3;
} else if (y <= 1.2) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + 1.0) t_2 = y * (t - x) t_3 = z * -t tmp = 0 if y <= -8.2e+39: tmp = t_2 elif y <= -6.5e-129: tmp = t_3 elif y <= -1.34e-188: tmp = t_1 elif y <= -3.2e-266: tmp = t_3 elif y <= 2.3e-180: tmp = t_1 elif y <= 9.5e-98: tmp = t_3 elif y <= 6.6e-56: tmp = t_1 elif y <= 3.15e-49: tmp = t_3 elif y <= 1.2: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + 1.0)) t_2 = Float64(y * Float64(t - x)) t_3 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -8.2e+39) tmp = t_2; elseif (y <= -6.5e-129) tmp = t_3; elseif (y <= -1.34e-188) tmp = t_1; elseif (y <= -3.2e-266) tmp = t_3; elseif (y <= 2.3e-180) tmp = t_1; elseif (y <= 9.5e-98) tmp = t_3; elseif (y <= 6.6e-56) tmp = t_1; elseif (y <= 3.15e-49) tmp = t_3; elseif (y <= 1.2) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + 1.0); t_2 = y * (t - x); t_3 = z * -t; tmp = 0.0; if (y <= -8.2e+39) tmp = t_2; elseif (y <= -6.5e-129) tmp = t_3; elseif (y <= -1.34e-188) tmp = t_1; elseif (y <= -3.2e-266) tmp = t_3; elseif (y <= 2.3e-180) tmp = t_1; elseif (y <= 9.5e-98) tmp = t_3; elseif (y <= 6.6e-56) tmp = t_1; elseif (y <= 3.15e-49) tmp = t_3; elseif (y <= 1.2) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -8.2e+39], t$95$2, If[LessEqual[y, -6.5e-129], t$95$3, If[LessEqual[y, -1.34e-188], t$95$1, If[LessEqual[y, -3.2e-266], t$95$3, If[LessEqual[y, 2.3e-180], t$95$1, If[LessEqual[y, 9.5e-98], t$95$3, If[LessEqual[y, 6.6e-56], t$95$1, If[LessEqual[y, 3.15e-49], t$95$3, If[LessEqual[y, 1.2], t$95$1, t$95$2]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + 1\right)\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-129}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -1.34 \cdot 10^{-188}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-266}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-180}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{-49}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 1.2:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -8.20000000000000008e39 or 1.19999999999999996 < y Initial program 100.0%
Taylor expanded in y around inf 79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in x around -inf 73.9%
+-commutative73.9%
mul-1-neg73.9%
unsub-neg73.9%
sub-neg73.9%
metadata-eval73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in y around inf 79.5%
if -8.20000000000000008e39 < y < -6.49999999999999952e-129 or -1.34e-188 < y < -3.2e-266 or 2.29999999999999996e-180 < y < 9.5000000000000001e-98 or 6.59999999999999967e-56 < y < 3.1499999999999998e-49Initial program 100.0%
Taylor expanded in t around inf 82.5%
Taylor expanded in y around 0 68.7%
mul-1-neg68.7%
unsub-neg68.7%
Simplified68.7%
Taylor expanded in x around 0 60.9%
mul-1-neg60.9%
distribute-rgt-neg-out60.9%
Simplified60.9%
if -6.49999999999999952e-129 < y < -1.34e-188 or -3.2e-266 < y < 2.29999999999999996e-180 or 9.5000000000000001e-98 < y < 6.59999999999999967e-56 or 3.1499999999999998e-49 < y < 1.19999999999999996Initial program 100.0%
Taylor expanded in y around 0 91.7%
mul-1-neg91.7%
unsub-neg91.7%
Simplified91.7%
Taylor expanded in x around inf 67.9%
cancel-sign-sub-inv67.9%
metadata-eval67.9%
*-lft-identity67.9%
+-commutative67.9%
Simplified67.9%
Final simplification70.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* x (+ z 1.0))))
(if (<= x -2.5e-102)
t_2
(if (<= x -2.6e-139)
(* y t)
(if (<= x 6.2e-292)
t_1
(if (<= x 4.3e-255)
(* y t)
(if (<= x 1.16e-93)
t_1
(if (or (<= x 4.1e+84) (not (<= x 1.2e+135)))
t_2
(* y (- x))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (z + 1.0);
double tmp;
if (x <= -2.5e-102) {
tmp = t_2;
} else if (x <= -2.6e-139) {
tmp = y * t;
} else if (x <= 6.2e-292) {
tmp = t_1;
} else if (x <= 4.3e-255) {
tmp = y * t;
} else if (x <= 1.16e-93) {
tmp = t_1;
} else if ((x <= 4.1e+84) || !(x <= 1.2e+135)) {
tmp = t_2;
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_1 = z * -t
t_2 = x * (z + 1.0d0)
if (x <= (-2.5d-102)) then
tmp = t_2
else if (x <= (-2.6d-139)) then
tmp = y * t
else if (x <= 6.2d-292) then
tmp = t_1
else if (x <= 4.3d-255) then
tmp = y * t
else if (x <= 1.16d-93) then
tmp = t_1
else if ((x <= 4.1d+84) .or. (.not. (x <= 1.2d+135))) then
tmp = t_2
else
tmp = y * -x
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 = x * (z + 1.0);
double tmp;
if (x <= -2.5e-102) {
tmp = t_2;
} else if (x <= -2.6e-139) {
tmp = y * t;
} else if (x <= 6.2e-292) {
tmp = t_1;
} else if (x <= 4.3e-255) {
tmp = y * t;
} else if (x <= 1.16e-93) {
tmp = t_1;
} else if ((x <= 4.1e+84) || !(x <= 1.2e+135)) {
tmp = t_2;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = x * (z + 1.0) tmp = 0 if x <= -2.5e-102: tmp = t_2 elif x <= -2.6e-139: tmp = y * t elif x <= 6.2e-292: tmp = t_1 elif x <= 4.3e-255: tmp = y * t elif x <= 1.16e-93: tmp = t_1 elif (x <= 4.1e+84) or not (x <= 1.2e+135): tmp = t_2 else: tmp = y * -x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (x <= -2.5e-102) tmp = t_2; elseif (x <= -2.6e-139) tmp = Float64(y * t); elseif (x <= 6.2e-292) tmp = t_1; elseif (x <= 4.3e-255) tmp = Float64(y * t); elseif (x <= 1.16e-93) tmp = t_1; elseif ((x <= 4.1e+84) || !(x <= 1.2e+135)) tmp = t_2; else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = x * (z + 1.0); tmp = 0.0; if (x <= -2.5e-102) tmp = t_2; elseif (x <= -2.6e-139) tmp = y * t; elseif (x <= 6.2e-292) tmp = t_1; elseif (x <= 4.3e-255) tmp = y * t; elseif (x <= 1.16e-93) tmp = t_1; elseif ((x <= 4.1e+84) || ~((x <= 1.2e+135))) tmp = t_2; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e-102], t$95$2, If[LessEqual[x, -2.6e-139], N[(y * t), $MachinePrecision], If[LessEqual[x, 6.2e-292], t$95$1, If[LessEqual[x, 4.3e-255], N[(y * t), $MachinePrecision], If[LessEqual[x, 1.16e-93], t$95$1, If[Or[LessEqual[x, 4.1e+84], N[Not[LessEqual[x, 1.2e+135]], $MachinePrecision]], t$95$2, N[(y * (-x)), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-139}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-292}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-255}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+84} \lor \neg \left(x \leq 1.2 \cdot 10^{+135}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -2.50000000000000013e-102 or 1.15999999999999998e-93 < x < 4.1000000000000003e84 or 1.19999999999999999e135 < x Initial program 100.0%
Taylor expanded in y around 0 68.5%
mul-1-neg68.5%
unsub-neg68.5%
Simplified68.5%
Taylor expanded in x around inf 55.1%
cancel-sign-sub-inv55.1%
metadata-eval55.1%
*-lft-identity55.1%
+-commutative55.1%
Simplified55.1%
if -2.50000000000000013e-102 < x < -2.5999999999999998e-139 or 6.1999999999999999e-292 < x < 4.29999999999999989e-255Initial program 99.9%
Taylor expanded in y around inf 72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in x around -inf 72.2%
+-commutative72.2%
mul-1-neg72.2%
unsub-neg72.2%
sub-neg72.2%
metadata-eval72.2%
+-commutative72.2%
Simplified72.2%
Taylor expanded in t around inf 61.7%
*-commutative61.7%
Simplified61.7%
if -2.5999999999999998e-139 < x < 6.1999999999999999e-292 or 4.29999999999999989e-255 < x < 1.15999999999999998e-93Initial program 100.0%
Taylor expanded in t around inf 96.6%
Taylor expanded in y around 0 72.8%
mul-1-neg72.8%
unsub-neg72.8%
Simplified72.8%
Taylor expanded in x around 0 64.5%
mul-1-neg64.5%
distribute-rgt-neg-out64.5%
Simplified64.5%
if 4.1000000000000003e84 < x < 1.19999999999999999e135Initial program 100.0%
Taylor expanded in y around inf 76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in x around inf 60.4%
mul-1-neg60.4%
unsub-neg60.4%
Simplified60.4%
Taylor expanded in y around inf 51.8%
*-commutative51.8%
neg-mul-151.8%
distribute-rgt-neg-in51.8%
Simplified51.8%
Final simplification58.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (* z (- t))))
(if (<= z -4e+198)
(* x (+ z 1.0))
(if (<= z -43000000000.0)
t_2
(if (<= z 6e-267)
t_1
(if (<= z 1.36e-185)
(* y t)
(if (<= z 4.8e-159) t_1 (if (<= z 2.9e+31) (* y t) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = z * -t;
double tmp;
if (z <= -4e+198) {
tmp = x * (z + 1.0);
} else if (z <= -43000000000.0) {
tmp = t_2;
} else if (z <= 6e-267) {
tmp = t_1;
} else if (z <= 1.36e-185) {
tmp = y * t;
} else if (z <= 4.8e-159) {
tmp = t_1;
} else if (z <= 2.9e+31) {
tmp = y * t;
} 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 * (1.0d0 - y)
t_2 = z * -t
if (z <= (-4d+198)) then
tmp = x * (z + 1.0d0)
else if (z <= (-43000000000.0d0)) then
tmp = t_2
else if (z <= 6d-267) then
tmp = t_1
else if (z <= 1.36d-185) then
tmp = y * t
else if (z <= 4.8d-159) then
tmp = t_1
else if (z <= 2.9d+31) then
tmp = y * t
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 * (1.0 - y);
double t_2 = z * -t;
double tmp;
if (z <= -4e+198) {
tmp = x * (z + 1.0);
} else if (z <= -43000000000.0) {
tmp = t_2;
} else if (z <= 6e-267) {
tmp = t_1;
} else if (z <= 1.36e-185) {
tmp = y * t;
} else if (z <= 4.8e-159) {
tmp = t_1;
} else if (z <= 2.9e+31) {
tmp = y * t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = z * -t tmp = 0 if z <= -4e+198: tmp = x * (z + 1.0) elif z <= -43000000000.0: tmp = t_2 elif z <= 6e-267: tmp = t_1 elif z <= 1.36e-185: tmp = y * t elif z <= 4.8e-159: tmp = t_1 elif z <= 2.9e+31: tmp = y * t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -4e+198) tmp = Float64(x * Float64(z + 1.0)); elseif (z <= -43000000000.0) tmp = t_2; elseif (z <= 6e-267) tmp = t_1; elseif (z <= 1.36e-185) tmp = Float64(y * t); elseif (z <= 4.8e-159) tmp = t_1; elseif (z <= 2.9e+31) tmp = Float64(y * t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = z * -t; tmp = 0.0; if (z <= -4e+198) tmp = x * (z + 1.0); elseif (z <= -43000000000.0) tmp = t_2; elseif (z <= 6e-267) tmp = t_1; elseif (z <= 1.36e-185) tmp = y * t; elseif (z <= 4.8e-159) tmp = t_1; elseif (z <= 2.9e+31) tmp = y * t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -4e+198], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -43000000000.0], t$95$2, If[LessEqual[z, 6e-267], t$95$1, If[LessEqual[z, 1.36e-185], N[(y * t), $MachinePrecision], If[LessEqual[z, 4.8e-159], t$95$1, If[LessEqual[z, 2.9e+31], N[(y * t), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{+198}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;z \leq -43000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-267}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{-185}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+31}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.00000000000000007e198Initial program 100.0%
Taylor expanded in y around 0 97.1%
mul-1-neg97.1%
unsub-neg97.1%
Simplified97.1%
Taylor expanded in x around inf 63.7%
cancel-sign-sub-inv63.7%
metadata-eval63.7%
*-lft-identity63.7%
+-commutative63.7%
Simplified63.7%
if -4.00000000000000007e198 < z < -4.3e10 or 2.9e31 < z Initial program 100.0%
Taylor expanded in t around inf 66.4%
Taylor expanded in y around 0 58.3%
mul-1-neg58.3%
unsub-neg58.3%
Simplified58.3%
Taylor expanded in x around 0 58.2%
mul-1-neg58.2%
distribute-rgt-neg-out58.2%
Simplified58.2%
if -4.3e10 < z < 5.9999999999999999e-267 or 1.36e-185 < z < 4.79999999999999995e-159Initial program 100.0%
Taylor expanded in y around inf 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in x around inf 60.0%
mul-1-neg60.0%
unsub-neg60.0%
Simplified60.0%
if 5.9999999999999999e-267 < z < 1.36e-185 or 4.79999999999999995e-159 < z < 2.9e31Initial program 99.9%
Taylor expanded in y around inf 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in x around -inf 88.1%
+-commutative88.1%
mul-1-neg88.1%
unsub-neg88.1%
sub-neg88.1%
metadata-eval88.1%
+-commutative88.1%
Simplified88.1%
Taylor expanded in t around inf 60.3%
*-commutative60.3%
Simplified60.3%
Final simplification59.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))) (t_2 (* x (+ (- z y) 1.0))))
(if (<= x -1.5e-102)
t_2
(if (<= x -2.65e-139)
(* y (- t x))
(if (<= x 3.3e-292)
t_1
(if (<= x 4.05e-255) (+ x (* y t)) (if (<= x 3.2e-30) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double t_2 = x * ((z - y) + 1.0);
double tmp;
if (x <= -1.5e-102) {
tmp = t_2;
} else if (x <= -2.65e-139) {
tmp = y * (t - x);
} else if (x <= 3.3e-292) {
tmp = t_1;
} else if (x <= 4.05e-255) {
tmp = x + (y * t);
} else if (x <= 3.2e-30) {
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 - (z * t)
t_2 = x * ((z - y) + 1.0d0)
if (x <= (-1.5d-102)) then
tmp = t_2
else if (x <= (-2.65d-139)) then
tmp = y * (t - x)
else if (x <= 3.3d-292) then
tmp = t_1
else if (x <= 4.05d-255) then
tmp = x + (y * t)
else if (x <= 3.2d-30) 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 - (z * t);
double t_2 = x * ((z - y) + 1.0);
double tmp;
if (x <= -1.5e-102) {
tmp = t_2;
} else if (x <= -2.65e-139) {
tmp = y * (t - x);
} else if (x <= 3.3e-292) {
tmp = t_1;
} else if (x <= 4.05e-255) {
tmp = x + (y * t);
} else if (x <= 3.2e-30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) t_2 = x * ((z - y) + 1.0) tmp = 0 if x <= -1.5e-102: tmp = t_2 elif x <= -2.65e-139: tmp = y * (t - x) elif x <= 3.3e-292: tmp = t_1 elif x <= 4.05e-255: tmp = x + (y * t) elif x <= 3.2e-30: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) t_2 = Float64(x * Float64(Float64(z - y) + 1.0)) tmp = 0.0 if (x <= -1.5e-102) tmp = t_2; elseif (x <= -2.65e-139) tmp = Float64(y * Float64(t - x)); elseif (x <= 3.3e-292) tmp = t_1; elseif (x <= 4.05e-255) tmp = Float64(x + Float64(y * t)); elseif (x <= 3.2e-30) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); t_2 = x * ((z - y) + 1.0); tmp = 0.0; if (x <= -1.5e-102) tmp = t_2; elseif (x <= -2.65e-139) tmp = y * (t - x); elseif (x <= 3.3e-292) tmp = t_1; elseif (x <= 4.05e-255) tmp = x + (y * t); elseif (x <= 3.2e-30) tmp = t_1; else tmp = t_2; 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[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e-102], t$95$2, If[LessEqual[x, -2.65e-139], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e-292], t$95$1, If[LessEqual[x, 4.05e-255], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e-30], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
t_2 := x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{-102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.65 \cdot 10^{-139}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-292}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.05 \cdot 10^{-255}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.5e-102 or 3.2e-30 < x Initial program 100.0%
Taylor expanded in x around inf 80.0%
mul-1-neg80.0%
unsub-neg80.0%
Simplified80.0%
if -1.5e-102 < x < -2.6499999999999998e-139Initial program 99.9%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in x around -inf 75.7%
+-commutative75.7%
mul-1-neg75.7%
unsub-neg75.7%
sub-neg75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in y around inf 75.7%
if -2.6499999999999998e-139 < x < 3.29999999999999995e-292 or 4.05e-255 < x < 3.2e-30Initial program 100.0%
Taylor expanded in t around inf 94.9%
Taylor expanded in y around 0 70.7%
mul-1-neg70.7%
unsub-neg70.7%
Simplified70.7%
if 3.29999999999999995e-292 < x < 4.05e-255Initial program 99.9%
Taylor expanded in t around inf 82.1%
Taylor expanded in z around 0 64.4%
Final simplification75.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y t))) (t_2 (* z (- t))))
(if (<= z -2.3e+198)
(* x (+ z 1.0))
(if (<= z -175000000.0)
t_2
(if (<= z 2.25e-268)
t_1
(if (<= z 2.85e-164) (* y (- t x)) (if (<= z 9.5e+29) 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 <= -2.3e+198) {
tmp = x * (z + 1.0);
} else if (z <= -175000000.0) {
tmp = t_2;
} else if (z <= 2.25e-268) {
tmp = t_1;
} else if (z <= 2.85e-164) {
tmp = y * (t - x);
} else if (z <= 9.5e+29) {
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 <= (-2.3d+198)) then
tmp = x * (z + 1.0d0)
else if (z <= (-175000000.0d0)) then
tmp = t_2
else if (z <= 2.25d-268) then
tmp = t_1
else if (z <= 2.85d-164) then
tmp = y * (t - x)
else if (z <= 9.5d+29) 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 <= -2.3e+198) {
tmp = x * (z + 1.0);
} else if (z <= -175000000.0) {
tmp = t_2;
} else if (z <= 2.25e-268) {
tmp = t_1;
} else if (z <= 2.85e-164) {
tmp = y * (t - x);
} else if (z <= 9.5e+29) {
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 <= -2.3e+198: tmp = x * (z + 1.0) elif z <= -175000000.0: tmp = t_2 elif z <= 2.25e-268: tmp = t_1 elif z <= 2.85e-164: tmp = y * (t - x) elif z <= 9.5e+29: 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 <= -2.3e+198) tmp = Float64(x * Float64(z + 1.0)); elseif (z <= -175000000.0) tmp = t_2; elseif (z <= 2.25e-268) tmp = t_1; elseif (z <= 2.85e-164) tmp = Float64(y * Float64(t - x)); elseif (z <= 9.5e+29) 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 <= -2.3e+198) tmp = x * (z + 1.0); elseif (z <= -175000000.0) tmp = t_2; elseif (z <= 2.25e-268) tmp = t_1; elseif (z <= 2.85e-164) tmp = y * (t - x); elseif (z <= 9.5e+29) 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, -2.3e+198], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -175000000.0], t$95$2, If[LessEqual[z, 2.25e-268], t$95$1, If[LessEqual[z, 2.85e-164], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+29], 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 -2.3 \cdot 10^{+198}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;z \leq -175000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-164}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.3000000000000001e198Initial program 100.0%
Taylor expanded in y around 0 97.1%
mul-1-neg97.1%
unsub-neg97.1%
Simplified97.1%
Taylor expanded in x around inf 63.7%
cancel-sign-sub-inv63.7%
metadata-eval63.7%
*-lft-identity63.7%
+-commutative63.7%
Simplified63.7%
if -2.3000000000000001e198 < z < -1.75e8 or 9.5000000000000003e29 < z Initial program 100.0%
Taylor expanded in t around inf 66.4%
Taylor expanded in y around 0 58.3%
mul-1-neg58.3%
unsub-neg58.3%
Simplified58.3%
Taylor expanded in x around 0 58.2%
mul-1-neg58.2%
distribute-rgt-neg-out58.2%
Simplified58.2%
if -1.75e8 < z < 2.2500000000000001e-268 or 2.85000000000000011e-164 < z < 9.5000000000000003e29Initial program 100.0%
Taylor expanded in t around inf 79.0%
Taylor expanded in z around 0 69.1%
if 2.2500000000000001e-268 < z < 2.85000000000000011e-164Initial program 99.9%
Taylor expanded in y around inf 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in x around -inf 93.9%
+-commutative93.9%
mul-1-neg93.9%
unsub-neg93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
Taylor expanded in y around inf 84.0%
Final simplification65.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (- x (* z t))))
(if (<= y -7e+39)
t_1
(if (<= y 3.5e-225)
t_2
(if (<= y 2.4e-185) (* x (+ z 1.0)) (if (<= y 5.7e-8) 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 * t);
double tmp;
if (y <= -7e+39) {
tmp = t_1;
} else if (y <= 3.5e-225) {
tmp = t_2;
} else if (y <= 2.4e-185) {
tmp = x * (z + 1.0);
} else if (y <= 5.7e-8) {
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 * t)
if (y <= (-7d+39)) then
tmp = t_1
else if (y <= 3.5d-225) then
tmp = t_2
else if (y <= 2.4d-185) then
tmp = x * (z + 1.0d0)
else if (y <= 5.7d-8) 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 * t);
double tmp;
if (y <= -7e+39) {
tmp = t_1;
} else if (y <= 3.5e-225) {
tmp = t_2;
} else if (y <= 2.4e-185) {
tmp = x * (z + 1.0);
} else if (y <= 5.7e-8) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x - (z * t) tmp = 0 if y <= -7e+39: tmp = t_1 elif y <= 3.5e-225: tmp = t_2 elif y <= 2.4e-185: tmp = x * (z + 1.0) elif y <= 5.7e-8: 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(z * t)) tmp = 0.0 if (y <= -7e+39) tmp = t_1; elseif (y <= 3.5e-225) tmp = t_2; elseif (y <= 2.4e-185) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 5.7e-8) 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 * t); tmp = 0.0; if (y <= -7e+39) tmp = t_1; elseif (y <= 3.5e-225) tmp = t_2; elseif (y <= 2.4e-185) tmp = x * (z + 1.0); elseif (y <= 5.7e-8) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+39], t$95$1, If[LessEqual[y, 3.5e-225], t$95$2, If[LessEqual[y, 2.4e-185], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.7e-8], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x - z \cdot t\\
\mathbf{if}\;y \leq -7 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-225}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-185}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{-8}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -7.0000000000000003e39 or 5.70000000000000009e-8 < y Initial program 100.0%
Taylor expanded in y around inf 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in x around -inf 73.2%
+-commutative73.2%
mul-1-neg73.2%
unsub-neg73.2%
sub-neg73.2%
metadata-eval73.2%
+-commutative73.2%
Simplified73.2%
Taylor expanded in y around inf 78.9%
if -7.0000000000000003e39 < y < 3.4999999999999997e-225 or 2.4000000000000001e-185 < y < 5.70000000000000009e-8Initial program 100.0%
Taylor expanded in t around inf 79.7%
Taylor expanded in y around 0 68.3%
mul-1-neg68.3%
unsub-neg68.3%
Simplified68.3%
if 3.4999999999999997e-225 < y < 2.4000000000000001e-185Initial program 99.8%
Taylor expanded in y around 0 89.5%
mul-1-neg89.5%
unsub-neg89.5%
Simplified89.5%
Taylor expanded in x around inf 78.4%
cancel-sign-sub-inv78.4%
metadata-eval78.4%
*-lft-identity78.4%
+-commutative78.4%
Simplified78.4%
Final simplification73.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.2e-74) (not (<= x 3.2e+66))) (* x (+ (- z y) 1.0)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.2e-74) || !(x <= 3.2e+66)) {
tmp = x * ((z - y) + 1.0);
} 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 ((x <= (-1.2d-74)) .or. (.not. (x <= 3.2d+66))) then
tmp = x * ((z - y) + 1.0d0)
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 ((x <= -1.2e-74) || !(x <= 3.2e+66)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.2e-74) or not (x <= 3.2e+66): tmp = x * ((z - y) + 1.0) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.2e-74) || !(x <= 3.2e+66)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); 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 ((x <= -1.2e-74) || ~((x <= 3.2e+66))) tmp = x * ((z - y) + 1.0); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.2e-74], N[Not[LessEqual[x, 3.2e+66]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 3.2 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.1999999999999999e-74 or 3.2e66 < x Initial program 100.0%
Taylor expanded in x around inf 84.3%
mul-1-neg84.3%
unsub-neg84.3%
Simplified84.3%
if -1.1999999999999999e-74 < x < 3.2e66Initial program 100.0%
Taylor expanded in t around inf 89.0%
Final simplification86.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5000.0) (not (<= z 5.5e+29))) (- x (* z (- t x))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5000.0) || !(z <= 5.5e+29)) {
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 <= (-5000.0d0)) .or. (.not. (z <= 5.5d+29))) 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 <= -5000.0) || !(z <= 5.5e+29)) {
tmp = x - (z * (t - x));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5000.0) or not (z <= 5.5e+29): tmp = x - (z * (t - x)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5000.0) || !(z <= 5.5e+29)) 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 <= -5000.0) || ~((z <= 5.5e+29))) 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, -5000.0], N[Not[LessEqual[z, 5.5e+29]], $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 -5000 \lor \neg \left(z \leq 5.5 \cdot 10^{+29}\right):\\
\;\;\;\;x - z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -5e3 or 5.5e29 < z Initial program 100.0%
Taylor expanded in y around 0 86.0%
mul-1-neg86.0%
unsub-neg86.0%
Simplified86.0%
if -5e3 < z < 5.5e29Initial program 99.9%
Taylor expanded in y around inf 89.9%
*-commutative89.9%
Simplified89.9%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -180000000.0) (not (<= z 6.6e+29))) (* z (- t)) (* y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -180000000.0) || !(z <= 6.6e+29)) {
tmp = z * -t;
} 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 ((z <= (-180000000.0d0)) .or. (.not. (z <= 6.6d+29))) then
tmp = z * -t
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 ((z <= -180000000.0) || !(z <= 6.6e+29)) {
tmp = z * -t;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -180000000.0) or not (z <= 6.6e+29): tmp = z * -t else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -180000000.0) || !(z <= 6.6e+29)) tmp = Float64(z * Float64(-t)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -180000000.0) || ~((z <= 6.6e+29))) tmp = z * -t; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -180000000.0], N[Not[LessEqual[z, 6.6e+29]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], N[(y * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -180000000 \lor \neg \left(z \leq 6.6 \cdot 10^{+29}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if z < -1.8e8 or 6.59999999999999968e29 < z Initial program 100.0%
Taylor expanded in t around inf 59.7%
Taylor expanded in y around 0 54.4%
mul-1-neg54.4%
unsub-neg54.4%
Simplified54.4%
Taylor expanded in x around 0 54.6%
mul-1-neg54.6%
distribute-rgt-neg-out54.6%
Simplified54.6%
if -1.8e8 < z < 6.59999999999999968e29Initial program 99.9%
Taylor expanded in y around inf 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in x around -inf 86.0%
+-commutative86.0%
mul-1-neg86.0%
unsub-neg86.0%
sub-neg86.0%
metadata-eval86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in t around inf 41.0%
*-commutative41.0%
Simplified41.0%
Final simplification48.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.5e-110) (not (<= y 1.36e-18))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.5e-110) || !(y <= 1.36e-18)) {
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 <= (-5.5d-110)) .or. (.not. (y <= 1.36d-18))) 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 <= -5.5e-110) || !(y <= 1.36e-18)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.5e-110) or not (y <= 1.36e-18): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.5e-110) || !(y <= 1.36e-18)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.5e-110) || ~((y <= 1.36e-18))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.5e-110], N[Not[LessEqual[y, 1.36e-18]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-110} \lor \neg \left(y \leq 1.36 \cdot 10^{-18}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.4999999999999998e-110 or 1.3600000000000001e-18 < y Initial program 100.0%
Taylor expanded in y around inf 68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in x around -inf 64.1%
+-commutative64.1%
mul-1-neg64.1%
unsub-neg64.1%
sub-neg64.1%
metadata-eval64.1%
+-commutative64.1%
Simplified64.1%
Taylor expanded in t around inf 36.8%
*-commutative36.8%
Simplified36.8%
if -5.4999999999999998e-110 < y < 1.3600000000000001e-18Initial program 100.0%
Taylor expanded in t around inf 75.9%
Taylor expanded in x around inf 27.0%
Final simplification32.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 t around inf 67.3%
Taylor expanded in x around inf 14.7%
Final simplification14.7%
(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 2024020
(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))))