
(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
(if (<= z -9.5e+17)
(* z x)
(if (<= z -3.9e-104)
(* y t)
(if (<= z -1.05e-265)
x
(if (<= z -5.8e-306)
(* y (- x))
(if (<= z 4.7e-298)
x
(if (<= z 4.8e-258)
(* y t)
(if (<= z 3e-167) x (if (<= z 1.9e+59) (* y t) (* z x))))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.5e+17) {
tmp = z * x;
} else if (z <= -3.9e-104) {
tmp = y * t;
} else if (z <= -1.05e-265) {
tmp = x;
} else if (z <= -5.8e-306) {
tmp = y * -x;
} else if (z <= 4.7e-298) {
tmp = x;
} else if (z <= 4.8e-258) {
tmp = y * t;
} else if (z <= 3e-167) {
tmp = x;
} else if (z <= 1.9e+59) {
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 <= (-9.5d+17)) then
tmp = z * x
else if (z <= (-3.9d-104)) then
tmp = y * t
else if (z <= (-1.05d-265)) then
tmp = x
else if (z <= (-5.8d-306)) then
tmp = y * -x
else if (z <= 4.7d-298) then
tmp = x
else if (z <= 4.8d-258) then
tmp = y * t
else if (z <= 3d-167) then
tmp = x
else if (z <= 1.9d+59) 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 <= -9.5e+17) {
tmp = z * x;
} else if (z <= -3.9e-104) {
tmp = y * t;
} else if (z <= -1.05e-265) {
tmp = x;
} else if (z <= -5.8e-306) {
tmp = y * -x;
} else if (z <= 4.7e-298) {
tmp = x;
} else if (z <= 4.8e-258) {
tmp = y * t;
} else if (z <= 3e-167) {
tmp = x;
} else if (z <= 1.9e+59) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.5e+17: tmp = z * x elif z <= -3.9e-104: tmp = y * t elif z <= -1.05e-265: tmp = x elif z <= -5.8e-306: tmp = y * -x elif z <= 4.7e-298: tmp = x elif z <= 4.8e-258: tmp = y * t elif z <= 3e-167: tmp = x elif z <= 1.9e+59: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.5e+17) tmp = Float64(z * x); elseif (z <= -3.9e-104) tmp = Float64(y * t); elseif (z <= -1.05e-265) tmp = x; elseif (z <= -5.8e-306) tmp = Float64(y * Float64(-x)); elseif (z <= 4.7e-298) tmp = x; elseif (z <= 4.8e-258) tmp = Float64(y * t); elseif (z <= 3e-167) tmp = x; elseif (z <= 1.9e+59) 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 <= -9.5e+17) tmp = z * x; elseif (z <= -3.9e-104) tmp = y * t; elseif (z <= -1.05e-265) tmp = x; elseif (z <= -5.8e-306) tmp = y * -x; elseif (z <= 4.7e-298) tmp = x; elseif (z <= 4.8e-258) tmp = y * t; elseif (z <= 3e-167) tmp = x; elseif (z <= 1.9e+59) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.5e+17], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.9e-104], N[(y * t), $MachinePrecision], If[LessEqual[z, -1.05e-265], x, If[LessEqual[z, -5.8e-306], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.7e-298], x, If[LessEqual[z, 4.8e-258], N[(y * t), $MachinePrecision], If[LessEqual[z, 3e-167], x, If[LessEqual[z, 1.9e+59], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+17}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-104}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-265}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-306}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-298}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-258}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-167}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+59}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -9.5e17 or 1.9e59 < z Initial program 99.9%
Taylor expanded in t around 0 57.8%
mul-1-neg57.8%
distribute-rgt-neg-in57.8%
neg-sub057.8%
sub-neg57.8%
+-commutative57.8%
associate--r+57.8%
neg-sub057.8%
remove-double-neg57.8%
Simplified57.8%
Taylor expanded in y around 0 49.3%
*-commutative49.3%
Simplified49.3%
Taylor expanded in z around inf 49.3%
*-commutative49.3%
Simplified49.3%
if -9.5e17 < z < -3.9000000000000002e-104 or 4.70000000000000037e-298 < z < 4.8000000000000003e-258 or 2.9999999999999998e-167 < z < 1.9e59Initial program 100.0%
Taylor expanded in y around inf 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around -inf 83.9%
+-commutative83.9%
mul-1-neg83.9%
unsub-neg83.9%
sub-neg83.9%
metadata-eval83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in t around inf 47.9%
if -3.9000000000000002e-104 < z < -1.05000000000000002e-265 or -5.7999999999999998e-306 < z < 4.70000000000000037e-298 or 4.8000000000000003e-258 < z < 2.9999999999999998e-167Initial program 100.0%
Taylor expanded in t around inf 76.2%
Taylor expanded in x around inf 53.5%
if -1.05000000000000002e-265 < z < -5.7999999999999998e-306Initial program 100.0%
Taylor expanded in t around 0 82.3%
mul-1-neg82.3%
distribute-rgt-neg-in82.3%
neg-sub082.3%
sub-neg82.3%
+-commutative82.3%
associate--r+82.3%
neg-sub082.3%
remove-double-neg82.3%
Simplified82.3%
Taylor expanded in z around 0 82.3%
*-rgt-identity82.3%
mul-1-neg82.3%
distribute-rgt-neg-out82.3%
distribute-lft-in82.3%
unsub-neg82.3%
Simplified82.3%
Taylor expanded in y around inf 64.6%
neg-mul-164.6%
distribute-lft-neg-in64.6%
*-commutative64.6%
Simplified64.6%
Final simplification50.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (* y (- t x))))
(if (<= z -2.25e+136)
(* z x)
(if (<= z -2e-104)
t_2
(if (<= z 3.2e-298)
t_1
(if (<= z 1.06e-259)
t_2
(if (<= z 5e-166) t_1 (if (<= z 2.55e+119) t_2 (* z x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = y * (t - x);
double tmp;
if (z <= -2.25e+136) {
tmp = z * x;
} else if (z <= -2e-104) {
tmp = t_2;
} else if (z <= 3.2e-298) {
tmp = t_1;
} else if (z <= 1.06e-259) {
tmp = t_2;
} else if (z <= 5e-166) {
tmp = t_1;
} else if (z <= 2.55e+119) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = y * (t - x)
if (z <= (-2.25d+136)) then
tmp = z * x
else if (z <= (-2d-104)) then
tmp = t_2
else if (z <= 3.2d-298) then
tmp = t_1
else if (z <= 1.06d-259) then
tmp = t_2
else if (z <= 5d-166) then
tmp = t_1
else if (z <= 2.55d+119) then
tmp = t_2
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 * (1.0 - y);
double t_2 = y * (t - x);
double tmp;
if (z <= -2.25e+136) {
tmp = z * x;
} else if (z <= -2e-104) {
tmp = t_2;
} else if (z <= 3.2e-298) {
tmp = t_1;
} else if (z <= 1.06e-259) {
tmp = t_2;
} else if (z <= 5e-166) {
tmp = t_1;
} else if (z <= 2.55e+119) {
tmp = t_2;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = y * (t - x) tmp = 0 if z <= -2.25e+136: tmp = z * x elif z <= -2e-104: tmp = t_2 elif z <= 3.2e-298: tmp = t_1 elif z <= 1.06e-259: tmp = t_2 elif z <= 5e-166: tmp = t_1 elif z <= 2.55e+119: tmp = t_2 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(y * Float64(t - x)) tmp = 0.0 if (z <= -2.25e+136) tmp = Float64(z * x); elseif (z <= -2e-104) tmp = t_2; elseif (z <= 3.2e-298) tmp = t_1; elseif (z <= 1.06e-259) tmp = t_2; elseif (z <= 5e-166) tmp = t_1; elseif (z <= 2.55e+119) tmp = t_2; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = y * (t - x); tmp = 0.0; if (z <= -2.25e+136) tmp = z * x; elseif (z <= -2e-104) tmp = t_2; elseif (z <= 3.2e-298) tmp = t_1; elseif (z <= 1.06e-259) tmp = t_2; elseif (z <= 5e-166) tmp = t_1; elseif (z <= 2.55e+119) tmp = t_2; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.25e+136], N[(z * x), $MachinePrecision], If[LessEqual[z, -2e-104], t$95$2, If[LessEqual[z, 3.2e-298], t$95$1, If[LessEqual[z, 1.06e-259], t$95$2, If[LessEqual[z, 5e-166], t$95$1, If[LessEqual[z, 2.55e+119], t$95$2, N[(z * x), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := y \cdot \left(t - x\right)\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+136}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-104}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-259}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+119}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -2.25e136 or 2.54999999999999992e119 < z Initial program 100.0%
Taylor expanded in t around 0 61.2%
mul-1-neg61.2%
distribute-rgt-neg-in61.2%
neg-sub061.2%
sub-neg61.2%
+-commutative61.2%
associate--r+61.2%
neg-sub061.2%
remove-double-neg61.2%
Simplified61.2%
Taylor expanded in y around 0 56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in z around inf 56.4%
*-commutative56.4%
Simplified56.4%
if -2.25e136 < z < -1.99999999999999985e-104 or 3.19999999999999997e-298 < z < 1.06e-259 or 5e-166 < z < 2.54999999999999992e119Initial program 100.0%
Taylor expanded in y around inf 71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in x around -inf 71.0%
+-commutative71.0%
mul-1-neg71.0%
unsub-neg71.0%
sub-neg71.0%
metadata-eval71.0%
+-commutative71.0%
Simplified71.0%
Taylor expanded in y around inf 61.8%
if -1.99999999999999985e-104 < z < 3.19999999999999997e-298 or 1.06e-259 < z < 5e-166Initial program 100.0%
Taylor expanded in t around 0 79.0%
mul-1-neg79.0%
distribute-rgt-neg-in79.0%
neg-sub079.0%
sub-neg79.0%
+-commutative79.0%
associate--r+79.0%
neg-sub079.0%
remove-double-neg79.0%
Simplified79.0%
Taylor expanded in z around 0 79.0%
*-rgt-identity79.0%
mul-1-neg79.0%
distribute-rgt-neg-out79.0%
distribute-lft-in79.0%
unsub-neg79.0%
Simplified79.0%
Final simplification64.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -52000000000.0)
(* z x)
(if (<= z -1.2e-103)
(* y t)
(if (<= z 1.25e-298)
x
(if (<= z 7.5e-258)
(* y t)
(if (<= z 1.25e-164) x (if (<= z 4.2e+56) (* y t) (* z x))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -52000000000.0) {
tmp = z * x;
} else if (z <= -1.2e-103) {
tmp = y * t;
} else if (z <= 1.25e-298) {
tmp = x;
} else if (z <= 7.5e-258) {
tmp = y * t;
} else if (z <= 1.25e-164) {
tmp = x;
} else if (z <= 4.2e+56) {
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 <= (-52000000000.0d0)) then
tmp = z * x
else if (z <= (-1.2d-103)) then
tmp = y * t
else if (z <= 1.25d-298) then
tmp = x
else if (z <= 7.5d-258) then
tmp = y * t
else if (z <= 1.25d-164) then
tmp = x
else if (z <= 4.2d+56) 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 <= -52000000000.0) {
tmp = z * x;
} else if (z <= -1.2e-103) {
tmp = y * t;
} else if (z <= 1.25e-298) {
tmp = x;
} else if (z <= 7.5e-258) {
tmp = y * t;
} else if (z <= 1.25e-164) {
tmp = x;
} else if (z <= 4.2e+56) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -52000000000.0: tmp = z * x elif z <= -1.2e-103: tmp = y * t elif z <= 1.25e-298: tmp = x elif z <= 7.5e-258: tmp = y * t elif z <= 1.25e-164: tmp = x elif z <= 4.2e+56: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -52000000000.0) tmp = Float64(z * x); elseif (z <= -1.2e-103) tmp = Float64(y * t); elseif (z <= 1.25e-298) tmp = x; elseif (z <= 7.5e-258) tmp = Float64(y * t); elseif (z <= 1.25e-164) tmp = x; elseif (z <= 4.2e+56) 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 <= -52000000000.0) tmp = z * x; elseif (z <= -1.2e-103) tmp = y * t; elseif (z <= 1.25e-298) tmp = x; elseif (z <= 7.5e-258) tmp = y * t; elseif (z <= 1.25e-164) tmp = x; elseif (z <= 4.2e+56) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -52000000000.0], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.2e-103], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.25e-298], x, If[LessEqual[z, 7.5e-258], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.25e-164], x, If[LessEqual[z, 4.2e+56], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -52000000000:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-103}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-298}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-258}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-164}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+56}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -5.2e10 or 4.20000000000000034e56 < z Initial program 99.9%
Taylor expanded in t around 0 57.8%
mul-1-neg57.8%
distribute-rgt-neg-in57.8%
neg-sub057.8%
sub-neg57.8%
+-commutative57.8%
associate--r+57.8%
neg-sub057.8%
remove-double-neg57.8%
Simplified57.8%
Taylor expanded in y around 0 49.3%
*-commutative49.3%
Simplified49.3%
Taylor expanded in z around inf 49.3%
*-commutative49.3%
Simplified49.3%
if -5.2e10 < z < -1.2000000000000001e-103 or 1.25000000000000005e-298 < z < 7.4999999999999998e-258 or 1.2499999999999999e-164 < z < 4.20000000000000034e56Initial program 100.0%
Taylor expanded in y around inf 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around -inf 83.9%
+-commutative83.9%
mul-1-neg83.9%
unsub-neg83.9%
sub-neg83.9%
metadata-eval83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in t around inf 47.9%
if -1.2000000000000001e-103 < z < 1.25000000000000005e-298 or 7.4999999999999998e-258 < z < 1.2499999999999999e-164Initial program 100.0%
Taylor expanded in t around inf 70.2%
Taylor expanded in x around inf 48.3%
Final simplification48.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* z x))))
(if (<= y -2e-24)
t_1
(if (<= y -3.8e-254)
t_2
(if (<= y 1.15e-206) (- x (* z t)) (if (<= y 0.06) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + (z * x);
double tmp;
if (y <= -2e-24) {
tmp = t_1;
} else if (y <= -3.8e-254) {
tmp = t_2;
} else if (y <= 1.15e-206) {
tmp = x - (z * t);
} else if (y <= 0.06) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x + (z * x)
if (y <= (-2d-24)) then
tmp = t_1
else if (y <= (-3.8d-254)) then
tmp = t_2
else if (y <= 1.15d-206) then
tmp = x - (z * t)
else if (y <= 0.06d0) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + (z * x);
double tmp;
if (y <= -2e-24) {
tmp = t_1;
} else if (y <= -3.8e-254) {
tmp = t_2;
} else if (y <= 1.15e-206) {
tmp = x - (z * t);
} else if (y <= 0.06) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + (z * x) tmp = 0 if y <= -2e-24: tmp = t_1 elif y <= -3.8e-254: tmp = t_2 elif y <= 1.15e-206: tmp = x - (z * t) elif y <= 0.06: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(z * x)) tmp = 0.0 if (y <= -2e-24) tmp = t_1; elseif (y <= -3.8e-254) tmp = t_2; elseif (y <= 1.15e-206) tmp = Float64(x - Float64(z * t)); elseif (y <= 0.06) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x + (z * x); tmp = 0.0; if (y <= -2e-24) tmp = t_1; elseif (y <= -3.8e-254) tmp = t_2; elseif (y <= 1.15e-206) tmp = x - (z * t); elseif (y <= 0.06) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e-24], t$95$1, If[LessEqual[y, -3.8e-254], t$95$2, If[LessEqual[y, 1.15e-206], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.06], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + z \cdot x\\
\mathbf{if}\;y \leq -2 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-254}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-206}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 0.06:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.99999999999999985e-24 or 0.059999999999999998 < y Initial program 100.0%
Taylor expanded in y around inf 79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in x around -inf 77.6%
+-commutative77.6%
mul-1-neg77.6%
unsub-neg77.6%
sub-neg77.6%
metadata-eval77.6%
+-commutative77.6%
Simplified77.6%
Taylor expanded in y around inf 76.9%
if -1.99999999999999985e-24 < y < -3.8000000000000001e-254 or 1.15e-206 < y < 0.059999999999999998Initial program 100.0%
Taylor expanded in t around 0 70.5%
mul-1-neg70.5%
distribute-rgt-neg-in70.5%
neg-sub070.5%
sub-neg70.5%
+-commutative70.5%
associate--r+70.5%
neg-sub070.5%
remove-double-neg70.5%
Simplified70.5%
Taylor expanded in y around 0 70.5%
*-commutative70.5%
Simplified70.5%
if -3.8000000000000001e-254 < y < 1.15e-206Initial program 100.0%
Taylor expanded in t around inf 84.5%
Taylor expanded in y around 0 84.5%
mul-1-neg84.5%
unsub-neg84.5%
Simplified84.5%
Final simplification75.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -5.5e-42)
t_1
(if (<= y -1e-145) (* z x) (if (<= y 3.6e-12) (+ x (* y t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -5.5e-42) {
tmp = t_1;
} else if (y <= -1e-145) {
tmp = z * x;
} else if (y <= 3.6e-12) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (t - x)
if (y <= (-5.5d-42)) then
tmp = t_1
else if (y <= (-1d-145)) then
tmp = z * x
else if (y <= 3.6d-12) then
tmp = x + (y * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -5.5e-42) {
tmp = t_1;
} else if (y <= -1e-145) {
tmp = z * x;
} else if (y <= 3.6e-12) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -5.5e-42: tmp = t_1 elif y <= -1e-145: tmp = z * x elif y <= 3.6e-12: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -5.5e-42) tmp = t_1; elseif (y <= -1e-145) tmp = Float64(z * x); elseif (y <= 3.6e-12) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -5.5e-42) tmp = t_1; elseif (y <= -1e-145) tmp = z * x; elseif (y <= 3.6e-12) tmp = x + (y * t); 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]}, If[LessEqual[y, -5.5e-42], t$95$1, If[LessEqual[y, -1e-145], N[(z * x), $MachinePrecision], If[LessEqual[y, 3.6e-12], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-145}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.5e-42 or 3.6e-12 < y Initial program 100.0%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in x around -inf 75.6%
+-commutative75.6%
mul-1-neg75.6%
unsub-neg75.6%
sub-neg75.6%
metadata-eval75.6%
+-commutative75.6%
Simplified75.6%
Taylor expanded in y around inf 74.0%
if -5.5e-42 < y < -9.99999999999999915e-146Initial program 100.0%
Taylor expanded in t around 0 74.1%
mul-1-neg74.1%
distribute-rgt-neg-in74.1%
neg-sub074.1%
sub-neg74.1%
+-commutative74.1%
associate--r+74.1%
neg-sub074.1%
remove-double-neg74.1%
Simplified74.1%
Taylor expanded in y around 0 74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in z around inf 54.8%
*-commutative54.8%
Simplified54.8%
if -9.99999999999999915e-146 < y < 3.6e-12Initial program 100.0%
Taylor expanded in t around inf 74.7%
Taylor expanded in z around 0 42.1%
Final simplification60.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -14.0) (not (<= y 1.25e+28))) (* y (- t x)) (+ x (* t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -14.0) || !(y <= 1.25e+28)) {
tmp = y * (t - x);
} else {
tmp = x + (t * (y - z));
}
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 <= (-14.0d0)) .or. (.not. (y <= 1.25d+28))) then
tmp = y * (t - x)
else
tmp = x + (t * (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -14.0) || !(y <= 1.25e+28)) {
tmp = y * (t - x);
} else {
tmp = x + (t * (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -14.0) or not (y <= 1.25e+28): tmp = y * (t - x) else: tmp = x + (t * (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -14.0) || !(y <= 1.25e+28)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x + Float64(t * Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -14.0) || ~((y <= 1.25e+28))) tmp = y * (t - x); else tmp = x + (t * (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -14.0], N[Not[LessEqual[y, 1.25e+28]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -14 \lor \neg \left(y \leq 1.25 \cdot 10^{+28}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\end{array}
\end{array}
if y < -14 or 1.24999999999999989e28 < y Initial program 100.0%
Taylor expanded in y around inf 79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in x around -inf 78.3%
+-commutative78.3%
mul-1-neg78.3%
unsub-neg78.3%
sub-neg78.3%
metadata-eval78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in y around inf 78.8%
if -14 < y < 1.24999999999999989e28Initial program 100.0%
Taylor expanded in t around inf 70.0%
Final simplification74.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.5e-54) (not (<= t 1.15e-48))) (+ x (* t (- y z))) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.5e-54) || !(t <= 1.15e-48)) {
tmp = x + (t * (y - z));
} 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 ((t <= (-1.5d-54)) .or. (.not. (t <= 1.15d-48))) then
tmp = x + (t * (y - z))
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 ((t <= -1.5e-54) || !(t <= 1.15e-48)) {
tmp = x + (t * (y - z));
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.5e-54) or not (t <= 1.15e-48): tmp = x + (t * (y - z)) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.5e-54) || !(t <= 1.15e-48)) tmp = Float64(x + Float64(t * Float64(y - z))); 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 ((t <= -1.5e-54) || ~((t <= 1.15e-48))) tmp = x + (t * (y - z)); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.5e-54], N[Not[LessEqual[t, 1.15e-48]], $MachinePrecision]], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-54} \lor \neg \left(t \leq 1.15 \cdot 10^{-48}\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -1.50000000000000005e-54 or 1.15e-48 < t Initial program 100.0%
Taylor expanded in t around inf 87.3%
if -1.50000000000000005e-54 < t < 1.15e-48Initial program 100.0%
Taylor expanded in t around 0 84.1%
mul-1-neg84.1%
distribute-rgt-neg-in84.1%
neg-sub084.1%
sub-neg84.1%
+-commutative84.1%
associate--r+84.1%
neg-sub084.1%
remove-double-neg84.1%
Simplified84.1%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.4) (not (<= z 3.2e+54))) (+ x (* z (- x t))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.4) || !(z <= 3.2e+54)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.4d0)) .or. (.not. (z <= 3.2d+54))) then
tmp = x + (z * (x - t))
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.4) || !(z <= 3.2e+54)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.4) or not (z <= 3.2e+54): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.4) || !(z <= 3.2e+54)) tmp = Float64(x + Float64(z * Float64(x - t))); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.4) || ~((z <= 3.2e+54))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.4], N[Not[LessEqual[z, 3.2e+54]], $MachinePrecision]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \lor \neg \left(z \leq 3.2 \cdot 10^{+54}\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -3.39999999999999991 or 3.2e54 < z Initial program 99.9%
Taylor expanded in y around 0 85.1%
mul-1-neg85.1%
unsub-neg85.1%
Simplified85.1%
if -3.39999999999999991 < z < 3.2e54Initial program 100.0%
Taylor expanded in y around inf 90.7%
*-commutative90.7%
Simplified90.7%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -220.0) (not (<= z 5.4e+118))) (* z x) (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -220.0) || !(z <= 5.4e+118)) {
tmp = z * x;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-220.0d0)) .or. (.not. (z <= 5.4d+118))) then
tmp = z * x
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -220.0) || !(z <= 5.4e+118)) {
tmp = z * x;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -220.0) or not (z <= 5.4e+118): tmp = z * x else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -220.0) || !(z <= 5.4e+118)) tmp = Float64(z * x); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -220.0) || ~((z <= 5.4e+118))) tmp = z * x; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -220.0], N[Not[LessEqual[z, 5.4e+118]], $MachinePrecision]], N[(z * x), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -220 \lor \neg \left(z \leq 5.4 \cdot 10^{+118}\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
if z < -220 or 5.4e118 < z Initial program 100.0%
Taylor expanded in t around 0 58.9%
mul-1-neg58.9%
distribute-rgt-neg-in58.9%
neg-sub058.9%
sub-neg58.9%
+-commutative58.9%
associate--r+58.9%
neg-sub058.9%
remove-double-neg58.9%
Simplified58.9%
Taylor expanded in y around 0 51.3%
*-commutative51.3%
Simplified51.3%
Taylor expanded in z around inf 51.3%
*-commutative51.3%
Simplified51.3%
if -220 < z < 5.4e118Initial program 100.0%
Taylor expanded in t around 0 60.4%
mul-1-neg60.4%
distribute-rgt-neg-in60.4%
neg-sub060.4%
sub-neg60.4%
+-commutative60.4%
associate--r+60.4%
neg-sub060.4%
remove-double-neg60.4%
Simplified60.4%
Taylor expanded in z around 0 57.7%
*-rgt-identity57.7%
mul-1-neg57.7%
distribute-rgt-neg-out57.7%
distribute-lft-in57.7%
unsub-neg57.7%
Simplified57.7%
Final simplification55.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.4e-18) (not (<= y 0.0012))) (* y (- t x)) (+ x (* z x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.4e-18) || !(y <= 0.0012)) {
tmp = y * (t - x);
} else {
tmp = x + (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 ((y <= (-2.4d-18)) .or. (.not. (y <= 0.0012d0))) then
tmp = y * (t - x)
else
tmp = x + (z * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.4e-18) || !(y <= 0.0012)) {
tmp = y * (t - x);
} else {
tmp = x + (z * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.4e-18) or not (y <= 0.0012): tmp = y * (t - x) else: tmp = x + (z * x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.4e-18) || !(y <= 0.0012)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x + Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.4e-18) || ~((y <= 0.0012))) tmp = y * (t - x); else tmp = x + (z * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.4e-18], N[Not[LessEqual[y, 0.0012]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-18} \lor \neg \left(y \leq 0.0012\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\
\end{array}
\end{array}
if y < -2.39999999999999994e-18 or 0.00119999999999999989 < y Initial program 100.0%
Taylor expanded in y around inf 79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in x around -inf 77.6%
+-commutative77.6%
mul-1-neg77.6%
unsub-neg77.6%
sub-neg77.6%
metadata-eval77.6%
+-commutative77.6%
Simplified77.6%
Taylor expanded in y around inf 76.9%
if -2.39999999999999994e-18 < y < 0.00119999999999999989Initial program 100.0%
Taylor expanded in t around 0 65.1%
mul-1-neg65.1%
distribute-rgt-neg-in65.1%
neg-sub065.1%
sub-neg65.1%
+-commutative65.1%
associate--r+65.1%
neg-sub065.1%
remove-double-neg65.1%
Simplified65.1%
Taylor expanded in y around 0 65.1%
*-commutative65.1%
Simplified65.1%
Final simplification71.3%
(FPCore (x y z t) :precision binary64 (+ x (* (- t x) (- y z))))
double code(double x, double y, double z, double t) {
return x + ((t - 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 - x) * (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t - x) * (y - z));
}
def code(x, y, z, t): return x + ((t - x) * (y - z))
function code(x, y, z, t) return Float64(x + Float64(Float64(t - x) * Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x + ((t - x) * (y - z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right) \cdot \left(y - z\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.2e-39) (not (<= y 3.1e-12))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.2e-39) || !(y <= 3.1e-12)) {
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 <= (-3.2d-39)) .or. (.not. (y <= 3.1d-12))) 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 <= -3.2e-39) || !(y <= 3.1e-12)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.2e-39) or not (y <= 3.1e-12): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.2e-39) || !(y <= 3.1e-12)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.2e-39) || ~((y <= 3.1e-12))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.2e-39], N[Not[LessEqual[y, 3.1e-12]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-39} \lor \neg \left(y \leq 3.1 \cdot 10^{-12}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.1999999999999998e-39 or 3.1000000000000001e-12 < y Initial program 100.0%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in x around -inf 75.6%
+-commutative75.6%
mul-1-neg75.6%
unsub-neg75.6%
sub-neg75.6%
metadata-eval75.6%
+-commutative75.6%
Simplified75.6%
Taylor expanded in t around inf 40.7%
if -3.1999999999999998e-39 < y < 3.1000000000000001e-12Initial program 100.0%
Taylor expanded in t around inf 69.9%
Taylor expanded in x around inf 35.9%
Final simplification38.5%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in t around inf 61.2%
Taylor expanded in x around inf 18.4%
Final simplification18.4%
(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 2023334
(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))))