
(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 12 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 (+ 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
(let* ((t_1 (* y (- t x))))
(if (<= y -2.3e+17)
t_1
(if (<= y -8e-88)
(* (- y z) t)
(if (<= y 2.6e-247)
(* z (- x t))
(if (<= y 0.00034) (fma z (- t) x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -2.3e+17) {
tmp = t_1;
} else if (y <= -8e-88) {
tmp = (y - z) * t;
} else if (y <= 2.6e-247) {
tmp = z * (x - t);
} else if (y <= 0.00034) {
tmp = fma(z, -t, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -2.3e+17) tmp = t_1; elseif (y <= -8e-88) tmp = Float64(Float64(y - z) * t); elseif (y <= 2.6e-247) tmp = Float64(z * Float64(x - t)); elseif (y <= 0.00034) tmp = fma(z, Float64(-t), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e+17], t$95$1, If[LessEqual[y, -8e-88], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 2.6e-247], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00034], N[(z * (-t) + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-88}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-247}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 0.00034:\\
\;\;\;\;\mathsf{fma}\left(z, -t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3e17 or 3.4e-4 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6482.9
Simplified82.9%
if -2.3e17 < y < -7.99999999999999947e-88Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6469.6
Simplified69.6%
if -7.99999999999999947e-88 < y < 2.6e-247Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6479.2
Simplified79.2%
if 2.6e-247 < y < 3.4e-4Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6494.6
Simplified94.6%
Taylor expanded in x around 0
mul-1-negN/A
neg-lowering-neg.f6475.0
Simplified75.0%
Final simplification79.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -4.4e+14)
t_1
(if (<= y -9.2e-88)
(* (- y z) t)
(if (<= y 5.4e-176)
(* z (- x t))
(if (<= y 0.00085) (fma z x x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -4.4e+14) {
tmp = t_1;
} else if (y <= -9.2e-88) {
tmp = (y - z) * t;
} else if (y <= 5.4e-176) {
tmp = z * (x - t);
} else if (y <= 0.00085) {
tmp = fma(z, x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -4.4e+14) tmp = t_1; elseif (y <= -9.2e-88) tmp = Float64(Float64(y - z) * t); elseif (y <= 5.4e-176) tmp = Float64(z * Float64(x - t)); elseif (y <= 0.00085) tmp = fma(z, x, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.4e+14], t$95$1, If[LessEqual[y, -9.2e-88], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 5.4e-176], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00085], N[(z * x + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{-88}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-176}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 0.00085:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.4e14 or 8.49999999999999953e-4 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6482.9
Simplified82.9%
if -4.4e14 < y < -9.19999999999999945e-88Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6469.6
Simplified69.6%
if -9.19999999999999945e-88 < y < 5.3999999999999997e-176Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6477.0
Simplified77.0%
if 5.3999999999999997e-176 < y < 8.49999999999999953e-4Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6492.8
Simplified92.8%
Taylor expanded in x around inf
Simplified67.4%
Final simplification78.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.1e+191)
(* y t)
(if (<= y -1.3e+18)
(* y (- x))
(if (<= y -1.8e-62) (* y t) (if (<= y 1.3e+61) (fma z x x) (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e+191) {
tmp = y * t;
} else if (y <= -1.3e+18) {
tmp = y * -x;
} else if (y <= -1.8e-62) {
tmp = y * t;
} else if (y <= 1.3e+61) {
tmp = fma(z, x, x);
} else {
tmp = y * t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -4.1e+191) tmp = Float64(y * t); elseif (y <= -1.3e+18) tmp = Float64(y * Float64(-x)); elseif (y <= -1.8e-62) tmp = Float64(y * t); elseif (y <= 1.3e+61) tmp = fma(z, x, x); else tmp = Float64(y * t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.1e+191], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.3e+18], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -1.8e-62], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.3e+61], N[(z * x + x), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+191}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-62}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -4.0999999999999999e191 or -1.3e18 < y < -1.8e-62 or 1.29999999999999986e61 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6480.6
Simplified80.6%
Taylor expanded in t around inf
Simplified53.4%
if -4.0999999999999999e191 < y < -1.3e18Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6479.5
Simplified79.5%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6459.2
Simplified59.2%
if -1.8e-62 < y < 1.29999999999999986e61Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6488.8
Simplified88.8%
Taylor expanded in x around inf
Simplified56.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -20000000000000.0)
t_1
(if (<= y -4e-96) (* (- y z) t) (if (<= y 1.5e-6) (fma z x x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -20000000000000.0) {
tmp = t_1;
} else if (y <= -4e-96) {
tmp = (y - z) * t;
} else if (y <= 1.5e-6) {
tmp = fma(z, x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -20000000000000.0) tmp = t_1; elseif (y <= -4e-96) tmp = Float64(Float64(y - z) * t); elseif (y <= 1.5e-6) tmp = fma(z, x, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -20000000000000.0], t$95$1, If[LessEqual[y, -4e-96], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 1.5e-6], N[(z * x + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -20000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-96}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2e13 or 1.5e-6 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6482.9
Simplified82.9%
if -2e13 < y < -3.9999999999999996e-96Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6470.7
Simplified70.7%
if -3.9999999999999996e-96 < y < 1.5e-6Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6494.6
Simplified94.6%
Taylor expanded in x around inf
Simplified60.9%
Final simplification72.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (- t x)))) (if (<= y -500000.0) t_1 (if (<= y 0.00105) (fma z (- x t) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -500000.0) {
tmp = t_1;
} else if (y <= 0.00105) {
tmp = fma(z, (x - t), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -500000.0) tmp = t_1; elseif (y <= 0.00105) tmp = fma(z, Float64(x - t), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -500000.0], t$95$1, If[LessEqual[y, 0.00105], N[(z * N[(x - t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.00105:\\
\;\;\;\;\mathsf{fma}\left(z, x - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5e5 or 0.00104999999999999994 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6483.2
Simplified83.2%
if -5e5 < y < 0.00104999999999999994Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6489.7
Simplified89.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -3.8e-14) t_1 (if (<= t 250000000.0) (fma x (- z y) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -3.8e-14) {
tmp = t_1;
} else if (t <= 250000000.0) {
tmp = fma(x, (z - y), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -3.8e-14) tmp = t_1; elseif (t <= 250000000.0) tmp = fma(x, Float64(z - y), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.8e-14], t$95$1, If[LessEqual[t, 250000000.0], N[(x * N[(z - y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 250000000:\\
\;\;\;\;\mathsf{fma}\left(x, z - y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.8000000000000002e-14 or 2.5e8 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6478.0
Simplified78.0%
if -3.8000000000000002e-14 < t < 2.5e8Initial program 100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6479.5
Simplified79.5%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -2.45e-92) t_1 (if (<= t 55.0) (fma z x x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -2.45e-92) {
tmp = t_1;
} else if (t <= 55.0) {
tmp = fma(z, x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -2.45e-92) tmp = t_1; elseif (t <= 55.0) tmp = fma(z, x, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.45e-92], t$95$1, If[LessEqual[t, 55.0], N[(z * x + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -2.45 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 55:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.45e-92 or 55 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6472.4
Simplified72.4%
if -2.45e-92 < t < 55Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6459.9
Simplified59.9%
Taylor expanded in x around inf
Simplified52.3%
Final simplification63.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.8e-62) (* y t) (if (<= y 1.2e+61) (fma z x x) (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-62) {
tmp = y * t;
} else if (y <= 1.2e+61) {
tmp = fma(z, x, x);
} else {
tmp = y * t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-62) tmp = Float64(y * t); elseif (y <= 1.2e+61) tmp = fma(z, x, x); else tmp = Float64(y * t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-62], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.2e+61], N[(z * x + x), $MachinePrecision], N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-62}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.8e-62 or 1.1999999999999999e61 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6480.3
Simplified80.3%
Taylor expanded in t around inf
Simplified44.5%
if -1.8e-62 < y < 1.1999999999999999e61Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6488.8
Simplified88.8%
Taylor expanded in x around inf
Simplified56.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.4e+73) (* x z) (if (<= z 3.85e+118) (* y t) (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.4e+73) {
tmp = x * z;
} else if (z <= 3.85e+118) {
tmp = y * t;
} else {
tmp = x * 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 (z <= (-1.4d+73)) then
tmp = x * z
else if (z <= 3.85d+118) then
tmp = y * t
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.4e+73) {
tmp = x * z;
} else if (z <= 3.85e+118) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.4e+73: tmp = x * z elif z <= 3.85e+118: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.4e+73) tmp = Float64(x * z); elseif (z <= 3.85e+118) tmp = Float64(y * t); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.4e+73) tmp = x * z; elseif (z <= 3.85e+118) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.4e+73], N[(x * z), $MachinePrecision], If[LessEqual[z, 3.85e+118], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+73}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 3.85 \cdot 10^{+118}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -1.40000000000000004e73 or 3.8499999999999999e118 < z Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6487.5
Simplified87.5%
Taylor expanded in x around inf
Simplified53.6%
if -1.40000000000000004e73 < z < 3.8499999999999999e118Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6461.8
Simplified61.8%
Taylor expanded in t around inf
Simplified36.2%
Final simplification42.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.95e-63) (* y t) (if (<= y 2.45e-14) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.95e-63) {
tmp = y * t;
} else if (y <= 2.45e-14) {
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.95d-63)) then
tmp = y * t
else if (y <= 2.45d-14) 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.95e-63) {
tmp = y * t;
} else if (y <= 2.45e-14) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.95e-63: tmp = y * t elif y <= 2.45e-14: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.95e-63) tmp = Float64(y * t); elseif (y <= 2.45e-14) 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.95e-63) tmp = y * t; elseif (y <= 2.45e-14) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.95e-63], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.45e-14], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-63}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.95000000000000011e-63 or 2.44999999999999997e-14 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6478.0
Simplified78.0%
Taylor expanded in t around inf
Simplified42.4%
if -1.95000000000000011e-63 < y < 2.44999999999999997e-14Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6494.1
Simplified94.1%
Taylor expanded in z around 0
Simplified28.4%
(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 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6456.8
Simplified56.8%
Taylor expanded in z around 0
Simplified15.5%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024199
(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))))