
(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 15 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 t))))
(if (<= z -3.6e+139)
t_1
(if (<= z -6.2e+56)
(* z x)
(if (<= z -1.85e+30)
t_1
(if (<= z -2.1e-31)
(* x (- 1.0 y))
(if (<= z 2.2e-15)
(+ x (* y t))
(if (or (<= z 6.5e+157) (not (<= z 1.5e+265))) t_1 (* z x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (z <= -3.6e+139) {
tmp = t_1;
} else if (z <= -6.2e+56) {
tmp = z * x;
} else if (z <= -1.85e+30) {
tmp = t_1;
} else if (z <= -2.1e-31) {
tmp = x * (1.0 - y);
} else if (z <= 2.2e-15) {
tmp = x + (y * t);
} else if ((z <= 6.5e+157) || !(z <= 1.5e+265)) {
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 = x - (z * t)
if (z <= (-3.6d+139)) then
tmp = t_1
else if (z <= (-6.2d+56)) then
tmp = z * x
else if (z <= (-1.85d+30)) then
tmp = t_1
else if (z <= (-2.1d-31)) then
tmp = x * (1.0d0 - y)
else if (z <= 2.2d-15) then
tmp = x + (y * t)
else if ((z <= 6.5d+157) .or. (.not. (z <= 1.5d+265))) 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 = x - (z * t);
double tmp;
if (z <= -3.6e+139) {
tmp = t_1;
} else if (z <= -6.2e+56) {
tmp = z * x;
} else if (z <= -1.85e+30) {
tmp = t_1;
} else if (z <= -2.1e-31) {
tmp = x * (1.0 - y);
} else if (z <= 2.2e-15) {
tmp = x + (y * t);
} else if ((z <= 6.5e+157) || !(z <= 1.5e+265)) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) tmp = 0 if z <= -3.6e+139: tmp = t_1 elif z <= -6.2e+56: tmp = z * x elif z <= -1.85e+30: tmp = t_1 elif z <= -2.1e-31: tmp = x * (1.0 - y) elif z <= 2.2e-15: tmp = x + (y * t) elif (z <= 6.5e+157) or not (z <= 1.5e+265): tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) tmp = 0.0 if (z <= -3.6e+139) tmp = t_1; elseif (z <= -6.2e+56) tmp = Float64(z * x); elseif (z <= -1.85e+30) tmp = t_1; elseif (z <= -2.1e-31) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 2.2e-15) tmp = Float64(x + Float64(y * t)); elseif ((z <= 6.5e+157) || !(z <= 1.5e+265)) tmp = t_1; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); tmp = 0.0; if (z <= -3.6e+139) tmp = t_1; elseif (z <= -6.2e+56) tmp = z * x; elseif (z <= -1.85e+30) tmp = t_1; elseif (z <= -2.1e-31) tmp = x * (1.0 - y); elseif (z <= 2.2e-15) tmp = x + (y * t); elseif ((z <= 6.5e+157) || ~((z <= 1.5e+265))) tmp = t_1; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e+139], t$95$1, If[LessEqual[z, -6.2e+56], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.85e+30], t$95$1, If[LessEqual[z, -2.1e-31], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-15], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.5e+157], N[Not[LessEqual[z, 1.5e+265]], $MachinePrecision]], t$95$1, N[(z * x), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{+56}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-15}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+157} \lor \neg \left(z \leq 1.5 \cdot 10^{+265}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -3.59999999999999985e139 or -6.20000000000000009e56 < z < -1.85000000000000008e30 or 2.19999999999999986e-15 < z < 6.5e157 or 1.50000000000000001e265 < z Initial program 99.9%
Taylor expanded in t around inf 72.9%
Taylor expanded in y around 0 60.4%
mul-1-neg60.4%
*-commutative60.4%
distribute-rgt-neg-in60.4%
Simplified60.4%
if -3.59999999999999985e139 < z < -6.20000000000000009e56 or 6.5e157 < z < 1.50000000000000001e265Initial program 100.0%
Taylor expanded in x around inf 65.1%
*-commutative65.1%
mul-1-neg65.1%
unsub-neg65.1%
distribute-lft-out--65.1%
*-rgt-identity65.1%
Simplified65.1%
Taylor expanded in z around inf 57.4%
if -1.85000000000000008e30 < z < -2.09999999999999991e-31Initial program 100.0%
Taylor expanded in x around inf 69.5%
*-commutative69.5%
mul-1-neg69.5%
unsub-neg69.5%
distribute-lft-out--69.5%
*-rgt-identity69.5%
Simplified69.5%
Taylor expanded in x around 0 69.5%
Taylor expanded in z around 0 57.3%
if -2.09999999999999991e-31 < z < 2.19999999999999986e-15Initial program 100.0%
Taylor expanded in t around inf 78.6%
Taylor expanded in y around inf 75.1%
Final simplification66.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))) (t_2 (* x (- (+ z 1.0) y))))
(if (<= x -8.8e+35)
t_2
(if (<= x -8e-274)
t_1
(if (<= x 1.36e-301)
(* y t)
(if (<= x 5.3e-266) t_1 (if (<= x 5.3e-40) (+ x (* y t)) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double t_2 = x * ((z + 1.0) - y);
double tmp;
if (x <= -8.8e+35) {
tmp = t_2;
} else if (x <= -8e-274) {
tmp = t_1;
} else if (x <= 1.36e-301) {
tmp = y * t;
} else if (x <= 5.3e-266) {
tmp = t_1;
} else if (x <= 5.3e-40) {
tmp = x + (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 - (z * t)
t_2 = x * ((z + 1.0d0) - y)
if (x <= (-8.8d+35)) then
tmp = t_2
else if (x <= (-8d-274)) then
tmp = t_1
else if (x <= 1.36d-301) then
tmp = y * t
else if (x <= 5.3d-266) then
tmp = t_1
else if (x <= 5.3d-40) then
tmp = x + (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 - (z * t);
double t_2 = x * ((z + 1.0) - y);
double tmp;
if (x <= -8.8e+35) {
tmp = t_2;
} else if (x <= -8e-274) {
tmp = t_1;
} else if (x <= 1.36e-301) {
tmp = y * t;
} else if (x <= 5.3e-266) {
tmp = t_1;
} else if (x <= 5.3e-40) {
tmp = x + (y * t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) t_2 = x * ((z + 1.0) - y) tmp = 0 if x <= -8.8e+35: tmp = t_2 elif x <= -8e-274: tmp = t_1 elif x <= 1.36e-301: tmp = y * t elif x <= 5.3e-266: tmp = t_1 elif x <= 5.3e-40: tmp = x + (y * t) 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 + 1.0) - y)) tmp = 0.0 if (x <= -8.8e+35) tmp = t_2; elseif (x <= -8e-274) tmp = t_1; elseif (x <= 1.36e-301) tmp = Float64(y * t); elseif (x <= 5.3e-266) tmp = t_1; elseif (x <= 5.3e-40) tmp = Float64(x + Float64(y * t)); 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 + 1.0) - y); tmp = 0.0; if (x <= -8.8e+35) tmp = t_2; elseif (x <= -8e-274) tmp = t_1; elseif (x <= 1.36e-301) tmp = y * t; elseif (x <= 5.3e-266) tmp = t_1; elseif (x <= 5.3e-40) tmp = x + (y * t); 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 + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.8e+35], t$95$2, If[LessEqual[x, -8e-274], t$95$1, If[LessEqual[x, 1.36e-301], N[(y * t), $MachinePrecision], If[LessEqual[x, 5.3e-266], t$95$1, If[LessEqual[x, 5.3e-40], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
t_2 := x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{+35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-274}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.36 \cdot 10^{-301}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{-266}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{-40}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -8.7999999999999994e35 or 5.3000000000000002e-40 < x Initial program 100.0%
Taylor expanded in x around inf 84.5%
*-commutative84.5%
mul-1-neg84.5%
unsub-neg84.5%
distribute-lft-out--84.5%
*-rgt-identity84.5%
Simplified84.5%
Taylor expanded in x around 0 84.5%
if -8.7999999999999994e35 < x < -7.99999999999999973e-274 or 1.36e-301 < x < 5.3000000000000003e-266Initial program 99.9%
Taylor expanded in t around inf 91.5%
Taylor expanded in y around 0 58.9%
mul-1-neg58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
Simplified58.9%
if -7.99999999999999973e-274 < x < 1.36e-301Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in y around inf 82.3%
Taylor expanded in x around 0 82.3%
if 5.3000000000000003e-266 < x < 5.3000000000000002e-40Initial program 99.9%
Taylor expanded in t around inf 83.6%
Taylor expanded in y around inf 58.9%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 (if (<= x -6.8e+260) (* x (+ z 1.0)) (if (or (<= x -4.6e+78) (not (<= x 2.3e-36))) (* x (- 1.0 y)) (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e+260) {
tmp = x * (z + 1.0);
} else if ((x <= -4.6e+78) || !(x <= 2.3e-36)) {
tmp = x * (1.0 - y);
} 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 (x <= (-6.8d+260)) then
tmp = x * (z + 1.0d0)
else if ((x <= (-4.6d+78)) .or. (.not. (x <= 2.3d-36))) then
tmp = x * (1.0d0 - y)
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 (x <= -6.8e+260) {
tmp = x * (z + 1.0);
} else if ((x <= -4.6e+78) || !(x <= 2.3e-36)) {
tmp = x * (1.0 - y);
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.8e+260: tmp = x * (z + 1.0) elif (x <= -4.6e+78) or not (x <= 2.3e-36): tmp = x * (1.0 - y) else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.8e+260) tmp = Float64(x * Float64(z + 1.0)); elseif ((x <= -4.6e+78) || !(x <= 2.3e-36)) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.8e+260) tmp = x * (z + 1.0); elseif ((x <= -4.6e+78) || ~((x <= 2.3e-36))) tmp = x * (1.0 - y); else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.8e+260], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -4.6e+78], N[Not[LessEqual[x, 2.3e-36]], $MachinePrecision]], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+260}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{+78} \lor \neg \left(x \leq 2.3 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if x < -6.7999999999999995e260Initial program 100.0%
Taylor expanded in x around -inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
if -6.7999999999999995e260 < x < -4.6000000000000004e78 or 2.29999999999999996e-36 < x Initial program 100.0%
Taylor expanded in x around inf 85.2%
*-commutative85.2%
mul-1-neg85.2%
unsub-neg85.2%
distribute-lft-out--85.3%
*-rgt-identity85.3%
Simplified85.3%
Taylor expanded in x around 0 85.2%
Taylor expanded in z around 0 63.5%
if -4.6000000000000004e78 < x < 2.29999999999999996e-36Initial program 99.9%
Taylor expanded in t around inf 88.0%
Taylor expanded in y around inf 51.4%
Taylor expanded in x around 0 47.6%
Final simplification56.8%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.45e+261)
(* x (+ z 1.0))
(if (or (<= x -7.5e+78) (not (<= x 1.12e+79)))
(* x (- 1.0 y))
(+ x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e+261) {
tmp = x * (z + 1.0);
} else if ((x <= -7.5e+78) || !(x <= 1.12e+79)) {
tmp = x * (1.0 - y);
} else {
tmp = x + (y * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.45d+261)) then
tmp = x * (z + 1.0d0)
else if ((x <= (-7.5d+78)) .or. (.not. (x <= 1.12d+79))) then
tmp = x * (1.0d0 - y)
else
tmp = x + (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e+261) {
tmp = x * (z + 1.0);
} else if ((x <= -7.5e+78) || !(x <= 1.12e+79)) {
tmp = x * (1.0 - y);
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.45e+261: tmp = x * (z + 1.0) elif (x <= -7.5e+78) or not (x <= 1.12e+79): tmp = x * (1.0 - y) else: tmp = x + (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.45e+261) tmp = Float64(x * Float64(z + 1.0)); elseif ((x <= -7.5e+78) || !(x <= 1.12e+79)) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.45e+261) tmp = x * (z + 1.0); elseif ((x <= -7.5e+78) || ~((x <= 1.12e+79))) tmp = x * (1.0 - y); else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.45e+261], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -7.5e+78], N[Not[LessEqual[x, 1.12e+79]], $MachinePrecision]], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+261}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+78} \lor \neg \left(x \leq 1.12 \cdot 10^{+79}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
if x < -1.45e261Initial program 100.0%
Taylor expanded in x around -inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
if -1.45e261 < x < -7.49999999999999934e78 or 1.12e79 < x Initial program 100.0%
Taylor expanded in x around inf 92.0%
*-commutative92.0%
mul-1-neg92.0%
unsub-neg92.0%
distribute-lft-out--92.1%
*-rgt-identity92.1%
Simplified92.1%
Taylor expanded in x around 0 92.0%
Taylor expanded in z around 0 71.6%
if -7.49999999999999934e78 < x < 1.12e79Initial program 100.0%
Taylor expanded in t around inf 83.4%
Taylor expanded in y around inf 50.5%
Final simplification59.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -9.6e+253)
(* x (+ z 1.0))
(if (<= x -3.5e+79)
(* x (- 1.0 y))
(if (<= x 1.95e+79) (+ x (* y t)) (- x (* y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.6e+253) {
tmp = x * (z + 1.0);
} else if (x <= -3.5e+79) {
tmp = x * (1.0 - y);
} else if (x <= 1.95e+79) {
tmp = x + (y * t);
} else {
tmp = x - (y * x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-9.6d+253)) then
tmp = x * (z + 1.0d0)
else if (x <= (-3.5d+79)) then
tmp = x * (1.0d0 - y)
else if (x <= 1.95d+79) then
tmp = x + (y * t)
else
tmp = x - (y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.6e+253) {
tmp = x * (z + 1.0);
} else if (x <= -3.5e+79) {
tmp = x * (1.0 - y);
} else if (x <= 1.95e+79) {
tmp = x + (y * t);
} else {
tmp = x - (y * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.6e+253: tmp = x * (z + 1.0) elif x <= -3.5e+79: tmp = x * (1.0 - y) elif x <= 1.95e+79: tmp = x + (y * t) else: tmp = x - (y * x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.6e+253) tmp = Float64(x * Float64(z + 1.0)); elseif (x <= -3.5e+79) tmp = Float64(x * Float64(1.0 - y)); elseif (x <= 1.95e+79) tmp = Float64(x + Float64(y * t)); else tmp = Float64(x - Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.6e+253) tmp = x * (z + 1.0); elseif (x <= -3.5e+79) tmp = x * (1.0 - y); elseif (x <= 1.95e+79) tmp = x + (y * t); else tmp = x - (y * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.6e+253], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.5e+79], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+79], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{+253}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+79}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+79}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot x\\
\end{array}
\end{array}
if x < -9.59999999999999965e253Initial program 100.0%
Taylor expanded in x around -inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
if -9.59999999999999965e253 < x < -3.4999999999999998e79Initial program 100.0%
Taylor expanded in x around inf 90.2%
*-commutative90.2%
mul-1-neg90.2%
unsub-neg90.2%
distribute-lft-out--90.2%
*-rgt-identity90.2%
Simplified90.2%
Taylor expanded in x around 0 90.2%
Taylor expanded in z around 0 73.8%
if -3.4999999999999998e79 < x < 1.9499999999999999e79Initial program 100.0%
Taylor expanded in t around inf 83.4%
Taylor expanded in y around inf 50.5%
if 1.9499999999999999e79 < x Initial program 100.0%
Taylor expanded in x around inf 93.4%
*-commutative93.4%
mul-1-neg93.4%
unsub-neg93.4%
distribute-lft-out--93.4%
*-rgt-identity93.4%
Simplified93.4%
Taylor expanded in z around 0 70.0%
Final simplification59.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.35e+79) (not (<= x 6.4e-40))) (* x (- (+ z 1.0) y)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.35e+79) || !(x <= 6.4e-40)) {
tmp = x * ((z + 1.0) - 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 <= (-2.35d+79)) .or. (.not. (x <= 6.4d-40))) then
tmp = x * ((z + 1.0d0) - 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 <= -2.35e+79) || !(x <= 6.4e-40)) {
tmp = x * ((z + 1.0) - y);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.35e+79) or not (x <= 6.4e-40): tmp = x * ((z + 1.0) - y) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.35e+79) || !(x <= 6.4e-40)) tmp = Float64(x * Float64(Float64(z + 1.0) - 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 <= -2.35e+79) || ~((x <= 6.4e-40))) tmp = x * ((z + 1.0) - y); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.35e+79], N[Not[LessEqual[x, 6.4e-40]], $MachinePrecision]], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{+79} \lor \neg \left(x \leq 6.4 \cdot 10^{-40}\right):\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -2.35000000000000011e79 or 6.40000000000000004e-40 < x Initial program 100.0%
Taylor expanded in x around inf 86.2%
*-commutative86.2%
mul-1-neg86.2%
unsub-neg86.2%
distribute-lft-out--86.2%
*-rgt-identity86.2%
Simplified86.2%
Taylor expanded in x around 0 86.2%
if -2.35000000000000011e79 < x < 6.40000000000000004e-40Initial program 99.9%
Taylor expanded in t around inf 88.6%
Final simplification87.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.8e-8) (not (<= y 2.4e-6))) (+ x (* y (- t x))) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.8e-8) || !(y <= 2.4e-6)) {
tmp = x + (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 <= (-2.8d-8)) .or. (.not. (y <= 2.4d-6))) then
tmp = x + (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 <= -2.8e-8) || !(y <= 2.4e-6)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.8e-8) or not (y <= 2.4e-6): tmp = x + (y * (t - x)) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.8e-8) || !(y <= 2.4e-6)) tmp = Float64(x + 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 <= -2.8e-8) || ~((y <= 2.4e-6))) tmp = x + (y * (t - x)); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.8e-8], N[Not[LessEqual[y, 2.4e-6]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-8} \lor \neg \left(y \leq 2.4 \cdot 10^{-6}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -2.7999999999999999e-8 or 2.3999999999999999e-6 < y Initial program 99.9%
Taylor expanded in z around 0 86.5%
if -2.7999999999999999e-8 < y < 2.3999999999999999e-6Initial program 100.0%
Taylor expanded in y around 0 93.1%
+-commutative93.1%
mul-1-neg93.1%
unsub-neg93.1%
*-commutative93.1%
Simplified93.1%
Final simplification89.3%
(FPCore (x y z t) :precision binary64 (if (<= x -4.2e+78) (* x (- (+ z 1.0) y)) (if (<= x 1.22e-39) (+ x (* (- y z) t)) (+ x (* x (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e+78) {
tmp = x * ((z + 1.0) - y);
} else if (x <= 1.22e-39) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-4.2d+78)) then
tmp = x * ((z + 1.0d0) - y)
else if (x <= 1.22d-39) then
tmp = x + ((y - z) * t)
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e+78) {
tmp = x * ((z + 1.0) - y);
} else if (x <= 1.22e-39) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.2e+78: tmp = x * ((z + 1.0) - y) elif x <= 1.22e-39: tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.2e+78) tmp = Float64(x * Float64(Float64(z + 1.0) - y)); elseif (x <= 1.22e-39) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.2e+78) tmp = x * ((z + 1.0) - y); elseif (x <= 1.22e-39) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.2e+78], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e-39], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+78}:\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-39}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if x < -4.2000000000000002e78Initial program 100.0%
Taylor expanded in x around inf 92.7%
*-commutative92.7%
mul-1-neg92.7%
unsub-neg92.7%
distribute-lft-out--92.7%
*-rgt-identity92.7%
Simplified92.7%
Taylor expanded in x around 0 92.7%
if -4.2000000000000002e78 < x < 1.2200000000000001e-39Initial program 99.9%
Taylor expanded in t around inf 88.6%
if 1.2200000000000001e-39 < x Initial program 100.0%
Taylor expanded in x around inf 82.0%
*-commutative82.0%
mul-1-neg82.0%
unsub-neg82.0%
distribute-lft-out--82.1%
*-rgt-identity82.1%
Simplified82.1%
Final simplification87.5%
(FPCore (x y z t) :precision binary64 (if (<= x -1.95e+211) x (if (or (<= x -7.5e+78) (not (<= x 1.35e+79))) (* y (- x)) (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.95e+211) {
tmp = x;
} else if ((x <= -7.5e+78) || !(x <= 1.35e+79)) {
tmp = y * -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 (x <= (-1.95d+211)) then
tmp = x
else if ((x <= (-7.5d+78)) .or. (.not. (x <= 1.35d+79))) then
tmp = y * -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 (x <= -1.95e+211) {
tmp = x;
} else if ((x <= -7.5e+78) || !(x <= 1.35e+79)) {
tmp = y * -x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.95e+211: tmp = x elif (x <= -7.5e+78) or not (x <= 1.35e+79): tmp = y * -x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.95e+211) tmp = x; elseif ((x <= -7.5e+78) || !(x <= 1.35e+79)) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.95e+211) tmp = x; elseif ((x <= -7.5e+78) || ~((x <= 1.35e+79))) tmp = y * -x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.95e+211], x, If[Or[LessEqual[x, -7.5e+78], N[Not[LessEqual[x, 1.35e+79]], $MachinePrecision]], N[(y * (-x)), $MachinePrecision], N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+211}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+78} \lor \neg \left(x \leq 1.35 \cdot 10^{+79}\right):\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if x < -1.95000000000000011e211Initial program 100.0%
Taylor expanded in t around inf 51.9%
Taylor expanded in y around inf 47.2%
Taylor expanded in x around inf 47.2%
if -1.95000000000000011e211 < x < -7.49999999999999934e78 or 1.35e79 < x Initial program 100.0%
Taylor expanded in x around inf 91.4%
*-commutative91.4%
mul-1-neg91.4%
unsub-neg91.4%
distribute-lft-out--91.4%
*-rgt-identity91.4%
Simplified91.4%
Taylor expanded in y around inf 50.5%
mul-1-neg50.5%
distribute-rgt-neg-in50.5%
Simplified50.5%
if -7.49999999999999934e78 < x < 1.35e79Initial program 100.0%
Taylor expanded in t around inf 83.4%
Taylor expanded in y around inf 50.5%
Taylor expanded in x around 0 43.7%
Final simplification46.0%
(FPCore (x y z t) :precision binary64 (if (<= y -7.5e-24) (* y t) (if (<= y -3.9e-157) (* z x) (if (<= y 1.12e-32) x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e-24) {
tmp = y * t;
} else if (y <= -3.9e-157) {
tmp = z * x;
} else if (y <= 1.12e-32) {
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 <= (-7.5d-24)) then
tmp = y * t
else if (y <= (-3.9d-157)) then
tmp = z * x
else if (y <= 1.12d-32) 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 <= -7.5e-24) {
tmp = y * t;
} else if (y <= -3.9e-157) {
tmp = z * x;
} else if (y <= 1.12e-32) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e-24: tmp = y * t elif y <= -3.9e-157: tmp = z * x elif y <= 1.12e-32: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e-24) tmp = Float64(y * t); elseif (y <= -3.9e-157) tmp = Float64(z * x); elseif (y <= 1.12e-32) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e-24) tmp = y * t; elseif (y <= -3.9e-157) tmp = z * x; elseif (y <= 1.12e-32) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e-24], N[(y * t), $MachinePrecision], If[LessEqual[y, -3.9e-157], N[(z * x), $MachinePrecision], If[LessEqual[y, 1.12e-32], x, N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-24}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-157}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-32}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -7.50000000000000007e-24 or 1.12e-32 < y Initial program 99.9%
Taylor expanded in t around inf 62.6%
Taylor expanded in y around inf 50.0%
Taylor expanded in x around 0 48.6%
if -7.50000000000000007e-24 < y < -3.89999999999999999e-157Initial program 99.9%
Taylor expanded in x around inf 70.0%
*-commutative70.0%
mul-1-neg70.0%
unsub-neg70.0%
distribute-lft-out--70.0%
*-rgt-identity70.0%
Simplified70.0%
Taylor expanded in z around inf 47.6%
if -3.89999999999999999e-157 < y < 1.12e-32Initial program 100.0%
Taylor expanded in t around inf 81.0%
Taylor expanded in y around inf 39.6%
Taylor expanded in x around inf 35.8%
Final simplification44.6%
(FPCore (x y z t) :precision binary64 (if (<= y -1.2e-19) (* y t) (if (<= y 2.5e-6) (* x (+ z 1.0)) (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-19) {
tmp = y * t;
} else if (y <= 2.5e-6) {
tmp = x * (z + 1.0);
} 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 <= (-1.2d-19)) then
tmp = y * t
else if (y <= 2.5d-6) then
tmp = x * (z + 1.0d0)
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 <= -1.2e-19) {
tmp = y * t;
} else if (y <= 2.5e-6) {
tmp = x * (z + 1.0);
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.2e-19: tmp = y * t elif y <= 2.5e-6: tmp = x * (z + 1.0) else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e-19) tmp = Float64(y * t); elseif (y <= 2.5e-6) tmp = Float64(x * Float64(z + 1.0)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.2e-19) tmp = y * t; elseif (y <= 2.5e-6) tmp = x * (z + 1.0); else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e-19], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.5e-6], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-19}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.20000000000000011e-19 or 2.5000000000000002e-6 < y Initial program 99.9%
Taylor expanded in t around inf 62.1%
Taylor expanded in y around inf 50.4%
Taylor expanded in x around 0 49.7%
if -1.20000000000000011e-19 < y < 2.5000000000000002e-6Initial program 100.0%
Taylor expanded in x around -inf 57.9%
mul-1-neg57.9%
distribute-rgt-neg-in57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 57.4%
Final simplification53.0%
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -4.1e-48) (* y t) (if (<= y 4.3e-32) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e-48) {
tmp = y * t;
} else if (y <= 4.3e-32) {
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 <= (-4.1d-48)) then
tmp = y * t
else if (y <= 4.3d-32) 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 <= -4.1e-48) {
tmp = y * t;
} else if (y <= 4.3e-32) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.1e-48: tmp = y * t elif y <= 4.3e-32: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.1e-48) tmp = Float64(y * t); elseif (y <= 4.3e-32) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.1e-48) tmp = y * t; elseif (y <= 4.3e-32) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.1e-48], N[(y * t), $MachinePrecision], If[LessEqual[y, 4.3e-32], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-48}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-32}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -4.10000000000000014e-48 or 4.2999999999999999e-32 < y Initial program 100.0%
Taylor expanded in t around inf 61.7%
Taylor expanded in y around inf 49.4%
Taylor expanded in x around 0 48.0%
if -4.10000000000000014e-48 < y < 4.2999999999999999e-32Initial program 100.0%
Taylor expanded in t around inf 77.3%
Taylor expanded in y around inf 38.9%
Taylor expanded in x around inf 34.4%
Final simplification42.7%
(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.8%
Taylor expanded in y around inf 45.4%
Taylor expanded in x around inf 15.5%
Final simplification15.5%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2023176
(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))))