
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z 1.0))))
(if (<= y -5.2e+243)
(* y t)
(if (<= y -3.7e+88)
(* y (- x))
(if (<= y -1.8e+32)
(* y t)
(if (<= y -2.3e-77)
t_1
(if (<= y 2.8e-247)
(* z (- t))
(if (<= y 0.0295) t_1 (* y t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double tmp;
if (y <= -5.2e+243) {
tmp = y * t;
} else if (y <= -3.7e+88) {
tmp = y * -x;
} else if (y <= -1.8e+32) {
tmp = y * t;
} else if (y <= -2.3e-77) {
tmp = t_1;
} else if (y <= 2.8e-247) {
tmp = z * -t;
} else if (y <= 0.0295) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (z + 1.0d0)
if (y <= (-5.2d+243)) then
tmp = y * t
else if (y <= (-3.7d+88)) then
tmp = y * -x
else if (y <= (-1.8d+32)) then
tmp = y * t
else if (y <= (-2.3d-77)) then
tmp = t_1
else if (y <= 2.8d-247) then
tmp = z * -t
else if (y <= 0.0295d0) then
tmp = t_1
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double tmp;
if (y <= -5.2e+243) {
tmp = y * t;
} else if (y <= -3.7e+88) {
tmp = y * -x;
} else if (y <= -1.8e+32) {
tmp = y * t;
} else if (y <= -2.3e-77) {
tmp = t_1;
} else if (y <= 2.8e-247) {
tmp = z * -t;
} else if (y <= 0.0295) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + 1.0) tmp = 0 if y <= -5.2e+243: tmp = y * t elif y <= -3.7e+88: tmp = y * -x elif y <= -1.8e+32: tmp = y * t elif y <= -2.3e-77: tmp = t_1 elif y <= 2.8e-247: tmp = z * -t elif y <= 0.0295: tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -5.2e+243) tmp = Float64(y * t); elseif (y <= -3.7e+88) tmp = Float64(y * Float64(-x)); elseif (y <= -1.8e+32) tmp = Float64(y * t); elseif (y <= -2.3e-77) tmp = t_1; elseif (y <= 2.8e-247) tmp = Float64(z * Float64(-t)); elseif (y <= 0.0295) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + 1.0); tmp = 0.0; if (y <= -5.2e+243) tmp = y * t; elseif (y <= -3.7e+88) tmp = y * -x; elseif (y <= -1.8e+32) tmp = y * t; elseif (y <= -2.3e-77) tmp = t_1; elseif (y <= 2.8e-247) tmp = z * -t; elseif (y <= 0.0295) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+243], N[(y * t), $MachinePrecision], If[LessEqual[y, -3.7e+88], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -1.8e+32], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.3e-77], t$95$1, If[LessEqual[y, 2.8e-247], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 0.0295], t$95$1, N[(y * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+243}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{+88}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{+32}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-247}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 0.0295:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -5.19999999999999993e243 or -3.69999999999999994e88 < y < -1.7999999999999998e32 or 0.029499999999999998 < y Initial program 100.0%
Taylor expanded in t around inf 61.2%
Taylor expanded in y around inf 51.3%
*-commutative51.3%
Simplified51.3%
Taylor expanded in x around 0 51.3%
if -5.19999999999999993e243 < y < -3.69999999999999994e88Initial program 100.0%
Taylor expanded in x around inf 65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 58.8%
mul-1-neg58.8%
distribute-lft-neg-out58.8%
*-commutative58.8%
Simplified58.8%
if -1.7999999999999998e32 < y < -2.29999999999999999e-77 or 2.79999999999999986e-247 < y < 0.029499999999999998Initial program 100.0%
Taylor expanded in x around inf 66.0%
mul-1-neg66.0%
unsub-neg66.0%
Simplified66.0%
Taylor expanded in y around 0 64.1%
+-commutative64.1%
Simplified64.1%
if -2.29999999999999999e-77 < y < 2.79999999999999986e-247Initial program 100.0%
Taylor expanded in t around inf 86.8%
Taylor expanded in y around 0 75.7%
mul-1-neg75.7%
unsub-neg75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x around 0 51.3%
mul-1-neg51.3%
*-commutative51.3%
distribute-rgt-neg-in51.3%
Simplified51.3%
Final simplification56.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.1e+246)
(* y t)
(if (<= y -4.35e+86)
(* y (- x))
(if (<= y -0.00024)
(* y t)
(if (<= y 1.32e-247) (* z (- t)) (if (<= y 6.6e-60) x (* y t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+246) {
tmp = y * t;
} else if (y <= -4.35e+86) {
tmp = y * -x;
} else if (y <= -0.00024) {
tmp = y * t;
} else if (y <= 1.32e-247) {
tmp = z * -t;
} else if (y <= 6.6e-60) {
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 <= (-1.1d+246)) then
tmp = y * t
else if (y <= (-4.35d+86)) then
tmp = y * -x
else if (y <= (-0.00024d0)) then
tmp = y * t
else if (y <= 1.32d-247) then
tmp = z * -t
else if (y <= 6.6d-60) 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 <= -1.1e+246) {
tmp = y * t;
} else if (y <= -4.35e+86) {
tmp = y * -x;
} else if (y <= -0.00024) {
tmp = y * t;
} else if (y <= 1.32e-247) {
tmp = z * -t;
} else if (y <= 6.6e-60) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e+246: tmp = y * t elif y <= -4.35e+86: tmp = y * -x elif y <= -0.00024: tmp = y * t elif y <= 1.32e-247: tmp = z * -t elif y <= 6.6e-60: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e+246) tmp = Float64(y * t); elseif (y <= -4.35e+86) tmp = Float64(y * Float64(-x)); elseif (y <= -0.00024) tmp = Float64(y * t); elseif (y <= 1.32e-247) tmp = Float64(z * Float64(-t)); elseif (y <= 6.6e-60) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e+246) tmp = y * t; elseif (y <= -4.35e+86) tmp = y * -x; elseif (y <= -0.00024) tmp = y * t; elseif (y <= 1.32e-247) tmp = z * -t; elseif (y <= 6.6e-60) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e+246], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.35e+86], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -0.00024], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.32e-247], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 6.6e-60], x, N[(y * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+246}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -4.35 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -0.00024:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{-247}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-60}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.09999999999999994e246 or -4.3500000000000001e86 < y < -2.40000000000000006e-4 or 6.5999999999999996e-60 < y Initial program 99.9%
Taylor expanded in t around inf 58.1%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
Taylor expanded in x around 0 46.3%
if -1.09999999999999994e246 < y < -4.3500000000000001e86Initial program 100.0%
Taylor expanded in x around inf 65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 58.8%
mul-1-neg58.8%
distribute-lft-neg-out58.8%
*-commutative58.8%
Simplified58.8%
if -2.40000000000000006e-4 < y < 1.3200000000000001e-247Initial program 100.0%
Taylor expanded in t around inf 82.6%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
unsub-neg71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in x around 0 45.6%
mul-1-neg45.6%
*-commutative45.6%
distribute-rgt-neg-in45.6%
Simplified45.6%
if 1.3200000000000001e-247 < y < 6.5999999999999996e-60Initial program 100.0%
Taylor expanded in t around inf 82.5%
Taylor expanded in x around inf 50.9%
Final simplification49.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))))
(if (<= z -1.6e+19)
(* z x)
(if (<= z -5.8e-179)
t_1
(if (<= z -2.2e-230) (* y t) (if (<= z 1.55e+34) t_1 (* z (- t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (z <= -1.6e+19) {
tmp = z * x;
} else if (z <= -5.8e-179) {
tmp = t_1;
} else if (z <= -2.2e-230) {
tmp = y * t;
} else if (z <= 1.55e+34) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - y)
if (z <= (-1.6d+19)) then
tmp = z * x
else if (z <= (-5.8d-179)) then
tmp = t_1
else if (z <= (-2.2d-230)) then
tmp = y * t
else if (z <= 1.55d+34) then
tmp = t_1
else
tmp = z * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (z <= -1.6e+19) {
tmp = z * x;
} else if (z <= -5.8e-179) {
tmp = t_1;
} else if (z <= -2.2e-230) {
tmp = y * t;
} else if (z <= 1.55e+34) {
tmp = t_1;
} else {
tmp = z * -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) tmp = 0 if z <= -1.6e+19: tmp = z * x elif z <= -5.8e-179: tmp = t_1 elif z <= -2.2e-230: tmp = y * t elif z <= 1.55e+34: tmp = t_1 else: tmp = z * -t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -1.6e+19) tmp = Float64(z * x); elseif (z <= -5.8e-179) tmp = t_1; elseif (z <= -2.2e-230) tmp = Float64(y * t); elseif (z <= 1.55e+34) tmp = t_1; else tmp = Float64(z * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); tmp = 0.0; if (z <= -1.6e+19) tmp = z * x; elseif (z <= -5.8e-179) tmp = t_1; elseif (z <= -2.2e-230) tmp = y * t; elseif (z <= 1.55e+34) tmp = t_1; else tmp = z * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+19], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.8e-179], t$95$1, If[LessEqual[z, -2.2e-230], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.55e+34], t$95$1, N[(z * (-t)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+19}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-230}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1.6e19Initial program 100.0%
Taylor expanded in x around inf 50.7%
mul-1-neg50.7%
unsub-neg50.7%
Simplified50.7%
Taylor expanded in y around 0 42.1%
+-commutative42.1%
Simplified42.1%
Taylor expanded in z around inf 42.1%
*-commutative42.1%
Simplified42.1%
if -1.6e19 < z < -5.7999999999999998e-179 or -2.1999999999999998e-230 < z < 1.54999999999999989e34Initial program 100.0%
Taylor expanded in x around inf 62.4%
mul-1-neg62.4%
unsub-neg62.4%
Simplified62.4%
Taylor expanded in z around 0 61.7%
if -5.7999999999999998e-179 < z < -2.1999999999999998e-230Initial program 100.0%
Taylor expanded in t around inf 78.9%
Taylor expanded in y around inf 78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in x around 0 78.1%
if 1.54999999999999989e34 < z Initial program 100.0%
Taylor expanded in t around inf 70.1%
Taylor expanded in y around 0 56.5%
mul-1-neg56.5%
unsub-neg56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x around 0 56.1%
mul-1-neg56.1%
*-commutative56.1%
distribute-rgt-neg-in56.1%
Simplified56.1%
Final simplification56.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* x (- 1.0 y))))
(if (<= z -1.75e-14)
t_1
(if (<= z -2.5e-182)
t_2
(if (<= z -2.4e-230) (* y t) (if (<= z 11500000000.0) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -1.75e-14) {
tmp = t_1;
} else if (z <= -2.5e-182) {
tmp = t_2;
} else if (z <= -2.4e-230) {
tmp = y * t;
} else if (z <= 11500000000.0) {
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 * (1.0d0 - y)
if (z <= (-1.75d-14)) then
tmp = t_1
else if (z <= (-2.5d-182)) then
tmp = t_2
else if (z <= (-2.4d-230)) then
tmp = y * t
else if (z <= 11500000000.0d0) 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 * (1.0 - y);
double tmp;
if (z <= -1.75e-14) {
tmp = t_1;
} else if (z <= -2.5e-182) {
tmp = t_2;
} else if (z <= -2.4e-230) {
tmp = y * t;
} else if (z <= 11500000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x * (1.0 - y) tmp = 0 if z <= -1.75e-14: tmp = t_1 elif z <= -2.5e-182: tmp = t_2 elif z <= -2.4e-230: tmp = y * t elif z <= 11500000000.0: 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(1.0 - y)) tmp = 0.0 if (z <= -1.75e-14) tmp = t_1; elseif (z <= -2.5e-182) tmp = t_2; elseif (z <= -2.4e-230) tmp = Float64(y * t); elseif (z <= 11500000000.0) 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 * (1.0 - y); tmp = 0.0; if (z <= -1.75e-14) tmp = t_1; elseif (z <= -2.5e-182) tmp = t_2; elseif (z <= -2.4e-230) tmp = y * t; elseif (z <= 11500000000.0) 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[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e-14], t$95$1, If[LessEqual[z, -2.5e-182], t$95$2, If[LessEqual[z, -2.4e-230], N[(y * t), $MachinePrecision], If[LessEqual[z, 11500000000.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-182}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-230}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 11500000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.7500000000000001e-14 or 1.15e10 < z Initial program 100.0%
Taylor expanded in y around 0 75.8%
mul-1-neg75.8%
unsub-neg75.8%
Simplified75.8%
Taylor expanded in t around 0 70.2%
Taylor expanded in z around inf 75.7%
associate-*r*75.7%
neg-mul-175.7%
+-commutative75.7%
*-commutative75.7%
associate-*l*75.7%
distribute-lft-out75.7%
neg-mul-175.7%
remove-double-neg75.7%
neg-mul-175.7%
unsub-neg75.7%
Simplified75.7%
if -1.7500000000000001e-14 < z < -2.50000000000000012e-182 or -2.4000000000000002e-230 < z < 1.15e10Initial program 100.0%
Taylor expanded in x around inf 64.5%
mul-1-neg64.5%
unsub-neg64.5%
Simplified64.5%
Taylor expanded in z around 0 64.5%
if -2.50000000000000012e-182 < z < -2.4000000000000002e-230Initial program 100.0%
Taylor expanded in t around inf 78.9%
Taylor expanded in y around inf 78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in x around 0 78.1%
Final simplification70.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (+ x (* y t))))
(if (<= z -8.5e+16)
t_1
(if (<= z -1.9e-231)
t_2
(if (<= z 4.3e-172)
(* x (- 1.0 y))
(if (<= z 125000000000.0) 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 <= -8.5e+16) {
tmp = t_1;
} else if (z <= -1.9e-231) {
tmp = t_2;
} else if (z <= 4.3e-172) {
tmp = x * (1.0 - y);
} else if (z <= 125000000000.0) {
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 <= (-8.5d+16)) then
tmp = t_1
else if (z <= (-1.9d-231)) then
tmp = t_2
else if (z <= 4.3d-172) then
tmp = x * (1.0d0 - y)
else if (z <= 125000000000.0d0) 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 <= -8.5e+16) {
tmp = t_1;
} else if (z <= -1.9e-231) {
tmp = t_2;
} else if (z <= 4.3e-172) {
tmp = x * (1.0 - y);
} else if (z <= 125000000000.0) {
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 <= -8.5e+16: tmp = t_1 elif z <= -1.9e-231: tmp = t_2 elif z <= 4.3e-172: tmp = x * (1.0 - y) elif z <= 125000000000.0: 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 <= -8.5e+16) tmp = t_1; elseif (z <= -1.9e-231) tmp = t_2; elseif (z <= 4.3e-172) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 125000000000.0) 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 <= -8.5e+16) tmp = t_1; elseif (z <= -1.9e-231) tmp = t_2; elseif (z <= 4.3e-172) tmp = x * (1.0 - y); elseif (z <= 125000000000.0) 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, -8.5e+16], t$95$1, If[LessEqual[z, -1.9e-231], t$95$2, If[LessEqual[z, 4.3e-172], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 125000000000.0], 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 -8.5 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-231}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-172}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 125000000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.5e16 or 1.25e11 < z Initial program 100.0%
Taylor expanded in y around 0 77.4%
mul-1-neg77.4%
unsub-neg77.4%
Simplified77.4%
Taylor expanded in t around 0 71.6%
Taylor expanded in z around inf 77.3%
associate-*r*77.3%
neg-mul-177.3%
+-commutative77.3%
*-commutative77.3%
associate-*l*77.3%
distribute-lft-out77.3%
neg-mul-177.3%
remove-double-neg77.3%
neg-mul-177.3%
unsub-neg77.3%
Simplified77.3%
if -8.5e16 < z < -1.90000000000000007e-231 or 4.2999999999999997e-172 < z < 1.25e11Initial program 100.0%
Taylor expanded in t around inf 76.4%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if -1.90000000000000007e-231 < z < 4.2999999999999997e-172Initial program 100.0%
Taylor expanded in x around inf 72.5%
mul-1-neg72.5%
unsub-neg72.5%
Simplified72.5%
Taylor expanded in z around 0 72.5%
Final simplification72.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.8e+31)
(* y t)
(if (<= y -2.9e-88)
(* z x)
(if (or (<= y -2.4e-126) (not (<= y 7.2e-60))) (* y t) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e+31) {
tmp = y * t;
} else if (y <= -2.9e-88) {
tmp = z * x;
} else if ((y <= -2.4e-126) || !(y <= 7.2e-60)) {
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.8d+31)) then
tmp = y * t
else if (y <= (-2.9d-88)) then
tmp = z * x
else if ((y <= (-2.4d-126)) .or. (.not. (y <= 7.2d-60))) 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.8e+31) {
tmp = y * t;
} else if (y <= -2.9e-88) {
tmp = z * x;
} else if ((y <= -2.4e-126) || !(y <= 7.2e-60)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e+31: tmp = y * t elif y <= -2.9e-88: tmp = z * x elif (y <= -2.4e-126) or not (y <= 7.2e-60): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e+31) tmp = Float64(y * t); elseif (y <= -2.9e-88) tmp = Float64(z * x); elseif ((y <= -2.4e-126) || !(y <= 7.2e-60)) 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.8e+31) tmp = y * t; elseif (y <= -2.9e-88) tmp = z * x; elseif ((y <= -2.4e-126) || ~((y <= 7.2e-60))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e+31], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.9e-88], N[(z * x), $MachinePrecision], If[Or[LessEqual[y, -2.4e-126], N[Not[LessEqual[y, 7.2e-60]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+31}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-88}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-126} \lor \neg \left(y \leq 7.2 \cdot 10^{-60}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.79999999999999998e31 or -2.9000000000000001e-88 < y < -2.40000000000000007e-126 or 7.2e-60 < y Initial program 100.0%
Taylor expanded in t around inf 56.1%
Taylor expanded in y around inf 44.1%
*-commutative44.1%
Simplified44.1%
Taylor expanded in x around 0 43.1%
if -1.79999999999999998e31 < y < -2.9000000000000001e-88Initial program 100.0%
Taylor expanded in x around inf 54.1%
mul-1-neg54.1%
unsub-neg54.1%
Simplified54.1%
Taylor expanded in y around 0 49.7%
+-commutative49.7%
Simplified49.7%
Taylor expanded in z around inf 31.6%
*-commutative31.6%
Simplified31.6%
if -2.40000000000000007e-126 < y < 7.2e-60Initial program 100.0%
Taylor expanded in t around inf 85.2%
Taylor expanded in x around inf 42.4%
Final simplification41.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5e+32) (not (<= x 150000000.0))) (* x (+ (- z y) 1.0)) (- x (* t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5e+32) || !(x <= 150000000.0)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x - (t * (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 <= (-5d+32)) .or. (.not. (x <= 150000000.0d0))) then
tmp = x * ((z - y) + 1.0d0)
else
tmp = x - (t * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5e+32) || !(x <= 150000000.0)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x - (t * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5e+32) or not (x <= 150000000.0): tmp = x * ((z - y) + 1.0) else: tmp = x - (t * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5e+32) || !(x <= 150000000.0)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); else tmp = Float64(x - Float64(t * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5e+32) || ~((x <= 150000000.0))) tmp = x * ((z - y) + 1.0); else tmp = x - (t * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5e+32], N[Not[LessEqual[x, 150000000.0]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+32} \lor \neg \left(x \leq 150000000\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \left(z - y\right)\\
\end{array}
\end{array}
if x < -4.9999999999999997e32 or 1.5e8 < x Initial program 100.0%
Taylor expanded in x around inf 86.4%
mul-1-neg86.4%
unsub-neg86.4%
Simplified86.4%
if -4.9999999999999997e32 < x < 1.5e8Initial program 100.0%
Taylor expanded in t around inf 81.5%
Final simplification83.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.4e+18) (not (<= z 5.2e+47))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.4e+18) || !(z <= 5.2e+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 <= (-4.4d+18)) .or. (.not. (z <= 5.2d+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 <= -4.4e+18) || !(z <= 5.2e+47)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.4e+18) or not (z <= 5.2e+47): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.4e+18) || !(z <= 5.2e+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 <= -4.4e+18) || ~((z <= 5.2e+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, -4.4e+18], N[Not[LessEqual[z, 5.2e+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 -4.4 \cdot 10^{+18} \lor \neg \left(z \leq 5.2 \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 < -4.4e18 or 5.20000000000000007e47 < z Initial program 100.0%
Taylor expanded in y around 0 79.4%
mul-1-neg79.4%
unsub-neg79.4%
Simplified79.4%
Taylor expanded in t around 0 73.1%
Taylor expanded in z around inf 79.4%
associate-*r*79.4%
neg-mul-179.4%
+-commutative79.4%
*-commutative79.4%
associate-*l*79.4%
distribute-lft-out79.4%
neg-mul-179.4%
remove-double-neg79.4%
neg-mul-179.4%
unsub-neg79.4%
Simplified79.4%
if -4.4e18 < z < 5.20000000000000007e47Initial program 100.0%
Taylor expanded in y around inf 91.0%
*-commutative91.0%
Simplified91.0%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -1.9e+19) t_1 (if (<= z 7e+47) (+ 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 <= -1.9e+19) {
tmp = t_1;
} else if (z <= 7e+47) {
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 <= (-1.9d+19)) then
tmp = t_1
else if (z <= 7d+47) 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 <= -1.9e+19) {
tmp = t_1;
} else if (z <= 7e+47) {
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 <= -1.9e+19: tmp = t_1 elif z <= 7e+47: 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 <= -1.9e+19) tmp = t_1; elseif (z <= 7e+47) 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 <= -1.9e+19) tmp = t_1; elseif (z <= 7e+47) 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, -1.9e+19], t$95$1, If[LessEqual[z, 7e+47], 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 -1.9 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+47}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
if z < -1.9e19Initial program 100.0%
Taylor expanded in y around 0 80.2%
mul-1-neg80.2%
unsub-neg80.2%
Simplified80.2%
Taylor expanded in t around 0 73.3%
Taylor expanded in z around inf 80.2%
associate-*r*80.2%
neg-mul-180.2%
+-commutative80.2%
*-commutative80.2%
associate-*l*80.2%
distribute-lft-out80.2%
neg-mul-180.2%
remove-double-neg80.2%
neg-mul-180.2%
unsub-neg80.2%
Simplified80.2%
if -1.9e19 < z < 7.00000000000000031e47Initial program 100.0%
Taylor expanded in y around inf 91.0%
*-commutative91.0%
Simplified91.0%
if 7.00000000000000031e47 < z Initial program 100.0%
Taylor expanded in y around 0 78.5%
mul-1-neg78.5%
unsub-neg78.5%
Simplified78.5%
Final simplification85.9%
(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 (or (<= x -1.1e+20) (not (<= x 1.4e-20))) (* y (- x)) (* y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.1e+20) || !(x <= 1.4e-20)) {
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.1d+20)) .or. (.not. (x <= 1.4d-20))) 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.1e+20) || !(x <= 1.4e-20)) {
tmp = y * -x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.1e+20) or not (x <= 1.4e-20): tmp = y * -x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.1e+20) || !(x <= 1.4e-20)) 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.1e+20) || ~((x <= 1.4e-20))) tmp = y * -x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.1e+20], N[Not[LessEqual[x, 1.4e-20]], $MachinePrecision]], N[(y * (-x)), $MachinePrecision], N[(y * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+20} \lor \neg \left(x \leq 1.4 \cdot 10^{-20}\right):\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if x < -1.1e20 or 1.4000000000000001e-20 < x Initial program 100.0%
Taylor expanded in x around inf 84.3%
mul-1-neg84.3%
unsub-neg84.3%
Simplified84.3%
Taylor expanded in y around inf 44.9%
mul-1-neg44.9%
distribute-lft-neg-out44.9%
*-commutative44.9%
Simplified44.9%
if -1.1e20 < x < 1.4000000000000001e-20Initial program 100.0%
Taylor expanded in t around inf 82.2%
Taylor expanded in y around inf 50.7%
*-commutative50.7%
Simplified50.7%
Taylor expanded in x around 0 38.8%
Final simplification41.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.45e-7) (not (<= y 5.2e-60))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.45e-7) || !(y <= 5.2e-60)) {
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.45d-7)) .or. (.not. (y <= 5.2d-60))) 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.45e-7) || !(y <= 5.2e-60)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.45e-7) or not (y <= 5.2e-60): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.45e-7) || !(y <= 5.2e-60)) 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.45e-7) || ~((y <= 5.2e-60))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.45e-7], N[Not[LessEqual[y, 5.2e-60]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-7} \lor \neg \left(y \leq 5.2 \cdot 10^{-60}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.4499999999999999e-7 or 5.1999999999999995e-60 < y Initial program 100.0%
Taylor expanded in t around inf 54.5%
Taylor expanded in y around inf 42.6%
*-commutative42.6%
Simplified42.6%
Taylor expanded in x around 0 41.5%
if -1.4499999999999999e-7 < y < 5.1999999999999995e-60Initial program 100.0%
Taylor expanded in t around inf 82.4%
Taylor expanded in x around inf 37.2%
Final simplification39.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 66.2%
Taylor expanded in x around inf 17.7%
Final simplification17.7%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024013
(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))))