
(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%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -1.45e+78)
t_1
(if (<= z -2.1e-122)
(* (- y z) t)
(if (<= z 3.9e-63)
(* x (- 1.0 y))
(if (<= z 5e+51) (* y (- t x)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.45e+78) {
tmp = t_1;
} else if (z <= -2.1e-122) {
tmp = (y - z) * t;
} else if (z <= 3.9e-63) {
tmp = x * (1.0 - y);
} else if (z <= 5e+51) {
tmp = y * (t - x);
} 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.45d+78)) then
tmp = t_1
else if (z <= (-2.1d-122)) then
tmp = (y - z) * t
else if (z <= 3.9d-63) then
tmp = x * (1.0d0 - y)
else if (z <= 5d+51) then
tmp = y * (t - x)
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.45e+78) {
tmp = t_1;
} else if (z <= -2.1e-122) {
tmp = (y - z) * t;
} else if (z <= 3.9e-63) {
tmp = x * (1.0 - y);
} else if (z <= 5e+51) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1.45e+78: tmp = t_1 elif z <= -2.1e-122: tmp = (y - z) * t elif z <= 3.9e-63: tmp = x * (1.0 - y) elif z <= 5e+51: tmp = y * (t - x) 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.45e+78) tmp = t_1; elseif (z <= -2.1e-122) tmp = Float64(Float64(y - z) * t); elseif (z <= 3.9e-63) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 5e+51) tmp = Float64(y * Float64(t - x)); 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.45e+78) tmp = t_1; elseif (z <= -2.1e-122) tmp = (y - z) * t; elseif (z <= 3.9e-63) tmp = x * (1.0 - y); elseif (z <= 5e+51) tmp = y * (t - x); 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.45e+78], t$95$1, If[LessEqual[z, -2.1e-122], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 3.9e-63], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+51], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-122}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+51}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.45000000000000008e78 or 5e51 < z Initial program 100.0%
Taylor expanded in x around 0 94.8%
fma-define94.8%
+-commutative94.8%
mul-1-neg94.8%
Simplified94.8%
Taylor expanded in z around inf 86.1%
neg-mul-186.1%
unsub-neg86.1%
Simplified86.1%
if -1.45000000000000008e78 < z < -2.09999999999999992e-122Initial program 100.0%
Taylor expanded in x around 0 97.9%
fma-define97.9%
+-commutative97.9%
mul-1-neg97.9%
Simplified97.9%
Taylor expanded in t around inf 67.4%
if -2.09999999999999992e-122 < z < 3.90000000000000022e-63Initial program 100.0%
Taylor expanded in x around inf 70.1%
mul-1-neg70.1%
unsub-neg70.1%
Simplified70.1%
Taylor expanded in z around 0 70.1%
if 3.90000000000000022e-63 < z < 5e51Initial program 99.9%
Taylor expanded in x around 0 99.9%
fma-define100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 79.0%
mul-1-neg79.0%
unsub-neg79.0%
Simplified79.0%
Final simplification76.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* (- y z) t)))
(if (<= y -1e+99)
t_1
(if (<= y -1.7e-111)
t_2
(if (<= y 4.8e-52) (* x (+ z 1.0)) (if (<= y 1.85e+15) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = (y - z) * t;
double tmp;
if (y <= -1e+99) {
tmp = t_1;
} else if (y <= -1.7e-111) {
tmp = t_2;
} else if (y <= 4.8e-52) {
tmp = x * (z + 1.0);
} else if (y <= 1.85e+15) {
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 = (y - z) * t
if (y <= (-1d+99)) then
tmp = t_1
else if (y <= (-1.7d-111)) then
tmp = t_2
else if (y <= 4.8d-52) then
tmp = x * (z + 1.0d0)
else if (y <= 1.85d+15) 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 = (y - z) * t;
double tmp;
if (y <= -1e+99) {
tmp = t_1;
} else if (y <= -1.7e-111) {
tmp = t_2;
} else if (y <= 4.8e-52) {
tmp = x * (z + 1.0);
} else if (y <= 1.85e+15) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = (y - z) * t tmp = 0 if y <= -1e+99: tmp = t_1 elif y <= -1.7e-111: tmp = t_2 elif y <= 4.8e-52: tmp = x * (z + 1.0) elif y <= 1.85e+15: 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(Float64(y - z) * t) tmp = 0.0 if (y <= -1e+99) tmp = t_1; elseif (y <= -1.7e-111) tmp = t_2; elseif (y <= 4.8e-52) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 1.85e+15) 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 = (y - z) * t; tmp = 0.0; if (y <= -1e+99) tmp = t_1; elseif (y <= -1.7e-111) tmp = t_2; elseif (y <= 4.8e-52) tmp = x * (z + 1.0); elseif (y <= 1.85e+15) 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[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -1e+99], t$95$1, If[LessEqual[y, -1.7e-111], t$95$2, If[LessEqual[y, 4.8e-52], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+15], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -1 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-111}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-52}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.9999999999999997e98 or 1.85e15 < y Initial program 100.0%
Taylor expanded in x around 0 94.0%
fma-define94.9%
+-commutative94.9%
mul-1-neg94.9%
Simplified94.9%
Taylor expanded in y around inf 79.3%
mul-1-neg79.3%
unsub-neg79.3%
Simplified79.3%
if -9.9999999999999997e98 < y < -1.69999999999999998e-111 or 4.8000000000000003e-52 < y < 1.85e15Initial program 100.0%
Taylor expanded in x around 0 98.3%
fma-define98.3%
+-commutative98.3%
mul-1-neg98.3%
Simplified98.3%
Taylor expanded in t around inf 63.5%
if -1.69999999999999998e-111 < y < 4.8000000000000003e-52Initial program 100.0%
Taylor expanded in x around inf 69.0%
mul-1-neg69.0%
unsub-neg69.0%
Simplified69.0%
Taylor expanded in y around 0 69.0%
+-commutative69.0%
Simplified69.0%
Final simplification72.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -1.5e+78)
(* y t)
(if (<= y -2.05e-159)
t_1
(if (<= y 3.6e-59) x (if (<= y 2.85e+17) t_1 (* y (- x))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -1.5e+78) {
tmp = y * t;
} else if (y <= -2.05e-159) {
tmp = t_1;
} else if (y <= 3.6e-59) {
tmp = x;
} else if (y <= 2.85e+17) {
tmp = t_1;
} else {
tmp = y * -x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-1.5d+78)) then
tmp = y * t
else if (y <= (-2.05d-159)) then
tmp = t_1
else if (y <= 3.6d-59) then
tmp = x
else if (y <= 2.85d+17) then
tmp = t_1
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -1.5e+78) {
tmp = y * t;
} else if (y <= -2.05e-159) {
tmp = t_1;
} else if (y <= 3.6e-59) {
tmp = x;
} else if (y <= 2.85e+17) {
tmp = t_1;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -1.5e+78: tmp = y * t elif y <= -2.05e-159: tmp = t_1 elif y <= 3.6e-59: tmp = x elif y <= 2.85e+17: tmp = t_1 else: tmp = y * -x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -1.5e+78) tmp = Float64(y * t); elseif (y <= -2.05e-159) tmp = t_1; elseif (y <= 3.6e-59) tmp = x; elseif (y <= 2.85e+17) tmp = t_1; else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -1.5e+78) tmp = y * t; elseif (y <= -2.05e-159) tmp = t_1; elseif (y <= 3.6e-59) tmp = x; elseif (y <= 2.85e+17) tmp = t_1; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -1.5e+78], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.05e-159], t$95$1, If[LessEqual[y, 3.6e-59], x, If[LessEqual[y, 2.85e+17], t$95$1, N[(y * (-x)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+78}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-59}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if y < -1.49999999999999991e78Initial program 100.0%
Taylor expanded in x around 0 93.1%
fma-define93.2%
+-commutative93.2%
mul-1-neg93.2%
Simplified93.2%
Taylor expanded in z around inf 71.3%
Taylor expanded in y around inf 53.4%
if -1.49999999999999991e78 < y < -2.05000000000000007e-159 or 3.6e-59 < y < 2.85e17Initial program 100.0%
Taylor expanded in y around 0 75.2%
mul-1-neg75.2%
unsub-neg75.2%
Simplified75.2%
Taylor expanded in t around inf 58.2%
*-commutative58.2%
Simplified58.2%
Taylor expanded in x around 0 41.9%
mul-1-neg41.9%
*-commutative41.9%
distribute-rgt-neg-in41.9%
Simplified41.9%
if -2.05000000000000007e-159 < y < 3.6e-59Initial program 100.0%
Taylor expanded in y around inf 52.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in y around 0 45.6%
if 2.85e17 < y Initial program 100.0%
Taylor expanded in x around inf 59.9%
mul-1-neg59.9%
unsub-neg59.9%
Simplified59.9%
Taylor expanded in y around inf 47.8%
mul-1-neg47.8%
distribute-lft-neg-out47.8%
*-commutative47.8%
Simplified47.8%
Final simplification46.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.8e+77)
(* z x)
(if (<= z 4.6e-158)
(* y t)
(if (<= z 5e-63) x (if (<= z 7.8e+40) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e+77) {
tmp = z * x;
} else if (z <= 4.6e-158) {
tmp = y * t;
} else if (z <= 5e-63) {
tmp = x;
} else if (z <= 7.8e+40) {
tmp = y * t;
} 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) :: tmp
if (z <= (-2.8d+77)) then
tmp = z * x
else if (z <= 4.6d-158) then
tmp = y * t
else if (z <= 5d-63) then
tmp = x
else if (z <= 7.8d+40) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e+77) {
tmp = z * x;
} else if (z <= 4.6e-158) {
tmp = y * t;
} else if (z <= 5e-63) {
tmp = x;
} else if (z <= 7.8e+40) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.8e+77: tmp = z * x elif z <= 4.6e-158: tmp = y * t elif z <= 5e-63: tmp = x elif z <= 7.8e+40: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.8e+77) tmp = Float64(z * x); elseif (z <= 4.6e-158) tmp = Float64(y * t); elseif (z <= 5e-63) tmp = x; elseif (z <= 7.8e+40) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.8e+77) tmp = z * x; elseif (z <= 4.6e-158) tmp = y * t; elseif (z <= 5e-63) tmp = x; elseif (z <= 7.8e+40) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.8e+77], N[(z * x), $MachinePrecision], If[LessEqual[z, 4.6e-158], N[(y * t), $MachinePrecision], If[LessEqual[z, 5e-63], x, If[LessEqual[z, 7.8e+40], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+77}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-158}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+40}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -2.8e77 or 7.8000000000000002e40 < z Initial program 100.0%
Taylor expanded in x around inf 56.0%
mul-1-neg56.0%
unsub-neg56.0%
Simplified56.0%
Taylor expanded in z around inf 45.6%
*-commutative45.6%
Simplified45.6%
if -2.8e77 < z < 4.5999999999999998e-158 or 5.0000000000000002e-63 < z < 7.8000000000000002e40Initial program 100.0%
Taylor expanded in x around 0 97.8%
fma-define98.6%
+-commutative98.6%
mul-1-neg98.6%
Simplified98.6%
Taylor expanded in z around inf 53.6%
Taylor expanded in y around inf 39.0%
if 4.5999999999999998e-158 < z < 5.0000000000000002e-63Initial program 100.0%
Taylor expanded in y around inf 94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in y around 0 66.3%
Final simplification43.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -1.3)
t_1
(if (<= z 1.2e-59) (+ x (* y t)) (if (<= z 6.5e+52) (* y (- t x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.3) {
tmp = t_1;
} else if (z <= 1.2e-59) {
tmp = x + (y * t);
} else if (z <= 6.5e+52) {
tmp = y * (t - x);
} 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.3d0)) then
tmp = t_1
else if (z <= 1.2d-59) then
tmp = x + (y * t)
else if (z <= 6.5d+52) then
tmp = y * (t - x)
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.3) {
tmp = t_1;
} else if (z <= 1.2e-59) {
tmp = x + (y * t);
} else if (z <= 6.5e+52) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1.3: tmp = t_1 elif z <= 1.2e-59: tmp = x + (y * t) elif z <= 6.5e+52: tmp = y * (t - x) 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.3) tmp = t_1; elseif (z <= 1.2e-59) tmp = Float64(x + Float64(y * t)); elseif (z <= 6.5e+52) tmp = Float64(y * Float64(t - x)); 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.3) tmp = t_1; elseif (z <= 1.2e-59) tmp = x + (y * t); elseif (z <= 6.5e+52) tmp = y * (t - x); 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.3], t$95$1, If[LessEqual[z, 1.2e-59], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+52], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1.3:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-59}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.30000000000000004 or 6.49999999999999996e52 < z Initial program 100.0%
Taylor expanded in x around 0 94.8%
fma-define94.9%
+-commutative94.9%
mul-1-neg94.9%
Simplified94.9%
Taylor expanded in z around inf 83.4%
neg-mul-183.4%
unsub-neg83.4%
Simplified83.4%
if -1.30000000000000004 < z < 1.20000000000000008e-59Initial program 100.0%
Taylor expanded in t around inf 77.9%
Taylor expanded in y around inf 72.7%
if 1.20000000000000008e-59 < z < 6.49999999999999996e52Initial program 99.9%
Taylor expanded in x around 0 99.9%
fma-define100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 79.0%
mul-1-neg79.0%
unsub-neg79.0%
Simplified79.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (- y z) -2e-11) (not (<= (- y z) 2e-51))) (* (- y z) t) x))
double code(double x, double y, double z, double t) {
double tmp;
if (((y - z) <= -2e-11) || !((y - z) <= 2e-51)) {
tmp = (y - z) * 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 - z) <= (-2d-11)) .or. (.not. ((y - z) <= 2d-51))) then
tmp = (y - z) * 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 - z) <= -2e-11) || !((y - z) <= 2e-51)) {
tmp = (y - z) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((y - z) <= -2e-11) or not ((y - z) <= 2e-51): tmp = (y - z) * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(y - z) <= -2e-11) || !(Float64(y - z) <= 2e-51)) tmp = Float64(Float64(y - z) * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((y - z) <= -2e-11) || ~(((y - z) <= 2e-51))) tmp = (y - z) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(y - z), $MachinePrecision], -2e-11], N[Not[LessEqual[N[(y - z), $MachinePrecision], 2e-51]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y - z \leq -2 \cdot 10^{-11} \lor \neg \left(y - z \leq 2 \cdot 10^{-51}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (-.f64 y z) < -1.99999999999999988e-11 or 2e-51 < (-.f64 y z) Initial program 100.0%
Taylor expanded in x around 0 96.0%
fma-define96.5%
+-commutative96.5%
mul-1-neg96.5%
Simplified96.5%
Taylor expanded in t around inf 53.1%
if -1.99999999999999988e-11 < (-.f64 y z) < 2e-51Initial program 100.0%
Taylor expanded in y around inf 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in y around 0 72.1%
Final simplification57.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.15e+64) (* y t) (if (<= y 9e-51) x (if (<= y 6.2e+26) (* y t) (* y (- x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+64) {
tmp = y * t;
} else if (y <= 9e-51) {
tmp = x;
} else if (y <= 6.2e+26) {
tmp = y * t;
} else {
tmp = y * -x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.15d+64)) then
tmp = y * t
else if (y <= 9d-51) then
tmp = x
else if (y <= 6.2d+26) then
tmp = y * t
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+64) {
tmp = y * t;
} else if (y <= 9e-51) {
tmp = x;
} else if (y <= 6.2e+26) {
tmp = y * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e+64: tmp = y * t elif y <= 9e-51: tmp = x elif y <= 6.2e+26: tmp = y * t else: tmp = y * -x return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e+64) tmp = Float64(y * t); elseif (y <= 9e-51) tmp = x; elseif (y <= 6.2e+26) tmp = Float64(y * t); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.15e+64) tmp = y * t; elseif (y <= 9e-51) tmp = x; elseif (y <= 6.2e+26) tmp = y * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e+64], N[(y * t), $MachinePrecision], If[LessEqual[y, 9e-51], x, If[LessEqual[y, 6.2e+26], N[(y * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+64}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+26}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if y < -1.15e64 or 8.99999999999999948e-51 < y < 6.1999999999999999e26Initial program 100.0%
Taylor expanded in x around 0 95.1%
fma-define95.2%
+-commutative95.2%
mul-1-neg95.2%
Simplified95.2%
Taylor expanded in z around inf 77.1%
Taylor expanded in y around inf 48.4%
if -1.15e64 < y < 8.99999999999999948e-51Initial program 100.0%
Taylor expanded in y around inf 48.9%
*-commutative48.9%
Simplified48.9%
Taylor expanded in y around 0 38.3%
if 6.1999999999999999e26 < y Initial program 100.0%
Taylor expanded in x around inf 60.1%
mul-1-neg60.1%
unsub-neg60.1%
Simplified60.1%
Taylor expanded in y around inf 48.9%
mul-1-neg48.9%
distribute-lft-neg-out48.9%
*-commutative48.9%
Simplified48.9%
Final simplification44.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -940.0) (not (<= z 1.1e+47))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -940.0) || !(z <= 1.1e+47)) {
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 <= (-940.0d0)) .or. (.not. (z <= 1.1d+47))) 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 <= -940.0) || !(z <= 1.1e+47)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -940.0) or not (z <= 1.1e+47): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -940.0) || !(z <= 1.1e+47)) 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 <= -940.0) || ~((z <= 1.1e+47))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -940.0], N[Not[LessEqual[z, 1.1e+47]], $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 -940 \lor \neg \left(z \leq 1.1 \cdot 10^{+47}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -940 or 1.1e47 < z Initial program 100.0%
Taylor expanded in x around 0 94.8%
fma-define94.9%
+-commutative94.9%
mul-1-neg94.9%
Simplified94.9%
Taylor expanded in z around inf 83.4%
neg-mul-183.4%
unsub-neg83.4%
Simplified83.4%
if -940 < z < 1.1e47Initial program 100.0%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
Simplified92.5%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.15e-18) (not (<= x 1.7e+22))) (* x (+ (- z y) 1.0)) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.15e-18) || !(x <= 1.7e+22)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = (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.15d-18)) .or. (.not. (x <= 1.7d+22))) then
tmp = x * ((z - y) + 1.0d0)
else
tmp = (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.15e-18) || !(x <= 1.7e+22)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.15e-18) or not (x <= 1.7e+22): tmp = x * ((z - y) + 1.0) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.15e-18) || !(x <= 1.7e+22)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.15e-18) || ~((x <= 1.7e+22))) tmp = x * ((z - y) + 1.0); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.15e-18], N[Not[LessEqual[x, 1.7e+22]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-18} \lor \neg \left(x \leq 1.7 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.15e-18 or 1.7e22 < x Initial program 100.0%
Taylor expanded in x around inf 86.0%
mul-1-neg86.0%
unsub-neg86.0%
Simplified86.0%
if -1.15e-18 < x < 1.7e22Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-define100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 76.0%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -22.5) t_1 (if (<= z 1.38e+48) (+ 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 <= -22.5) {
tmp = t_1;
} else if (z <= 1.38e+48) {
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 <= (-22.5d0)) then
tmp = t_1
else if (z <= 1.38d+48) 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 <= -22.5) {
tmp = t_1;
} else if (z <= 1.38e+48) {
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 <= -22.5: tmp = t_1 elif z <= 1.38e+48: 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 <= -22.5) tmp = t_1; elseif (z <= 1.38e+48) 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 <= -22.5) tmp = t_1; elseif (z <= 1.38e+48) 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, -22.5], t$95$1, If[LessEqual[z, 1.38e+48], 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 -22.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{+48}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if z < -22.5Initial program 100.0%
Taylor expanded in x around 0 93.5%
fma-define93.5%
+-commutative93.5%
mul-1-neg93.5%
Simplified93.5%
Taylor expanded in z around inf 79.6%
neg-mul-179.6%
unsub-neg79.6%
Simplified79.6%
if -22.5 < z < 1.3800000000000001e48Initial program 100.0%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
Simplified92.5%
if 1.3800000000000001e48 < z Initial program 100.0%
Taylor expanded in y around 0 87.7%
mul-1-neg87.7%
unsub-neg87.7%
Simplified87.7%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.15e-18) (not (<= x 1.2e+22))) (* x (- 1.0 y)) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.15e-18) || !(x <= 1.2e+22)) {
tmp = x * (1.0 - y);
} else {
tmp = (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 <= (-3.15d-18)) .or. (.not. (x <= 1.2d+22))) then
tmp = x * (1.0d0 - y)
else
tmp = (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 <= -3.15e-18) || !(x <= 1.2e+22)) {
tmp = x * (1.0 - y);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.15e-18) or not (x <= 1.2e+22): tmp = x * (1.0 - y) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.15e-18) || !(x <= 1.2e+22)) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.15e-18) || ~((x <= 1.2e+22))) tmp = x * (1.0 - y); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.15e-18], N[Not[LessEqual[x, 1.2e+22]], $MachinePrecision]], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.15 \cdot 10^{-18} \lor \neg \left(x \leq 1.2 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -3.1500000000000002e-18 or 1.2e22 < x Initial program 100.0%
Taylor expanded in x around inf 86.0%
mul-1-neg86.0%
unsub-neg86.0%
Simplified86.0%
Taylor expanded in z around 0 60.0%
if -3.1500000000000002e-18 < x < 1.2e22Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-define100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 76.0%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.98) (not (<= x 4.2e+21))) (* x (+ z 1.0)) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.98) || !(x <= 4.2e+21)) {
tmp = x * (z + 1.0);
} else {
tmp = (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.98d0)) .or. (.not. (x <= 4.2d+21))) then
tmp = x * (z + 1.0d0)
else
tmp = (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.98) || !(x <= 4.2e+21)) {
tmp = x * (z + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.98) or not (x <= 4.2e+21): tmp = x * (z + 1.0) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.98) || !(x <= 4.2e+21)) tmp = Float64(x * Float64(z + 1.0)); else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.98) || ~((x <= 4.2e+21))) tmp = x * (z + 1.0); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.98], N[Not[LessEqual[x, 4.2e+21]], $MachinePrecision]], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.98 \lor \neg \left(x \leq 4.2 \cdot 10^{+21}\right):\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.98 or 4.2e21 < x Initial program 100.0%
Taylor expanded in x around inf 86.5%
mul-1-neg86.5%
unsub-neg86.5%
Simplified86.5%
Taylor expanded in y around 0 55.5%
+-commutative55.5%
Simplified55.5%
if -1.98 < x < 4.2e21Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-define100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 75.1%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.15e+64) (not (<= y 1e-50))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.15e+64) || !(y <= 1e-50)) {
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.15d+64)) .or. (.not. (y <= 1d-50))) 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.15e+64) || !(y <= 1e-50)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.15e+64) or not (y <= 1e-50): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.15e+64) || !(y <= 1e-50)) 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.15e+64) || ~((y <= 1e-50))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.15e+64], N[Not[LessEqual[y, 1e-50]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+64} \lor \neg \left(y \leq 10^{-50}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.15e64 or 1.00000000000000001e-50 < y Initial program 100.0%
Taylor expanded in x around 0 94.9%
fma-define95.7%
+-commutative95.7%
mul-1-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 67.1%
Taylor expanded in y around inf 41.6%
if -1.15e64 < y < 1.00000000000000001e-50Initial program 100.0%
Taylor expanded in y around inf 48.9%
*-commutative48.9%
Simplified48.9%
Taylor expanded in y around 0 38.3%
Final simplification40.1%
(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%
(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 y around inf 62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in y around 0 18.8%
(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 2024144
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
(+ x (* (- y z) (- t x))))