
(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 13 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))) (t_2 (* (- y z) t)))
(if (<= y -6.8e+52)
t_1
(if (<= y -4.5e-23)
t_2
(if (<= y 5.8e-81) (* x (+ z 1.0)) (if (<= y 2.25e+95) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = (y - z) * t;
double tmp;
if (y <= -6.8e+52) {
tmp = t_1;
} else if (y <= -4.5e-23) {
tmp = t_2;
} else if (y <= 5.8e-81) {
tmp = x * (z + 1.0);
} else if (y <= 2.25e+95) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = (y - z) * t
if (y <= (-6.8d+52)) then
tmp = t_1
else if (y <= (-4.5d-23)) then
tmp = t_2
else if (y <= 5.8d-81) then
tmp = x * (z + 1.0d0)
else if (y <= 2.25d+95) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = (y - z) * t;
double tmp;
if (y <= -6.8e+52) {
tmp = t_1;
} else if (y <= -4.5e-23) {
tmp = t_2;
} else if (y <= 5.8e-81) {
tmp = x * (z + 1.0);
} else if (y <= 2.25e+95) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = (y - z) * t tmp = 0 if y <= -6.8e+52: tmp = t_1 elif y <= -4.5e-23: tmp = t_2 elif y <= 5.8e-81: tmp = x * (z + 1.0) elif y <= 2.25e+95: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (y <= -6.8e+52) tmp = t_1; elseif (y <= -4.5e-23) tmp = t_2; elseif (y <= 5.8e-81) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 2.25e+95) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = (y - z) * t; tmp = 0.0; if (y <= -6.8e+52) tmp = t_1; elseif (y <= -4.5e-23) tmp = t_2; elseif (y <= 5.8e-81) tmp = x * (z + 1.0); elseif (y <= 2.25e+95) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -6.8e+52], t$95$1, If[LessEqual[y, -4.5e-23], t$95$2, If[LessEqual[y, 5.8e-81], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+95], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-81}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+95}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.8e52 or 2.25000000000000008e95 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6484.9%
Simplified84.9%
if -6.8e52 < y < -4.49999999999999975e-23 or 5.79999999999999978e-81 < y < 2.25000000000000008e95Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6465.1%
Simplified65.1%
if -4.49999999999999975e-23 < y < 5.79999999999999978e-81Initial 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.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6461.3%
Simplified61.3%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6461.3%
Simplified61.3%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -0.052)
t_1
(if (<= z 7e-86) (+ x (* y t)) (if (<= z 1.55e+19) (* 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 <= -0.052) {
tmp = t_1;
} else if (z <= 7e-86) {
tmp = x + (y * t);
} else if (z <= 1.55e+19) {
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 <= (-0.052d0)) then
tmp = t_1
else if (z <= 7d-86) then
tmp = x + (y * t)
else if (z <= 1.55d+19) 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 <= -0.052) {
tmp = t_1;
} else if (z <= 7e-86) {
tmp = x + (y * t);
} else if (z <= 1.55e+19) {
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 <= -0.052: tmp = t_1 elif z <= 7e-86: tmp = x + (y * t) elif z <= 1.55e+19: 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 <= -0.052) tmp = t_1; elseif (z <= 7e-86) tmp = Float64(x + Float64(y * t)); elseif (z <= 1.55e+19) 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 <= -0.052) tmp = t_1; elseif (z <= 7e-86) tmp = x + (y * t); elseif (z <= 1.55e+19) 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, -0.052], t$95$1, If[LessEqual[z, 7e-86], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+19], 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 -0.052:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-86}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+19}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.0519999999999999976 or 1.55e19 < 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--.f6483.8%
Simplified83.8%
if -0.0519999999999999976 < z < 7.00000000000000041e-86Initial program 99.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.7%
Simplified92.7%
Taylor expanded in t around inf
Simplified69.5%
if 7.00000000000000041e-86 < z < 1.55e19Initial program 99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6464.7%
Simplified64.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= (- y z) -2e-18) t_1 (if (<= (- y z) 4.05e-47) 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-18) {
tmp = t_1;
} else if ((y - z) <= 4.05e-47) {
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-18)) then
tmp = t_1
else if ((y - z) <= 4.05d-47) 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-18) {
tmp = t_1;
} else if ((y - z) <= 4.05e-47) {
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-18: tmp = t_1 elif (y - z) <= 4.05e-47: 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-18) tmp = t_1; elseif (Float64(y - z) <= 4.05e-47) 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-18) tmp = t_1; elseif ((y - z) <= 4.05e-47) 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-18], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 4.05e-47], 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^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y - z \leq 4.05 \cdot 10^{-47}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 y z) < -2.0000000000000001e-18 or 4.0500000000000002e-47 < (-.f64 y z) Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6452.6%
Simplified52.6%
if -2.0000000000000001e-18 < (-.f64 y z) < 4.0500000000000002e-47Initial program 99.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6481.5%
Simplified81.5%
Taylor expanded in y around 0
Simplified73.2%
Final simplification56.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (* z (- x t))))) (if (<= z -1.2e-14) t_1 (if (<= z 1.35e+20) (+ x (* y (- t x))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (z * (x - t));
double tmp;
if (z <= -1.2e-14) {
tmp = t_1;
} else if (z <= 1.35e+20) {
tmp = x + (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 = x + (z * (x - t))
if (z <= (-1.2d-14)) then
tmp = t_1
else if (z <= 1.35d+20) then
tmp = x + (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 = x + (z * (x - t));
double tmp;
if (z <= -1.2e-14) {
tmp = t_1;
} else if (z <= 1.35e+20) {
tmp = x + (y * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (z * (x - t)) tmp = 0 if z <= -1.2e-14: tmp = t_1 elif z <= 1.35e+20: tmp = x + (y * (t - x)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(z * Float64(x - t))) tmp = 0.0 if (z <= -1.2e-14) tmp = t_1; elseif (z <= 1.35e+20) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (z * (x - t)); tmp = 0.0; if (z <= -1.2e-14) tmp = t_1; elseif (z <= 1.35e+20) tmp = x + (y * (t - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e-14], t$95$1, If[LessEqual[z, 1.35e+20], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+20}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2e-14 or 1.35e20 < z Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
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--.f6483.8%
Simplified83.8%
if -1.2e-14 < z < 1.35e20Initial program 99.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.4%
Simplified90.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -1100.0) t_1 (if (<= z 1.45e+20) (+ x (* 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 <= -1100.0) {
tmp = t_1;
} else if (z <= 1.45e+20) {
tmp = x + (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 <= (-1100.0d0)) then
tmp = t_1
else if (z <= 1.45d+20) then
tmp = x + (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 <= -1100.0) {
tmp = t_1;
} else if (z <= 1.45e+20) {
tmp = x + (y * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1100.0: tmp = t_1 elif z <= 1.45e+20: tmp = x + (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 <= -1100.0) tmp = t_1; elseif (z <= 1.45e+20) tmp = Float64(x + 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 <= -1100.0) tmp = t_1; elseif (z <= 1.45e+20) tmp = x + (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, -1100.0], t$95$1, If[LessEqual[z, 1.45e+20], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1100:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+20}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1100 or 1.45e20 < 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--.f6483.8%
Simplified83.8%
if -1100 < z < 1.45e20Initial program 99.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6489.5%
Simplified89.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -1.55e+71) t_1 (if (<= t 4.4e+38) (* x (+ 1.0 (- z y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -1.55e+71) {
tmp = t_1;
} else if (t <= 4.4e+38) {
tmp = x * (1.0 + (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 <= (-1.55d+71)) then
tmp = t_1
else if (t <= 4.4d+38) then
tmp = x * (1.0d0 + (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 <= -1.55e+71) {
tmp = t_1;
} else if (t <= 4.4e+38) {
tmp = x * (1.0 + (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -1.55e+71: tmp = t_1 elif t <= 4.4e+38: tmp = x * (1.0 + (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 <= -1.55e+71) tmp = t_1; elseif (t <= 4.4e+38) tmp = Float64(x * Float64(1.0 + 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 <= -1.55e+71) tmp = t_1; elseif (t <= 4.4e+38) tmp = x * (1.0 + (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, -1.55e+71], t$95$1, If[LessEqual[t, 4.4e+38], N[(x * N[(1.0 + N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+38}:\\
\;\;\;\;x \cdot \left(1 + \left(z - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.55000000000000009e71 or 4.40000000000000013e38 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6480.5%
Simplified80.5%
if -1.55000000000000009e71 < t < 4.40000000000000013e38Initial program 100.0%
Taylor expanded in x around inf
*-lowering-*.f64N/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.7%
Simplified79.7%
Final simplification80.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -980000.0) t_1 (if (<= z 2.8e+19) (* 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 <= -980000.0) {
tmp = t_1;
} else if (z <= 2.8e+19) {
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 <= (-980000.0d0)) then
tmp = t_1
else if (z <= 2.8d+19) 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 <= -980000.0) {
tmp = t_1;
} else if (z <= 2.8e+19) {
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 <= -980000.0: tmp = t_1 elif z <= 2.8e+19: 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 <= -980000.0) tmp = t_1; elseif (z <= 2.8e+19) 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 <= -980000.0) tmp = t_1; elseif (z <= 2.8e+19) 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, -980000.0], t$95$1, If[LessEqual[z, 2.8e+19], 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 -980000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+19}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.8e5 or 2.8e19 < 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--.f6483.8%
Simplified83.8%
if -9.8e5 < z < 2.8e19Initial program 99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6460.3%
Simplified60.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -4.8e+70) t_1 (if (<= t 2.55e+38) (* x (- 1.0 y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -4.8e+70) {
tmp = t_1;
} else if (t <= 2.55e+38) {
tmp = x * (1.0 - 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 <= (-4.8d+70)) then
tmp = t_1
else if (t <= 2.55d+38) then
tmp = x * (1.0d0 - 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 <= -4.8e+70) {
tmp = t_1;
} else if (t <= 2.55e+38) {
tmp = x * (1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -4.8e+70: tmp = t_1 elif t <= 2.55e+38: tmp = x * (1.0 - 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 <= -4.8e+70) tmp = t_1; elseif (t <= 2.55e+38) tmp = Float64(x * Float64(1.0 - 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 <= -4.8e+70) tmp = t_1; elseif (t <= 2.55e+38) tmp = x * (1.0 - 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, -4.8e+70], t$95$1, If[LessEqual[t, 2.55e+38], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{+38}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999974e70 or 2.5500000000000001e38 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6480.5%
Simplified80.5%
if -4.79999999999999974e70 < t < 2.5500000000000001e38Initial program 100.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6464.1%
Simplified64.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6453.1%
Simplified53.1%
Final simplification65.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -4.8e+70) t_1 (if (<= t 1.45e+39) (* x (+ z 1.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -4.8e+70) {
tmp = t_1;
} else if (t <= 1.45e+39) {
tmp = x * (z + 1.0);
} 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 <= (-4.8d+70)) then
tmp = t_1
else if (t <= 1.45d+39) then
tmp = x * (z + 1.0d0)
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 <= -4.8e+70) {
tmp = t_1;
} else if (t <= 1.45e+39) {
tmp = x * (z + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -4.8e+70: tmp = t_1 elif t <= 1.45e+39: tmp = x * (z + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -4.8e+70) tmp = t_1; elseif (t <= 1.45e+39) tmp = Float64(x * Float64(z + 1.0)); 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 <= -4.8e+70) tmp = t_1; elseif (t <= 1.45e+39) tmp = x * (z + 1.0); 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, -4.8e+70], t$95$1, If[LessEqual[t, 1.45e+39], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999974e70 or 1.45000000000000015e39 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6480.5%
Simplified80.5%
if -4.79999999999999974e70 < t < 1.45000000000000015e39Initial 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.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6479.7%
Simplified79.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6450.0%
Simplified50.0%
Final simplification63.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1000.0) (* x z) (if (<= z 1.06e+79) (* y t) (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1000.0) {
tmp = x * z;
} else if (z <= 1.06e+79) {
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 <= (-1000.0d0)) then
tmp = x * z
else if (z <= 1.06d+79) 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 <= -1000.0) {
tmp = x * z;
} else if (z <= 1.06e+79) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1000.0: tmp = x * z elif z <= 1.06e+79: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1000.0) tmp = Float64(x * z); elseif (z <= 1.06e+79) 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 <= -1000.0) tmp = x * z; elseif (z <= 1.06e+79) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1000.0], N[(x * z), $MachinePrecision], If[LessEqual[z, 1.06e+79], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1000:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{+79}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -1e3 or 1.05999999999999992e79 < 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--.f6485.4%
Simplified85.4%
Taylor expanded in x around inf
Simplified44.1%
if -1e3 < z < 1.05999999999999992e79Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6447.0%
Simplified47.0%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6434.8%
Simplified34.8%
Final simplification38.7%
(FPCore (x y z t) :precision binary64 (if (<= y -0.0003) (* y t) (if (<= y 4.05e-47) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.0003) {
tmp = y * t;
} else if (y <= 4.05e-47) {
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 <= (-0.0003d0)) then
tmp = y * t
else if (y <= 4.05d-47) 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 <= -0.0003) {
tmp = y * t;
} else if (y <= 4.05e-47) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.0003: tmp = y * t elif y <= 4.05e-47: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.0003) tmp = Float64(y * t); elseif (y <= 4.05e-47) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -0.0003) tmp = y * t; elseif (y <= 4.05e-47) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.0003], N[(y * t), $MachinePrecision], If[LessEqual[y, 4.05e-47], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0003:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 4.05 \cdot 10^{-47}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.99999999999999974e-4 or 4.0500000000000002e-47 < y Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6451.7%
Simplified51.7%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6440.6%
Simplified40.6%
if -2.99999999999999974e-4 < y < 4.0500000000000002e-47Initial program 100.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6439.0%
Simplified39.0%
Taylor expanded in y around 0
Simplified34.3%
(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 z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6458.9%
Simplified58.9%
Taylor expanded in y around 0
Simplified17.9%
(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 2024161
(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))))