
(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 12 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 (* (- y z) (- x t))))
double code(double x, double y, double z, double t) {
return x - ((y - z) * (x - t));
}
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) * (x - t))
end function
public static double code(double x, double y, double z, double t) {
return x - ((y - z) * (x - t));
}
def code(x, y, z, t): return x - ((y - z) * (x - t))
function code(x, y, z, t) return Float64(x - Float64(Float64(y - z) * Float64(x - t))) end
function tmp = code(x, y, z, t) tmp = x - ((y - z) * (x - t)); end
code[x_, y_, z_, t_] := N[(x - N[(N[(y - z), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(y - z\right) \cdot \left(x - t\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t))) (t_2 (* y (- x))))
(if (<= y -1.2e+150)
t_2
(if (<= y -2.7e+43)
(* y t)
(if (<= y -4.1e+27)
t_2
(if (<= y -2.5e-44)
t_1
(if (<= y -4.2e-248)
x
(if (<= y 5.5e-204)
t_1
(if (<= y 4.2e-14) x (if (<= y 6.6e+57) t_1 t_2))))))))))
double code(double x, double y, double z, double t) {
double t_1 = -(z * t);
double t_2 = y * -x;
double tmp;
if (y <= -1.2e+150) {
tmp = t_2;
} else if (y <= -2.7e+43) {
tmp = y * t;
} else if (y <= -4.1e+27) {
tmp = t_2;
} else if (y <= -2.5e-44) {
tmp = t_1;
} else if (y <= -4.2e-248) {
tmp = x;
} else if (y <= 5.5e-204) {
tmp = t_1;
} else if (y <= 4.2e-14) {
tmp = x;
} else if (y <= 6.6e+57) {
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 = -(z * t)
t_2 = y * -x
if (y <= (-1.2d+150)) then
tmp = t_2
else if (y <= (-2.7d+43)) then
tmp = y * t
else if (y <= (-4.1d+27)) then
tmp = t_2
else if (y <= (-2.5d-44)) then
tmp = t_1
else if (y <= (-4.2d-248)) then
tmp = x
else if (y <= 5.5d-204) then
tmp = t_1
else if (y <= 4.2d-14) then
tmp = x
else if (y <= 6.6d+57) 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 = -(z * t);
double t_2 = y * -x;
double tmp;
if (y <= -1.2e+150) {
tmp = t_2;
} else if (y <= -2.7e+43) {
tmp = y * t;
} else if (y <= -4.1e+27) {
tmp = t_2;
} else if (y <= -2.5e-44) {
tmp = t_1;
} else if (y <= -4.2e-248) {
tmp = x;
} else if (y <= 5.5e-204) {
tmp = t_1;
} else if (y <= 4.2e-14) {
tmp = x;
} else if (y <= 6.6e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -(z * t) t_2 = y * -x tmp = 0 if y <= -1.2e+150: tmp = t_2 elif y <= -2.7e+43: tmp = y * t elif y <= -4.1e+27: tmp = t_2 elif y <= -2.5e-44: tmp = t_1 elif y <= -4.2e-248: tmp = x elif y <= 5.5e-204: tmp = t_1 elif y <= 4.2e-14: tmp = x elif y <= 6.6e+57: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-Float64(z * t)) t_2 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -1.2e+150) tmp = t_2; elseif (y <= -2.7e+43) tmp = Float64(y * t); elseif (y <= -4.1e+27) tmp = t_2; elseif (y <= -2.5e-44) tmp = t_1; elseif (y <= -4.2e-248) tmp = x; elseif (y <= 5.5e-204) tmp = t_1; elseif (y <= 4.2e-14) tmp = x; elseif (y <= 6.6e+57) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -(z * t); t_2 = y * -x; tmp = 0.0; if (y <= -1.2e+150) tmp = t_2; elseif (y <= -2.7e+43) tmp = y * t; elseif (y <= -4.1e+27) tmp = t_2; elseif (y <= -2.5e-44) tmp = t_1; elseif (y <= -4.2e-248) tmp = x; elseif (y <= 5.5e-204) tmp = t_1; elseif (y <= 4.2e-14) tmp = x; elseif (y <= 6.6e+57) tmp = t_1; else tmp = t_2; 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]}, If[LessEqual[y, -1.2e+150], t$95$2, If[LessEqual[y, -2.7e+43], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.1e+27], t$95$2, If[LessEqual[y, -2.5e-44], t$95$1, If[LessEqual[y, -4.2e-248], x, If[LessEqual[y, 5.5e-204], t$95$1, If[LessEqual[y, 4.2e-14], x, If[LessEqual[y, 6.6e+57], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -z \cdot t\\
t_2 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+150}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{+43}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{+27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.20000000000000001e150 or -2.7000000000000002e43 < y < -4.1000000000000002e27 or 6.6000000000000002e57 < y Initial program 100.0%
Taylor expanded in y around inf 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in x around inf 60.2%
+-commutative60.2%
distribute-rgt1-in60.2%
associate-*r*60.2%
mul-1-neg60.2%
unsub-neg60.2%
*-commutative60.2%
Simplified60.2%
Taylor expanded in y around inf 60.2%
mul-1-neg60.2%
distribute-rgt-neg-out60.2%
Simplified60.2%
if -1.20000000000000001e150 < y < -2.7000000000000002e43Initial program 99.8%
Taylor expanded in t around inf 62.4%
Taylor expanded in y around inf 55.6%
if -4.1000000000000002e27 < y < -2.50000000000000019e-44 or -4.2e-248 < y < 5.4999999999999999e-204 or 4.1999999999999998e-14 < y < 6.6000000000000002e57Initial program 100.0%
Taylor expanded in t around inf 74.1%
Taylor expanded in z around inf 49.1%
associate-*r*49.1%
mul-1-neg49.1%
Simplified49.1%
if -2.50000000000000019e-44 < y < -4.2e-248 or 5.4999999999999999e-204 < y < 4.1999999999999998e-14Initial program 100.0%
Taylor expanded in t around inf 73.8%
Taylor expanded in x around inf 43.6%
Final simplification51.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* x y))) (t_2 (* z (- x t))) (t_3 (* y (- t x))))
(if (<= z -8.2e+40)
t_2
(if (<= z -8.8e-51)
t_3
(if (<= z -1e-188)
t_1
(if (<= z -1.1e-228)
t_3
(if (<= z 5e-303)
(+ x (* y t))
(if (<= z 3.6e-262) t_3 (if (<= z 3.9e-56) t_1 t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (x * y);
double t_2 = z * (x - t);
double t_3 = y * (t - x);
double tmp;
if (z <= -8.2e+40) {
tmp = t_2;
} else if (z <= -8.8e-51) {
tmp = t_3;
} else if (z <= -1e-188) {
tmp = t_1;
} else if (z <= -1.1e-228) {
tmp = t_3;
} else if (z <= 5e-303) {
tmp = x + (y * t);
} else if (z <= 3.6e-262) {
tmp = t_3;
} else if (z <= 3.9e-56) {
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 - (x * y)
t_2 = z * (x - t)
t_3 = y * (t - x)
if (z <= (-8.2d+40)) then
tmp = t_2
else if (z <= (-8.8d-51)) then
tmp = t_3
else if (z <= (-1d-188)) then
tmp = t_1
else if (z <= (-1.1d-228)) then
tmp = t_3
else if (z <= 5d-303) then
tmp = x + (y * t)
else if (z <= 3.6d-262) then
tmp = t_3
else if (z <= 3.9d-56) 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 * y);
double t_2 = z * (x - t);
double t_3 = y * (t - x);
double tmp;
if (z <= -8.2e+40) {
tmp = t_2;
} else if (z <= -8.8e-51) {
tmp = t_3;
} else if (z <= -1e-188) {
tmp = t_1;
} else if (z <= -1.1e-228) {
tmp = t_3;
} else if (z <= 5e-303) {
tmp = x + (y * t);
} else if (z <= 3.6e-262) {
tmp = t_3;
} else if (z <= 3.9e-56) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (x * y) t_2 = z * (x - t) t_3 = y * (t - x) tmp = 0 if z <= -8.2e+40: tmp = t_2 elif z <= -8.8e-51: tmp = t_3 elif z <= -1e-188: tmp = t_1 elif z <= -1.1e-228: tmp = t_3 elif z <= 5e-303: tmp = x + (y * t) elif z <= 3.6e-262: tmp = t_3 elif z <= 3.9e-56: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(x * y)) t_2 = Float64(z * Float64(x - t)) t_3 = Float64(y * Float64(t - x)) tmp = 0.0 if (z <= -8.2e+40) tmp = t_2; elseif (z <= -8.8e-51) tmp = t_3; elseif (z <= -1e-188) tmp = t_1; elseif (z <= -1.1e-228) tmp = t_3; elseif (z <= 5e-303) tmp = Float64(x + Float64(y * t)); elseif (z <= 3.6e-262) tmp = t_3; elseif (z <= 3.9e-56) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (x * y); t_2 = z * (x - t); t_3 = y * (t - x); tmp = 0.0; if (z <= -8.2e+40) tmp = t_2; elseif (z <= -8.8e-51) tmp = t_3; elseif (z <= -1e-188) tmp = t_1; elseif (z <= -1.1e-228) tmp = t_3; elseif (z <= 5e-303) tmp = x + (y * t); elseif (z <= 3.6e-262) tmp = t_3; elseif (z <= 3.9e-56) 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 * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+40], t$95$2, If[LessEqual[z, -8.8e-51], t$95$3, If[LessEqual[z, -1e-188], t$95$1, If[LessEqual[z, -1.1e-228], t$95$3, If[LessEqual[z, 5e-303], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-262], t$95$3, If[LessEqual[z, 3.9e-56], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - x \cdot y\\
t_2 := z \cdot \left(x - t\right)\\
t_3 := y \cdot \left(t - x\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-51}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-188}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-228}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-303}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-262}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8.2000000000000003e40 or 3.9e-56 < z Initial program 100.0%
sub-neg100.0%
distribute-lft-in96.7%
fma-def97.5%
Applied egg-rr97.5%
Taylor expanded in y around 0 83.9%
+-commutative83.9%
*-commutative83.9%
associate-*r*83.9%
distribute-rgt-in86.4%
mul-1-neg86.4%
sub-neg86.4%
Simplified86.4%
Taylor expanded in z around inf 84.9%
if -8.2000000000000003e40 < z < -8.8000000000000001e-51 or -9.9999999999999995e-189 < z < -1.1e-228 or 4.9999999999999998e-303 < z < 3.5999999999999998e-262Initial program 100.0%
flip--84.1%
associate-*l/73.2%
Applied egg-rr73.2%
Taylor expanded in y around inf 59.4%
unpow259.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in y around -inf 77.0%
mul-1-neg77.0%
*-commutative77.0%
distribute-rgt-neg-in77.0%
neg-mul-177.0%
cancel-sign-sub-inv77.0%
metadata-eval77.0%
*-lft-identity77.0%
+-commutative77.0%
sub-neg77.0%
Simplified77.0%
if -8.8000000000000001e-51 < z < -9.9999999999999995e-189 or 3.5999999999999998e-262 < z < 3.9e-56Initial program 100.0%
Taylor expanded in y around inf 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in x around inf 76.3%
+-commutative76.3%
distribute-rgt1-in76.3%
associate-*r*76.3%
mul-1-neg76.3%
unsub-neg76.3%
*-commutative76.3%
Simplified76.3%
if -1.1e-228 < z < 4.9999999999999998e-303Initial program 99.9%
Taylor expanded in t around inf 82.9%
Taylor expanded in z around 0 82.9%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* (- y z) t))))
(if (<= y -8.2e+27)
t_1
(if (<= y 2.55e-307)
t_2
(if (<= y 5.6e-198)
(* z (- x t))
(if (<= y 1.9e-119)
t_2
(if (<= y 3.7e-59) (+ x (* x z)) (if (<= y 4.3e+57) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -8.2e+27) {
tmp = t_1;
} else if (y <= 2.55e-307) {
tmp = t_2;
} else if (y <= 5.6e-198) {
tmp = z * (x - t);
} else if (y <= 1.9e-119) {
tmp = t_2;
} else if (y <= 3.7e-59) {
tmp = x + (x * z);
} else if (y <= 4.3e+57) {
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 + ((y - z) * t)
if (y <= (-8.2d+27)) then
tmp = t_1
else if (y <= 2.55d-307) then
tmp = t_2
else if (y <= 5.6d-198) then
tmp = z * (x - t)
else if (y <= 1.9d-119) then
tmp = t_2
else if (y <= 3.7d-59) then
tmp = x + (x * z)
else if (y <= 4.3d+57) 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 + ((y - z) * t);
double tmp;
if (y <= -8.2e+27) {
tmp = t_1;
} else if (y <= 2.55e-307) {
tmp = t_2;
} else if (y <= 5.6e-198) {
tmp = z * (x - t);
} else if (y <= 1.9e-119) {
tmp = t_2;
} else if (y <= 3.7e-59) {
tmp = x + (x * z);
} else if (y <= 4.3e+57) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + ((y - z) * t) tmp = 0 if y <= -8.2e+27: tmp = t_1 elif y <= 2.55e-307: tmp = t_2 elif y <= 5.6e-198: tmp = z * (x - t) elif y <= 1.9e-119: tmp = t_2 elif y <= 3.7e-59: tmp = x + (x * z) elif y <= 4.3e+57: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (y <= -8.2e+27) tmp = t_1; elseif (y <= 2.55e-307) tmp = t_2; elseif (y <= 5.6e-198) tmp = Float64(z * Float64(x - t)); elseif (y <= 1.9e-119) tmp = t_2; elseif (y <= 3.7e-59) tmp = Float64(x + Float64(x * z)); elseif (y <= 4.3e+57) 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 + ((y - z) * t); tmp = 0.0; if (y <= -8.2e+27) tmp = t_1; elseif (y <= 2.55e-307) tmp = t_2; elseif (y <= 5.6e-198) tmp = z * (x - t); elseif (y <= 1.9e-119) tmp = t_2; elseif (y <= 3.7e-59) tmp = x + (x * z); elseif (y <= 4.3e+57) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.2e+27], t$95$1, If[LessEqual[y, 2.55e-307], t$95$2, If[LessEqual[y, 5.6e-198], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-119], t$95$2, If[LessEqual[y, 3.7e-59], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e+57], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-307}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-198}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-59}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+57}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -8.2000000000000005e27 or 4.30000000000000033e57 < y Initial program 99.9%
flip--63.5%
associate-*l/55.7%
Applied egg-rr55.7%
Taylor expanded in y around inf 53.8%
unpow253.8%
*-commutative53.8%
Simplified53.8%
Taylor expanded in y around -inf 87.1%
mul-1-neg87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
neg-mul-187.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
*-lft-identity87.1%
+-commutative87.1%
sub-neg87.1%
Simplified87.1%
if -8.2000000000000005e27 < y < 2.55e-307 or 5.5999999999999998e-198 < y < 1.89999999999999987e-119 or 3.6999999999999999e-59 < y < 4.30000000000000033e57Initial program 100.0%
Taylor expanded in t around inf 81.9%
if 2.55e-307 < y < 5.5999999999999998e-198Initial program 100.0%
sub-neg100.0%
distribute-lft-in99.8%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 93.7%
+-commutative93.7%
*-commutative93.7%
associate-*r*93.7%
distribute-rgt-in93.9%
mul-1-neg93.9%
sub-neg93.9%
Simplified93.9%
Taylor expanded in z around inf 77.8%
if 1.89999999999999987e-119 < y < 3.6999999999999999e-59Initial program 100.0%
Taylor expanded in y around 0 95.4%
mul-1-neg95.4%
distribute-lft-neg-out95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around 0 82.0%
Final simplification83.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))))
(if (<= y -1.25e+150)
t_1
(if (<= y -3.4e+43)
(* y t)
(if (<= y -340000000.0)
t_1
(if (<= y 2.3e-14) x (if (<= y 1.5e+56) (* y t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (y <= -1.25e+150) {
tmp = t_1;
} else if (y <= -3.4e+43) {
tmp = y * t;
} else if (y <= -340000000.0) {
tmp = t_1;
} else if (y <= 2.3e-14) {
tmp = x;
} else if (y <= 1.5e+56) {
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 = y * -x
if (y <= (-1.25d+150)) then
tmp = t_1
else if (y <= (-3.4d+43)) then
tmp = y * t
else if (y <= (-340000000.0d0)) then
tmp = t_1
else if (y <= 2.3d-14) then
tmp = x
else if (y <= 1.5d+56) 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 = y * -x;
double tmp;
if (y <= -1.25e+150) {
tmp = t_1;
} else if (y <= -3.4e+43) {
tmp = y * t;
} else if (y <= -340000000.0) {
tmp = t_1;
} else if (y <= 2.3e-14) {
tmp = x;
} else if (y <= 1.5e+56) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * -x tmp = 0 if y <= -1.25e+150: tmp = t_1 elif y <= -3.4e+43: tmp = y * t elif y <= -340000000.0: tmp = t_1 elif y <= 2.3e-14: tmp = x elif y <= 1.5e+56: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -1.25e+150) tmp = t_1; elseif (y <= -3.4e+43) tmp = Float64(y * t); elseif (y <= -340000000.0) tmp = t_1; elseif (y <= 2.3e-14) tmp = x; elseif (y <= 1.5e+56) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * -x; tmp = 0.0; if (y <= -1.25e+150) tmp = t_1; elseif (y <= -3.4e+43) tmp = y * t; elseif (y <= -340000000.0) tmp = t_1; elseif (y <= 2.3e-14) tmp = x; elseif (y <= 1.5e+56) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -1.25e+150], t$95$1, If[LessEqual[y, -3.4e+43], N[(y * t), $MachinePrecision], If[LessEqual[y, -340000000.0], t$95$1, If[LessEqual[y, 2.3e-14], x, If[LessEqual[y, 1.5e+56], N[(y * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{+43}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -340000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+56}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.25000000000000002e150 or -3.40000000000000012e43 < y < -3.4e8 or 1.50000000000000003e56 < y Initial program 100.0%
Taylor expanded in y around inf 85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in x around inf 58.4%
+-commutative58.4%
distribute-rgt1-in58.4%
associate-*r*58.4%
mul-1-neg58.4%
unsub-neg58.4%
*-commutative58.4%
Simplified58.4%
Taylor expanded in y around inf 58.4%
mul-1-neg58.4%
distribute-rgt-neg-out58.4%
Simplified58.4%
if -1.25000000000000002e150 < y < -3.40000000000000012e43 or 2.29999999999999998e-14 < y < 1.50000000000000003e56Initial program 99.9%
Taylor expanded in t around inf 68.2%
Taylor expanded in y around inf 45.3%
if -3.4e8 < y < 2.29999999999999998e-14Initial program 100.0%
Taylor expanded in t around inf 73.4%
Taylor expanded in x around inf 33.9%
Final simplification44.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (+ x (* y t))))
(if (<= z -5e+40)
t_1
(if (<= z 7e-237)
t_2
(if (<= z 5.9e-187) (* y (- x)) (if (<= z 2.75e-45) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x + (y * t);
double tmp;
if (z <= -5e+40) {
tmp = t_1;
} else if (z <= 7e-237) {
tmp = t_2;
} else if (z <= 5.9e-187) {
tmp = y * -x;
} else if (z <= 2.75e-45) {
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 = z * (x - t)
t_2 = x + (y * t)
if (z <= (-5d+40)) then
tmp = t_1
else if (z <= 7d-237) then
tmp = t_2
else if (z <= 5.9d-187) then
tmp = y * -x
else if (z <= 2.75d-45) 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 = z * (x - t);
double t_2 = x + (y * t);
double tmp;
if (z <= -5e+40) {
tmp = t_1;
} else if (z <= 7e-237) {
tmp = t_2;
} else if (z <= 5.9e-187) {
tmp = y * -x;
} else if (z <= 2.75e-45) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x + (y * t) tmp = 0 if z <= -5e+40: tmp = t_1 elif z <= 7e-237: tmp = t_2 elif z <= 5.9e-187: tmp = y * -x elif z <= 2.75e-45: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -5e+40) tmp = t_1; elseif (z <= 7e-237) tmp = t_2; elseif (z <= 5.9e-187) tmp = Float64(y * Float64(-x)); elseif (z <= 2.75e-45) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = x + (y * t); tmp = 0.0; if (z <= -5e+40) tmp = t_1; elseif (z <= 7e-237) tmp = t_2; elseif (z <= 5.9e-187) tmp = y * -x; elseif (z <= 2.75e-45) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+40], t$95$1, If[LessEqual[z, 7e-237], t$95$2, If[LessEqual[z, 5.9e-187], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.75e-45], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x + y \cdot t\\
\mathbf{if}\;z \leq -5 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-237}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{-187}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.00000000000000003e40 or 2.75000000000000015e-45 < z Initial program 100.0%
sub-neg100.0%
distribute-lft-in96.6%
fma-def97.5%
Applied egg-rr97.5%
Taylor expanded in y around 0 85.2%
+-commutative85.2%
*-commutative85.2%
associate-*r*85.2%
distribute-rgt-in87.7%
mul-1-neg87.7%
sub-neg87.7%
Simplified87.7%
Taylor expanded in z around inf 86.1%
if -5.00000000000000003e40 < z < 6.99999999999999966e-237 or 5.8999999999999999e-187 < z < 2.75000000000000015e-45Initial program 100.0%
Taylor expanded in t around inf 71.6%
Taylor expanded in z around 0 64.6%
if 6.99999999999999966e-237 < z < 5.8999999999999999e-187Initial program 100.0%
Taylor expanded in y around inf 93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in x around inf 86.0%
+-commutative86.0%
distribute-rgt1-in86.0%
associate-*r*86.0%
mul-1-neg86.0%
unsub-neg86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in y around inf 63.5%
mul-1-neg63.5%
distribute-rgt-neg-out63.5%
Simplified63.5%
Final simplification74.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.6e+27) (not (<= y 4.3e+57))) (* y (- t x)) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e+27) || !(y <= 4.3e+57)) {
tmp = y * (t - x);
} else {
tmp = x + (z * (x - 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 <= (-4.6d+27)) .or. (.not. (y <= 4.3d+57))) then
tmp = y * (t - x)
else
tmp = x + (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e+27) || !(y <= 4.3e+57)) {
tmp = y * (t - x);
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.6e+27) or not (y <= 4.3e+57): tmp = y * (t - x) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.6e+27) || !(y <= 4.3e+57)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.6e+27) || ~((y <= 4.3e+57))) tmp = y * (t - x); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.6e+27], N[Not[LessEqual[y, 4.3e+57]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+27} \lor \neg \left(y \leq 4.3 \cdot 10^{+57}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -4.6000000000000001e27 or 4.30000000000000033e57 < y Initial program 99.9%
flip--63.5%
associate-*l/55.7%
Applied egg-rr55.7%
Taylor expanded in y around inf 53.8%
unpow253.8%
*-commutative53.8%
Simplified53.8%
Taylor expanded in y around -inf 87.1%
mul-1-neg87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
neg-mul-187.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
*-lft-identity87.1%
+-commutative87.1%
sub-neg87.1%
Simplified87.1%
if -4.6000000000000001e27 < y < 4.30000000000000033e57Initial program 100.0%
sub-neg100.0%
distribute-lft-in99.3%
fma-def99.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 87.7%
+-commutative87.7%
*-commutative87.7%
associate-*r*87.7%
distribute-rgt-in88.4%
mul-1-neg88.4%
sub-neg88.4%
Simplified88.4%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -7.8e+40) t_1 (if (<= z 3.7e-45) (+ x (* y (- t x))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -7.8e+40) {
tmp = t_1;
} else if (z <= 3.7e-45) {
tmp = x + (y * (t - x));
} else {
tmp = x + 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 * (x - t)
if (z <= (-7.8d+40)) then
tmp = t_1
else if (z <= 3.7d-45) then
tmp = x + (y * (t - x))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -7.8e+40) {
tmp = t_1;
} else if (z <= 3.7e-45) {
tmp = x + (y * (t - x));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -7.8e+40: tmp = t_1 elif z <= 3.7e-45: tmp = x + (y * (t - x)) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -7.8e+40) tmp = t_1; elseif (z <= 3.7e-45) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -7.8e+40) tmp = t_1; elseif (z <= 3.7e-45) tmp = x + (y * (t - x)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+40], t$95$1, If[LessEqual[z, 3.7e-45], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-45}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
if z < -7.8000000000000002e40Initial program 100.0%
sub-neg100.0%
distribute-lft-in96.2%
fma-def98.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 81.6%
+-commutative81.6%
*-commutative81.6%
associate-*r*81.6%
distribute-rgt-in85.4%
mul-1-neg85.4%
sub-neg85.4%
Simplified85.4%
Taylor expanded in z around inf 85.4%
if -7.8000000000000002e40 < z < 3.7e-45Initial program 100.0%
Taylor expanded in y around inf 91.0%
*-commutative91.0%
Simplified91.0%
if 3.7e-45 < z Initial program 100.0%
sub-neg100.0%
distribute-lft-in96.9%
fma-def96.9%
Applied egg-rr96.9%
Taylor expanded in y around 0 89.3%
+-commutative89.3%
*-commutative89.3%
associate-*r*89.3%
distribute-rgt-in90.8%
mul-1-neg90.8%
sub-neg90.8%
Simplified90.8%
Final simplification89.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.2e+84) (not (<= y 2.45e+58))) (* y (- x)) (* z (- x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.2e+84) || !(y <= 2.45e+58)) {
tmp = y * -x;
} else {
tmp = z * (x - 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 <= (-7.2d+84)) .or. (.not. (y <= 2.45d+58))) then
tmp = y * -x
else
tmp = z * (x - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.2e+84) || !(y <= 2.45e+58)) {
tmp = y * -x;
} else {
tmp = z * (x - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.2e+84) or not (y <= 2.45e+58): tmp = y * -x else: tmp = z * (x - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.2e+84) || !(y <= 2.45e+58)) tmp = Float64(y * Float64(-x)); else tmp = Float64(z * Float64(x - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.2e+84) || ~((y <= 2.45e+58))) tmp = y * -x; else tmp = z * (x - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.2e+84], N[Not[LessEqual[y, 2.45e+58]], $MachinePrecision]], N[(y * (-x)), $MachinePrecision], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+84} \lor \neg \left(y \leq 2.45 \cdot 10^{+58}\right):\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -7.1999999999999999e84 or 2.45000000000000009e58 < y Initial program 100.0%
Taylor expanded in y around inf 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in x around inf 58.4%
+-commutative58.4%
distribute-rgt1-in58.4%
associate-*r*58.4%
mul-1-neg58.4%
unsub-neg58.4%
*-commutative58.4%
Simplified58.4%
Taylor expanded in y around inf 58.4%
mul-1-neg58.4%
distribute-rgt-neg-out58.4%
Simplified58.4%
if -7.1999999999999999e84 < y < 2.45000000000000009e58Initial program 100.0%
sub-neg100.0%
distribute-lft-in98.7%
fma-def99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 83.9%
+-commutative83.9%
*-commutative83.9%
associate-*r*83.9%
distribute-rgt-in85.2%
mul-1-neg85.2%
sub-neg85.2%
Simplified85.2%
Taylor expanded in z around inf 60.3%
Final simplification59.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e+19) (not (<= z 3.9e-56))) (* z (- x t)) (- x (* x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+19) || !(z <= 3.9e-56)) {
tmp = z * (x - t);
} else {
tmp = x - (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8d+19)) .or. (.not. (z <= 3.9d-56))) then
tmp = z * (x - t)
else
tmp = x - (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+19) || !(z <= 3.9e-56)) {
tmp = z * (x - t);
} else {
tmp = x - (x * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e+19) or not (z <= 3.9e-56): tmp = z * (x - t) else: tmp = x - (x * y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e+19) || !(z <= 3.9e-56)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x - Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e+19) || ~((z <= 3.9e-56))) tmp = z * (x - t); else tmp = x - (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+19], N[Not[LessEqual[z, 3.9e-56]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+19} \lor \neg \left(z \leq 3.9 \cdot 10^{-56}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot y\\
\end{array}
\end{array}
if z < -8e19 or 3.9e-56 < z Initial program 100.0%
sub-neg100.0%
distribute-lft-in96.8%
fma-def97.7%
Applied egg-rr97.7%
Taylor expanded in y around 0 81.7%
+-commutative81.7%
*-commutative81.7%
associate-*r*81.7%
distribute-rgt-in84.1%
mul-1-neg84.1%
sub-neg84.1%
Simplified84.1%
Taylor expanded in z around inf 82.7%
if -8e19 < z < 3.9e-56Initial program 100.0%
Taylor expanded in y around inf 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in x around inf 65.0%
+-commutative65.0%
distribute-rgt1-in65.0%
associate-*r*65.0%
mul-1-neg65.0%
unsub-neg65.0%
*-commutative65.0%
Simplified65.0%
Final simplification73.9%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e-44) (* y t) (if (<= y 1.7e-13) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-44) {
tmp = y * t;
} else if (y <= 1.7e-13) {
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 <= (-3.5d-44)) then
tmp = y * t
else if (y <= 1.7d-13) 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 <= -3.5e-44) {
tmp = y * t;
} else if (y <= 1.7e-13) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-44: tmp = y * t elif y <= 1.7e-13: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-44) tmp = Float64(y * t); elseif (y <= 1.7e-13) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e-44) tmp = y * t; elseif (y <= 1.7e-13) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-44], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.7e-13], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-44}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -3.4999999999999998e-44 or 1.70000000000000008e-13 < y Initial program 100.0%
Taylor expanded in t around inf 51.0%
Taylor expanded in y around inf 34.6%
if -3.4999999999999998e-44 < y < 1.70000000000000008e-13Initial program 100.0%
Taylor expanded in t around inf 72.6%
Taylor expanded in x around inf 36.1%
Final simplification35.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 61.2%
Taylor expanded in x around inf 19.1%
Final simplification19.1%
(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 2023278
(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))))