
(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 10 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
(if (<= z -1.2e+27)
(* x z)
(if (<= z -3.8e-245)
(* y t)
(if (<= z 2.75e-17) x (if (<= z 2.4e+125) (* y t) (* x z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e+27) {
tmp = x * z;
} else if (z <= -3.8e-245) {
tmp = y * t;
} else if (z <= 2.75e-17) {
tmp = x;
} else if (z <= 2.4e+125) {
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.2d+27)) then
tmp = x * z
else if (z <= (-3.8d-245)) then
tmp = y * t
else if (z <= 2.75d-17) then
tmp = x
else if (z <= 2.4d+125) 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.2e+27) {
tmp = x * z;
} else if (z <= -3.8e-245) {
tmp = y * t;
} else if (z <= 2.75e-17) {
tmp = x;
} else if (z <= 2.4e+125) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.2e+27: tmp = x * z elif z <= -3.8e-245: tmp = y * t elif z <= 2.75e-17: tmp = x elif z <= 2.4e+125: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.2e+27) tmp = Float64(x * z); elseif (z <= -3.8e-245) tmp = Float64(y * t); elseif (z <= 2.75e-17) tmp = x; elseif (z <= 2.4e+125) 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.2e+27) tmp = x * z; elseif (z <= -3.8e-245) tmp = y * t; elseif (z <= 2.75e-17) tmp = x; elseif (z <= 2.4e+125) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.2e+27], N[(x * z), $MachinePrecision], If[LessEqual[z, -3.8e-245], N[(y * t), $MachinePrecision], If[LessEqual[z, 2.75e-17], x, If[LessEqual[z, 2.4e+125], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+27}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-245}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+125}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -1.19999999999999999e27 or 2.4e125 < 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--.f6488.7%
Simplified88.7%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6449.2%
Simplified49.2%
if -1.19999999999999999e27 < z < -3.8000000000000001e-245 or 2.75e-17 < z < 2.4e125Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6464.1%
Simplified64.1%
Taylor expanded in t around inf
Simplified48.2%
if -3.8000000000000001e-245 < z < 2.75e-17Initial program 100.0%
Taylor expanded in t around 0
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--.f6469.0%
Simplified69.0%
Taylor expanded in z around inf
*-commutativeN/A
*-lowering-*.f6442.9%
Simplified42.9%
Taylor expanded in z around 0
Simplified42.9%
Final simplification47.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) (- t x))))
(if (<= (- y z) -500.0)
t_1
(if (<= (- y z) 5e-20) (+ x (* (- y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - x);
double tmp;
if ((y - z) <= -500.0) {
tmp = t_1;
} else if ((y - z) <= 5e-20) {
tmp = x + ((y - z) * 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 - z) * (t - x)
if ((y - z) <= (-500.0d0)) then
tmp = t_1
else if ((y - z) <= 5d-20) then
tmp = x + ((y - z) * 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 - z) * (t - x);
double tmp;
if ((y - z) <= -500.0) {
tmp = t_1;
} else if ((y - z) <= 5e-20) {
tmp = x + ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - x) tmp = 0 if (y - z) <= -500.0: tmp = t_1 elif (y - z) <= 5e-20: tmp = x + ((y - z) * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - x)) tmp = 0.0 if (Float64(y - z) <= -500.0) tmp = t_1; elseif (Float64(y - z) <= 5e-20) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - x); tmp = 0.0; if ((y - z) <= -500.0) tmp = t_1; elseif ((y - z) <= 5e-20) tmp = x + ((y - z) * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -500.0], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 5e-20], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - x\right)\\
\mathbf{if}\;y - z \leq -500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y - z \leq 5 \cdot 10^{-20}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 y z) < -500 or 4.9999999999999999e-20 < (-.f64 y z) Initial program 100.0%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
div-subN/A
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
div-invN/A
remove-double-divN/A
*-lowering-*.f64N/A
--lowering--.f6495.9%
Applied egg-rr95.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6495.5%
Simplified95.5%
distribute-rgt-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
if -500 < (-.f64 y z) < 4.9999999999999999e-20Initial program 100.0%
Taylor expanded in t around inf
Simplified99.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t x)))) (if (<= (- y z) -500.0) t_1 (if (<= (- y z) 5e-20) (+ x (* y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - x);
double tmp;
if ((y - z) <= -500.0) {
tmp = t_1;
} else if ((y - z) <= 5e-20) {
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 - z) * (t - x)
if ((y - z) <= (-500.0d0)) then
tmp = t_1
else if ((y - z) <= 5d-20) 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 - z) * (t - x);
double tmp;
if ((y - z) <= -500.0) {
tmp = t_1;
} else if ((y - z) <= 5e-20) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - x) tmp = 0 if (y - z) <= -500.0: tmp = t_1 elif (y - z) <= 5e-20: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - x)) tmp = 0.0 if (Float64(y - z) <= -500.0) tmp = t_1; elseif (Float64(y - z) <= 5e-20) 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 - z) * (t - x); tmp = 0.0; if ((y - z) <= -500.0) tmp = t_1; elseif ((y - z) <= 5e-20) tmp = x + (y * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -500.0], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 5e-20], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - x\right)\\
\mathbf{if}\;y - z \leq -500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y - z \leq 5 \cdot 10^{-20}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 y z) < -500 or 4.9999999999999999e-20 < (-.f64 y z) Initial program 100.0%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
div-subN/A
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
div-invN/A
remove-double-divN/A
*-lowering-*.f64N/A
--lowering--.f6495.9%
Applied egg-rr95.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6495.5%
Simplified95.5%
distribute-rgt-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
if -500 < (-.f64 y z) < 4.9999999999999999e-20Initial program 100.0%
Taylor expanded in t around inf
Simplified99.4%
Taylor expanded in y around inf
Simplified89.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= (- y z) -2e-33) t_1 (if (<= (- y z) 1e-92) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -2e-33) {
tmp = t_1;
} else if ((y - z) <= 1e-92) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * t
if ((y - z) <= (-2d-33)) then
tmp = t_1
else if ((y - z) <= 1d-92) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -2e-33) {
tmp = t_1;
} else if ((y - z) <= 1e-92) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if (y - z) <= -2e-33: tmp = t_1 elif (y - z) <= 1e-92: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (Float64(y - z) <= -2e-33) tmp = t_1; elseif (Float64(y - z) <= 1e-92) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if ((y - z) <= -2e-33) tmp = t_1; elseif ((y - z) <= 1e-92) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -2e-33], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 1e-92], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y - z \leq -2 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y - z \leq 10^{-92}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 y z) < -2.0000000000000001e-33 or 9.99999999999999988e-93 < (-.f64 y z) Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6459.2%
Simplified59.2%
if -2.0000000000000001e-33 < (-.f64 y z) < 9.99999999999999988e-93Initial program 100.0%
Taylor expanded in t around 0
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--.f6486.3%
Simplified86.3%
Taylor expanded in z around inf
*-commutativeN/A
*-lowering-*.f6486.3%
Simplified86.3%
Taylor expanded in z around 0
Simplified86.3%
Final simplification63.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -2.3e-14) t_1 (if (<= z 8e+65) (+ x (* y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -2.3e-14) {
tmp = t_1;
} else if (z <= 8e+65) {
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 = z * (x - t)
if (z <= (-2.3d-14)) then
tmp = t_1
else if (z <= 8d+65) 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 = z * (x - t);
double tmp;
if (z <= -2.3e-14) {
tmp = t_1;
} else if (z <= 8e+65) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -2.3e-14: tmp = t_1 elif z <= 8e+65: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -2.3e-14) tmp = t_1; elseif (z <= 8e+65) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -2.3e-14) tmp = t_1; elseif (z <= 8e+65) tmp = x + (y * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e-14], t$95$1, If[LessEqual[z, 8e+65], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+65}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.29999999999999998e-14 or 7.9999999999999999e65 < 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.3%
Simplified87.3%
if -2.29999999999999998e-14 < z < 7.9999999999999999e65Initial program 100.0%
Taylor expanded in t around inf
Simplified75.1%
Taylor expanded in y around inf
Simplified69.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -2.3e-14) t_1 (if (<= z 1.6e+66) (* y (- t x)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -2.3e-14) {
tmp = t_1;
} else if (z <= 1.6e+66) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x - t)
if (z <= (-2.3d-14)) then
tmp = t_1
else if (z <= 1.6d+66) then
tmp = y * (t - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -2.3e-14) {
tmp = t_1;
} else if (z <= 1.6e+66) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -2.3e-14: tmp = t_1 elif z <= 1.6e+66: tmp = y * (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -2.3e-14) tmp = t_1; elseif (z <= 1.6e+66) tmp = Float64(y * Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -2.3e-14) tmp = t_1; elseif (z <= 1.6e+66) tmp = y * (t - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e-14], t$95$1, If[LessEqual[z, 1.6e+66], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+66}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.29999999999999998e-14 or 1.6e66 < 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.3%
Simplified87.3%
if -2.29999999999999998e-14 < z < 1.6e66Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6462.8%
Simplified62.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -8e-60) t_1 (if (<= t 8.8e-76) (* x (- z y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -8e-60) {
tmp = t_1;
} else if (t <= 8.8e-76) {
tmp = x * (z - y);
} 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 - z) * t
if (t <= (-8d-60)) then
tmp = t_1
else if (t <= 8.8d-76) then
tmp = x * (z - y)
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 - z) * t;
double tmp;
if (t <= -8e-60) {
tmp = t_1;
} else if (t <= 8.8e-76) {
tmp = x * (z - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -8e-60: tmp = t_1 elif t <= 8.8e-76: tmp = x * (z - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -8e-60) tmp = t_1; elseif (t <= 8.8e-76) tmp = Float64(x * Float64(z - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if (t <= -8e-60) tmp = t_1; elseif (t <= 8.8e-76) tmp = x * (z - y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -8e-60], t$95$1, If[LessEqual[t, 8.8e-76], N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -8 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-76}:\\
\;\;\;\;x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.9999999999999998e-60 or 8.79999999999999997e-76 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6475.5%
Simplified75.5%
if -7.9999999999999998e-60 < t < 8.79999999999999997e-76Initial program 100.0%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
div-subN/A
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
div-invN/A
remove-double-divN/A
*-lowering-*.f64N/A
--lowering--.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6473.9%
Simplified73.9%
Taylor expanded in t around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6459.0%
Simplified59.0%
Final simplification68.7%
(FPCore (x y z t) :precision binary64 (if (<= y -6.8e-37) (* y t) (if (<= y 5.5e-91) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-37) {
tmp = y * t;
} else if (y <= 5.5e-91) {
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 <= (-6.8d-37)) then
tmp = y * t
else if (y <= 5.5d-91) 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 <= -6.8e-37) {
tmp = y * t;
} else if (y <= 5.5e-91) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e-37: tmp = y * t elif y <= 5.5e-91: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e-37) tmp = Float64(y * t); elseif (y <= 5.5e-91) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e-37) tmp = y * t; elseif (y <= 5.5e-91) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e-37], N[(y * t), $MachinePrecision], If[LessEqual[y, 5.5e-91], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-37}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-91}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -6.80000000000000037e-37 or 5.49999999999999965e-91 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6467.2%
Simplified67.2%
Taylor expanded in t around inf
Simplified42.2%
if -6.80000000000000037e-37 < y < 5.49999999999999965e-91Initial program 100.0%
Taylor expanded in t around 0
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--.f6468.3%
Simplified68.3%
Taylor expanded in z around inf
*-commutativeN/A
*-lowering-*.f6468.3%
Simplified68.3%
Taylor expanded in z around 0
Simplified40.2%
(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 0
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--.f6453.8%
Simplified53.8%
Taylor expanded in z around inf
*-commutativeN/A
*-lowering-*.f6438.4%
Simplified38.4%
Taylor expanded in z around 0
Simplified19.1%
(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 2024160
(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))))