
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -7.2e+118)
(* y t)
(if (<= y -1.35e-196)
t_1
(if (<= y 9.6e-233)
x
(if (<= y 5.4e-169)
t_1
(if (<= y 2.35e-82) x (if (<= y 4e+184) (* y t) (* x (- y))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -7.2e+118) {
tmp = y * t;
} else if (y <= -1.35e-196) {
tmp = t_1;
} else if (y <= 9.6e-233) {
tmp = x;
} else if (y <= 5.4e-169) {
tmp = t_1;
} else if (y <= 2.35e-82) {
tmp = x;
} else if (y <= 4e+184) {
tmp = y * t;
} else {
tmp = x * -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-7.2d+118)) then
tmp = y * t
else if (y <= (-1.35d-196)) then
tmp = t_1
else if (y <= 9.6d-233) then
tmp = x
else if (y <= 5.4d-169) then
tmp = t_1
else if (y <= 2.35d-82) then
tmp = x
else if (y <= 4d+184) then
tmp = y * t
else
tmp = x * -y
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 (y <= -7.2e+118) {
tmp = y * t;
} else if (y <= -1.35e-196) {
tmp = t_1;
} else if (y <= 9.6e-233) {
tmp = x;
} else if (y <= 5.4e-169) {
tmp = t_1;
} else if (y <= 2.35e-82) {
tmp = x;
} else if (y <= 4e+184) {
tmp = y * t;
} else {
tmp = x * -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -7.2e+118: tmp = y * t elif y <= -1.35e-196: tmp = t_1 elif y <= 9.6e-233: tmp = x elif y <= 5.4e-169: tmp = t_1 elif y <= 2.35e-82: tmp = x elif y <= 4e+184: tmp = y * t else: tmp = x * -y return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -7.2e+118) tmp = Float64(y * t); elseif (y <= -1.35e-196) tmp = t_1; elseif (y <= 9.6e-233) tmp = x; elseif (y <= 5.4e-169) tmp = t_1; elseif (y <= 2.35e-82) tmp = x; elseif (y <= 4e+184) tmp = Float64(y * t); else tmp = Float64(x * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -7.2e+118) tmp = y * t; elseif (y <= -1.35e-196) tmp = t_1; elseif (y <= 9.6e-233) tmp = x; elseif (y <= 5.4e-169) tmp = t_1; elseif (y <= 2.35e-82) tmp = x; elseif (y <= 4e+184) tmp = y * t; else tmp = x * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -7.2e+118], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.35e-196], t$95$1, If[LessEqual[y, 9.6e-233], x, If[LessEqual[y, 5.4e-169], t$95$1, If[LessEqual[y, 2.35e-82], x, If[LessEqual[y, 4e+184], N[(y * t), $MachinePrecision], N[(x * (-y)), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+118}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-233}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+184}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\end{array}
\end{array}
if y < -7.2e118 or 2.35e-82 < y < 4.00000000000000007e184Initial program 100.0%
Taylor expanded in y around inf 79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around inf 80.1%
Taylor expanded in t around inf 45.1%
*-commutative45.1%
Simplified45.1%
if -7.2e118 < y < -1.34999999999999991e-196 or 9.5999999999999996e-233 < y < 5.4000000000000003e-169Initial program 100.0%
Taylor expanded in x around inf 86.8%
+-commutative86.8%
*-commutative86.8%
*-commutative86.8%
associate-/l*83.1%
distribute-lft-out83.1%
Simplified83.1%
Taylor expanded in z around inf 51.5%
associate-*r*51.5%
neg-mul-151.5%
sub-neg51.5%
metadata-eval51.5%
+-commutative51.5%
Simplified51.5%
Taylor expanded in x around 0 43.2%
associate-*r*43.2%
mul-1-neg43.2%
Simplified43.2%
if -1.34999999999999991e-196 < y < 9.5999999999999996e-233 or 5.4000000000000003e-169 < y < 2.35e-82Initial program 100.0%
Taylor expanded in t around inf 74.9%
Taylor expanded in x around inf 48.1%
if 4.00000000000000007e184 < y Initial program 100.0%
Taylor expanded in x around inf 87.9%
+-commutative87.9%
*-commutative87.9%
*-commutative87.9%
associate-/l*94.2%
distribute-lft-out94.2%
Simplified94.2%
Taylor expanded in y around inf 94.2%
Taylor expanded in x around inf 76.0%
mul-1-neg76.0%
distribute-lft-neg-out76.0%
*-commutative76.0%
Simplified76.0%
Final simplification47.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= (- y z) -1e-32)
t_1
(if (<= (- y z) 4e-51)
x
(if (or (<= (- y z) 1e+188) (not (<= (- y z) 1e+222))) t_1 (* z x))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -1e-32) {
tmp = t_1;
} else if ((y - z) <= 4e-51) {
tmp = x;
} else if (((y - z) <= 1e+188) || !((y - z) <= 1e+222)) {
tmp = t_1;
} else {
tmp = z * 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 = (y - z) * t
if ((y - z) <= (-1d-32)) then
tmp = t_1
else if ((y - z) <= 4d-51) then
tmp = x
else if (((y - z) <= 1d+188) .or. (.not. ((y - z) <= 1d+222))) then
tmp = t_1
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -1e-32) {
tmp = t_1;
} else if ((y - z) <= 4e-51) {
tmp = x;
} else if (((y - z) <= 1e+188) || !((y - z) <= 1e+222)) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if (y - z) <= -1e-32: tmp = t_1 elif (y - z) <= 4e-51: tmp = x elif ((y - z) <= 1e+188) or not ((y - z) <= 1e+222): tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (Float64(y - z) <= -1e-32) tmp = t_1; elseif (Float64(y - z) <= 4e-51) tmp = x; elseif ((Float64(y - z) <= 1e+188) || !(Float64(y - z) <= 1e+222)) tmp = t_1; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if ((y - z) <= -1e-32) tmp = t_1; elseif ((y - z) <= 4e-51) tmp = x; elseif (((y - z) <= 1e+188) || ~(((y - z) <= 1e+222))) tmp = t_1; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -1e-32], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 4e-51], x, If[Or[LessEqual[N[(y - z), $MachinePrecision], 1e+188], N[Not[LessEqual[N[(y - z), $MachinePrecision], 1e+222]], $MachinePrecision]], t$95$1, N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y - z \leq -1 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y - z \leq 4 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;y - z \leq 10^{+188} \lor \neg \left(y - z \leq 10^{+222}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if (-.f64 y z) < -1.00000000000000006e-32 or 4e-51 < (-.f64 y z) < 1e188 or 1e222 < (-.f64 y z) Initial program 100.0%
Taylor expanded in x around inf 83.5%
+-commutative83.5%
*-commutative83.5%
*-commutative83.5%
associate-/l*84.5%
distribute-lft-out84.5%
Simplified84.5%
Taylor expanded in x around 0 55.6%
if -1.00000000000000006e-32 < (-.f64 y z) < 4e-51Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in x around inf 71.4%
if 1e188 < (-.f64 y z) < 1e222Initial program 100.0%
Taylor expanded in t around 0 81.7%
mul-1-neg81.7%
distribute-rgt-neg-in81.7%
neg-sub081.7%
sub-neg81.7%
+-commutative81.7%
associate--r+81.7%
neg-sub081.7%
remove-double-neg81.7%
Simplified81.7%
Taylor expanded in z around inf 81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in z around inf 81.7%
Final simplification59.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)) (t_2 (* x (- 1.0 y))))
(if (<= t -2.45e-17)
t_1
(if (<= t -6e-60)
t_2
(if (<= t -9.6e-111)
t_1
(if (<= t -4.8e-162) (* z x) (if (<= t 3.8e+16) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = x * (1.0 - y);
double tmp;
if (t <= -2.45e-17) {
tmp = t_1;
} else if (t <= -6e-60) {
tmp = t_2;
} else if (t <= -9.6e-111) {
tmp = t_1;
} else if (t <= -4.8e-162) {
tmp = z * x;
} else if (t <= 3.8e+16) {
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 - z) * t
t_2 = x * (1.0d0 - y)
if (t <= (-2.45d-17)) then
tmp = t_1
else if (t <= (-6d-60)) then
tmp = t_2
else if (t <= (-9.6d-111)) then
tmp = t_1
else if (t <= (-4.8d-162)) then
tmp = z * x
else if (t <= 3.8d+16) 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 - z) * t;
double t_2 = x * (1.0 - y);
double tmp;
if (t <= -2.45e-17) {
tmp = t_1;
} else if (t <= -6e-60) {
tmp = t_2;
} else if (t <= -9.6e-111) {
tmp = t_1;
} else if (t <= -4.8e-162) {
tmp = z * x;
} else if (t <= 3.8e+16) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t t_2 = x * (1.0 - y) tmp = 0 if t <= -2.45e-17: tmp = t_1 elif t <= -6e-60: tmp = t_2 elif t <= -9.6e-111: tmp = t_1 elif t <= -4.8e-162: tmp = z * x elif t <= 3.8e+16: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (t <= -2.45e-17) tmp = t_1; elseif (t <= -6e-60) tmp = t_2; elseif (t <= -9.6e-111) tmp = t_1; elseif (t <= -4.8e-162) tmp = Float64(z * x); elseif (t <= 3.8e+16) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; t_2 = x * (1.0 - y); tmp = 0.0; if (t <= -2.45e-17) tmp = t_1; elseif (t <= -6e-60) tmp = t_2; elseif (t <= -9.6e-111) tmp = t_1; elseif (t <= -4.8e-162) tmp = z * x; elseif (t <= 3.8e+16) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.45e-17], t$95$1, If[LessEqual[t, -6e-60], t$95$2, If[LessEqual[t, -9.6e-111], t$95$1, If[LessEqual[t, -4.8e-162], N[(z * x), $MachinePrecision], If[LessEqual[t, 3.8e+16], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;t \leq -2.45 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-60}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -9.6 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-162}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.45000000000000006e-17 or -6.00000000000000038e-60 < t < -9.6000000000000003e-111 or 3.8e16 < t Initial program 100.0%
Taylor expanded in x around inf 79.5%
+-commutative79.5%
*-commutative79.5%
*-commutative79.5%
associate-/l*76.8%
distribute-lft-out76.8%
Simplified76.8%
Taylor expanded in x around 0 74.5%
if -2.45000000000000006e-17 < t < -6.00000000000000038e-60 or -4.8000000000000004e-162 < t < 3.8e16Initial program 100.0%
Taylor expanded in t around 0 81.1%
mul-1-neg81.1%
distribute-rgt-neg-in81.1%
neg-sub081.1%
sub-neg81.1%
+-commutative81.1%
associate--r+81.1%
neg-sub081.1%
remove-double-neg81.1%
Simplified81.1%
Taylor expanded in z around 0 58.6%
*-rgt-identity58.6%
mul-1-neg58.6%
distribute-rgt-neg-out58.6%
distribute-lft-in58.6%
unsub-neg58.6%
Simplified58.6%
if -9.6000000000000003e-111 < t < -4.8000000000000004e-162Initial program 100.0%
Taylor expanded in t around 0 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
sub-neg100.0%
+-commutative100.0%
associate--r+100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 88.3%
Final simplification68.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))) (t_3 (* x (- 1.0 y))))
(if (<= z -4800000.0)
t_2
(if (<= z -1.05e-168)
t_3
(if (<= z -1.9e-303)
t_1
(if (<= z 8.2e-243) t_3 (if (<= z 15.5) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * (x - t);
double t_3 = x * (1.0 - y);
double tmp;
if (z <= -4800000.0) {
tmp = t_2;
} else if (z <= -1.05e-168) {
tmp = t_3;
} else if (z <= -1.9e-303) {
tmp = t_1;
} else if (z <= 8.2e-243) {
tmp = t_3;
} else if (z <= 15.5) {
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 = y * (t - x)
t_2 = z * (x - t)
t_3 = x * (1.0d0 - y)
if (z <= (-4800000.0d0)) then
tmp = t_2
else if (z <= (-1.05d-168)) then
tmp = t_3
else if (z <= (-1.9d-303)) then
tmp = t_1
else if (z <= 8.2d-243) then
tmp = t_3
else if (z <= 15.5d0) 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 = y * (t - x);
double t_2 = z * (x - t);
double t_3 = x * (1.0 - y);
double tmp;
if (z <= -4800000.0) {
tmp = t_2;
} else if (z <= -1.05e-168) {
tmp = t_3;
} else if (z <= -1.9e-303) {
tmp = t_1;
} else if (z <= 8.2e-243) {
tmp = t_3;
} else if (z <= 15.5) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = z * (x - t) t_3 = x * (1.0 - y) tmp = 0 if z <= -4800000.0: tmp = t_2 elif z <= -1.05e-168: tmp = t_3 elif z <= -1.9e-303: tmp = t_1 elif z <= 8.2e-243: tmp = t_3 elif z <= 15.5: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(z * Float64(x - t)) t_3 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -4800000.0) tmp = t_2; elseif (z <= -1.05e-168) tmp = t_3; elseif (z <= -1.9e-303) tmp = t_1; elseif (z <= 8.2e-243) tmp = t_3; elseif (z <= 15.5) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = z * (x - t); t_3 = x * (1.0 - y); tmp = 0.0; if (z <= -4800000.0) tmp = t_2; elseif (z <= -1.05e-168) tmp = t_3; elseif (z <= -1.9e-303) tmp = t_1; elseif (z <= 8.2e-243) tmp = t_3; elseif (z <= 15.5) tmp = t_1; else tmp = t_2; 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[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4800000.0], t$95$2, If[LessEqual[z, -1.05e-168], t$95$3, If[LessEqual[z, -1.9e-303], t$95$1, If[LessEqual[z, 8.2e-243], t$95$3, If[LessEqual[z, 15.5], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := z \cdot \left(x - t\right)\\
t_3 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -4800000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-168}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-243}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 15.5:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.8e6 or 15.5 < z Initial program 100.0%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
*-commutative86.7%
*-commutative86.7%
associate-/l*87.5%
distribute-lft-out87.5%
Simplified87.5%
Taylor expanded in z around inf 70.6%
associate-*r*70.6%
neg-mul-170.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
Simplified70.6%
Taylor expanded in x around 0 77.0%
+-commutative77.0%
mul-1-neg77.0%
unsub-neg77.0%
distribute-rgt-out--80.2%
Simplified80.2%
if -4.8e6 < z < -1.04999999999999997e-168 or -1.90000000000000005e-303 < z < 8.19999999999999962e-243Initial program 100.0%
Taylor expanded in t around 0 65.3%
mul-1-neg65.3%
distribute-rgt-neg-in65.3%
neg-sub065.3%
sub-neg65.3%
+-commutative65.3%
associate--r+65.3%
neg-sub065.3%
remove-double-neg65.3%
Simplified65.3%
Taylor expanded in z around 0 65.1%
*-rgt-identity65.1%
mul-1-neg65.1%
distribute-rgt-neg-out65.1%
distribute-lft-in65.1%
unsub-neg65.1%
Simplified65.1%
if -1.04999999999999997e-168 < z < -1.90000000000000005e-303 or 8.19999999999999962e-243 < z < 15.5Initial program 100.0%
Taylor expanded in y around inf 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in y around inf 85.9%
Taylor expanded in y around inf 71.4%
Final simplification74.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (+ x (* y t))))
(if (<= z -1.38e-6)
t_1
(if (<= z -6.8e-171)
t_2
(if (<= z -2.6e-275) (* y (- t x)) (if (<= z 0.205) 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 <= -1.38e-6) {
tmp = t_1;
} else if (z <= -6.8e-171) {
tmp = t_2;
} else if (z <= -2.6e-275) {
tmp = y * (t - x);
} else if (z <= 0.205) {
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 <= (-1.38d-6)) then
tmp = t_1
else if (z <= (-6.8d-171)) then
tmp = t_2
else if (z <= (-2.6d-275)) then
tmp = y * (t - x)
else if (z <= 0.205d0) 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 <= -1.38e-6) {
tmp = t_1;
} else if (z <= -6.8e-171) {
tmp = t_2;
} else if (z <= -2.6e-275) {
tmp = y * (t - x);
} else if (z <= 0.205) {
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 <= -1.38e-6: tmp = t_1 elif z <= -6.8e-171: tmp = t_2 elif z <= -2.6e-275: tmp = y * (t - x) elif z <= 0.205: 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 <= -1.38e-6) tmp = t_1; elseif (z <= -6.8e-171) tmp = t_2; elseif (z <= -2.6e-275) tmp = Float64(y * Float64(t - x)); elseif (z <= 0.205) 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 <= -1.38e-6) tmp = t_1; elseif (z <= -6.8e-171) tmp = t_2; elseif (z <= -2.6e-275) tmp = y * (t - x); elseif (z <= 0.205) 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, -1.38e-6], t$95$1, If[LessEqual[z, -6.8e-171], t$95$2, If[LessEqual[z, -2.6e-275], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.205], 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 -1.38 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-171}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-275}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 0.205:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3799999999999999e-6 or 0.204999999999999988 < z Initial program 100.0%
Taylor expanded in x around inf 86.9%
+-commutative86.9%
*-commutative86.9%
*-commutative86.9%
associate-/l*87.6%
distribute-lft-out87.6%
Simplified87.6%
Taylor expanded in z around inf 70.1%
associate-*r*70.1%
neg-mul-170.1%
sub-neg70.1%
metadata-eval70.1%
+-commutative70.1%
Simplified70.1%
Taylor expanded in x around 0 76.4%
+-commutative76.4%
mul-1-neg76.4%
unsub-neg76.4%
distribute-rgt-out--79.5%
Simplified79.5%
if -1.3799999999999999e-6 < z < -6.7999999999999997e-171 or -2.59999999999999992e-275 < z < 0.204999999999999988Initial program 100.0%
Taylor expanded in t around inf 81.0%
Taylor expanded in y around inf 72.5%
if -6.7999999999999997e-171 < z < -2.59999999999999992e-275Initial program 100.0%
Taylor expanded in y around inf 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in y around inf 85.6%
Taylor expanded in y around inf 77.1%
Final simplification76.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -1.0)
t_1
(if (<= z -2.5e-168)
(- x (* z t))
(if (<= z -3.2e-277)
(* y (- t x))
(if (<= z 0.225) (+ x (* y t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= -2.5e-168) {
tmp = x - (z * t);
} else if (z <= -3.2e-277) {
tmp = y * (t - x);
} else if (z <= 0.225) {
tmp = x + (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 * (x - t)
if (z <= (-1.0d0)) then
tmp = t_1
else if (z <= (-2.5d-168)) then
tmp = x - (z * t)
else if (z <= (-3.2d-277)) then
tmp = y * (t - x)
else if (z <= 0.225d0) then
tmp = x + (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 * (x - t);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= -2.5e-168) {
tmp = x - (z * t);
} else if (z <= -3.2e-277) {
tmp = y * (t - x);
} else if (z <= 0.225) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1.0: tmp = t_1 elif z <= -2.5e-168: tmp = x - (z * t) elif z <= -3.2e-277: tmp = y * (t - x) elif z <= 0.225: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -1.0) tmp = t_1; elseif (z <= -2.5e-168) tmp = Float64(x - Float64(z * t)); elseif (z <= -3.2e-277) tmp = Float64(y * Float64(t - x)); elseif (z <= 0.225) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -1.0) tmp = t_1; elseif (z <= -2.5e-168) tmp = x - (z * t); elseif (z <= -3.2e-277) tmp = y * (t - x); elseif (z <= 0.225) tmp = x + (y * t); 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]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, -2.5e-168], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e-277], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.225], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-168}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-277}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 0.225:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 0.225000000000000006 < z Initial program 100.0%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
*-commutative86.7%
*-commutative86.7%
associate-/l*87.5%
distribute-lft-out87.5%
Simplified87.5%
Taylor expanded in z around inf 70.6%
associate-*r*70.6%
neg-mul-170.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
Simplified70.6%
Taylor expanded in x around 0 77.0%
+-commutative77.0%
mul-1-neg77.0%
unsub-neg77.0%
distribute-rgt-out--80.2%
Simplified80.2%
if -1 < z < -2.50000000000000001e-168Initial program 100.0%
Taylor expanded in t around inf 80.9%
Taylor expanded in y around 0 60.7%
mul-1-neg60.7%
unsub-neg60.7%
Simplified60.7%
if -2.50000000000000001e-168 < z < -3.1999999999999998e-277Initial program 100.0%
Taylor expanded in y around inf 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in y around inf 85.6%
Taylor expanded in y around inf 77.1%
if -3.1999999999999998e-277 < z < 0.225000000000000006Initial program 100.0%
Taylor expanded in t around inf 79.8%
Taylor expanded in y around inf 78.2%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.4e-33) (* y t) (if (<= y 4.2e-75) x (if (<= y 1e+186) (* y t) (* x (- y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-33) {
tmp = y * t;
} else if (y <= 4.2e-75) {
tmp = x;
} else if (y <= 1e+186) {
tmp = y * t;
} else {
tmp = x * -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.4d-33)) then
tmp = y * t
else if (y <= 4.2d-75) then
tmp = x
else if (y <= 1d+186) then
tmp = y * t
else
tmp = x * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-33) {
tmp = y * t;
} else if (y <= 4.2e-75) {
tmp = x;
} else if (y <= 1e+186) {
tmp = y * t;
} else {
tmp = x * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e-33: tmp = y * t elif y <= 4.2e-75: tmp = x elif y <= 1e+186: tmp = y * t else: tmp = x * -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e-33) tmp = Float64(y * t); elseif (y <= 4.2e-75) tmp = x; elseif (y <= 1e+186) tmp = Float64(y * t); else tmp = Float64(x * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.4e-33) tmp = y * t; elseif (y <= 4.2e-75) tmp = x; elseif (y <= 1e+186) tmp = y * t; else tmp = x * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-33], N[(y * t), $MachinePrecision], If[LessEqual[y, 4.2e-75], x, If[LessEqual[y, 1e+186], N[(y * t), $MachinePrecision], N[(x * (-y)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-33}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 10^{+186}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\end{array}
\end{array}
if y < -1.4e-33 or 4.2000000000000002e-75 < y < 9.9999999999999998e185Initial program 100.0%
Taylor expanded in y around inf 71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in y around inf 72.4%
Taylor expanded in t around inf 40.4%
*-commutative40.4%
Simplified40.4%
if -1.4e-33 < y < 4.2000000000000002e-75Initial program 100.0%
Taylor expanded in t around inf 76.7%
Taylor expanded in x around inf 37.9%
if 9.9999999999999998e185 < y Initial program 100.0%
Taylor expanded in x around inf 87.9%
+-commutative87.9%
*-commutative87.9%
*-commutative87.9%
associate-/l*94.2%
distribute-lft-out94.2%
Simplified94.2%
Taylor expanded in y around inf 94.2%
Taylor expanded in x around inf 76.0%
mul-1-neg76.0%
distribute-lft-neg-out76.0%
*-commutative76.0%
Simplified76.0%
Final simplification41.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.75e-6) (not (<= z 4e+77))) (* z (- x t)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.75e-6) || !(z <= 4e+77)) {
tmp = z * (x - t);
} 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 ((z <= (-1.75d-6)) .or. (.not. (z <= 4d+77))) then
tmp = z * (x - t)
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 ((z <= -1.75e-6) || !(z <= 4e+77)) {
tmp = z * (x - t);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.75e-6) or not (z <= 4e+77): tmp = z * (x - t) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.75e-6) || !(z <= 4e+77)) tmp = Float64(z * Float64(x - t)); 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 ((z <= -1.75e-6) || ~((z <= 4e+77))) tmp = z * (x - t); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.75e-6], N[Not[LessEqual[z, 4e+77]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-6} \lor \neg \left(z \leq 4 \cdot 10^{+77}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if z < -1.74999999999999997e-6 or 3.99999999999999993e77 < z Initial program 100.0%
Taylor expanded in x around inf 87.3%
+-commutative87.3%
*-commutative87.3%
*-commutative87.3%
associate-/l*88.2%
distribute-lft-out88.2%
Simplified88.2%
Taylor expanded in z around inf 71.5%
associate-*r*71.5%
neg-mul-171.5%
sub-neg71.5%
metadata-eval71.5%
+-commutative71.5%
Simplified71.5%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
mul-1-neg78.9%
unsub-neg78.9%
distribute-rgt-out--82.4%
Simplified82.4%
if -1.74999999999999997e-6 < z < 3.99999999999999993e77Initial program 100.0%
Taylor expanded in t around inf 77.0%
Final simplification79.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.35e+92) (not (<= x 5.2e-44))) (+ x (* x (- z y))) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e+92) || !(x <= 5.2e-44)) {
tmp = x + (x * (z - y));
} 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.35d+92)) .or. (.not. (x <= 5.2d-44))) then
tmp = x + (x * (z - y))
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.35e+92) || !(x <= 5.2e-44)) {
tmp = x + (x * (z - y));
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.35e+92) or not (x <= 5.2e-44): tmp = x + (x * (z - y)) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.35e+92) || !(x <= 5.2e-44)) tmp = Float64(x + Float64(x * Float64(z - y))); 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.35e+92) || ~((x <= 5.2e-44))) tmp = x + (x * (z - y)); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.35e+92], N[Not[LessEqual[x, 5.2e-44]], $MachinePrecision]], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+92} \lor \neg \left(x \leq 5.2 \cdot 10^{-44}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.35e92 or 5.1999999999999996e-44 < x Initial program 100.0%
Taylor expanded in t around 0 83.2%
mul-1-neg83.2%
distribute-rgt-neg-in83.2%
neg-sub083.2%
sub-neg83.2%
+-commutative83.2%
associate--r+83.2%
neg-sub083.2%
remove-double-neg83.2%
Simplified83.2%
if -1.35e92 < x < 5.1999999999999996e-44Initial program 100.0%
Taylor expanded in t around inf 82.7%
Final simplification82.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.2e+14) (not (<= z 300.0))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e+14) || !(z <= 300.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7.2d+14)) .or. (.not. (z <= 300.0d0))) then
tmp = z * (x - t)
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e+14) || !(z <= 300.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.2e+14) or not (z <= 300.0): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.2e+14) || !(z <= 300.0)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.2e+14) || ~((z <= 300.0))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.2e+14], N[Not[LessEqual[z, 300.0]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+14} \lor \neg \left(z \leq 300\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -7.2e14 or 300 < z Initial program 100.0%
Taylor expanded in x around inf 86.7%
+-commutative86.7%
*-commutative86.7%
*-commutative86.7%
associate-/l*87.5%
distribute-lft-out87.5%
Simplified87.5%
Taylor expanded in z around inf 70.6%
associate-*r*70.6%
neg-mul-170.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
Simplified70.6%
Taylor expanded in x around 0 77.0%
+-commutative77.0%
mul-1-neg77.0%
unsub-neg77.0%
distribute-rgt-out--80.2%
Simplified80.2%
if -7.2e14 < z < 300Initial program 100.0%
Taylor expanded in y around inf 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.6e-30) (not (<= z 135.0))) (+ x (* z (- x t))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.6e-30) || !(z <= 135.0)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.6d-30)) .or. (.not. (z <= 135.0d0))) then
tmp = x + (z * (x - t))
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.6e-30) || !(z <= 135.0)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.6e-30) or not (z <= 135.0): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.6e-30) || !(z <= 135.0)) tmp = Float64(x + Float64(z * Float64(x - t))); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.6e-30) || ~((z <= 135.0))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.6e-30], N[Not[LessEqual[z, 135.0]], $MachinePrecision]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-30} \lor \neg \left(z \leq 135\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -2.59999999999999987e-30 or 135 < z Initial program 100.0%
Taylor expanded in y around 0 80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
if -2.59999999999999987e-30 < z < 135Initial program 100.0%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
Simplified92.5%
Final simplification86.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.003))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 0.003)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 0.003d0))) then
tmp = z * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 0.003)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 0.003): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.003)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 0.003))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.003]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.003\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1 or 0.0030000000000000001 < z Initial program 100.0%
Taylor expanded in t around 0 51.6%
mul-1-neg51.6%
distribute-rgt-neg-in51.6%
neg-sub051.6%
sub-neg51.6%
+-commutative51.6%
associate--r+51.6%
neg-sub051.6%
remove-double-neg51.6%
Simplified51.6%
Taylor expanded in z around inf 40.2%
*-commutative40.2%
Simplified40.2%
Taylor expanded in z around inf 40.2%
if -1 < z < 0.0030000000000000001Initial program 100.0%
Taylor expanded in t around inf 76.8%
Taylor expanded in x around inf 35.3%
Final simplification37.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.9e-33) (not (<= y 6.2e-77))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.9e-33) || !(y <= 6.2e-77)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.9d-33)) .or. (.not. (y <= 6.2d-77))) then
tmp = y * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.9e-33) || !(y <= 6.2e-77)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.9e-33) or not (y <= 6.2e-77): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.9e-33) || !(y <= 6.2e-77)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.9e-33) || ~((y <= 6.2e-77))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.9e-33], N[Not[LessEqual[y, 6.2e-77]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-33} \lor \neg \left(y \leq 6.2 \cdot 10^{-77}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.89999999999999997e-33 or 6.20000000000000016e-77 < y Initial program 100.0%
Taylor expanded in y around inf 74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y around inf 75.5%
Taylor expanded in t around inf 40.9%
*-commutative40.9%
Simplified40.9%
if -1.89999999999999997e-33 < y < 6.20000000000000016e-77Initial program 100.0%
Taylor expanded in t around inf 76.7%
Taylor expanded in x around inf 37.9%
Final simplification39.6%
(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 65.9%
Taylor expanded in x around inf 19.0%
Final simplification19.0%
(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 2024095
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))