
(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 (* z (- x t))))
(if (<= z -1.85e+77)
t_1
(if (<= z -2.5e-23)
(* y (- t x))
(if (<= z 1.02e-249)
(+ x (* y t))
(if (<= z 0.0255) (* x (- 1.0 y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.85e+77) {
tmp = t_1;
} else if (z <= -2.5e-23) {
tmp = y * (t - x);
} else if (z <= 1.02e-249) {
tmp = x + (y * t);
} else if (z <= 0.0255) {
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 = z * (x - t)
if (z <= (-1.85d+77)) then
tmp = t_1
else if (z <= (-2.5d-23)) then
tmp = y * (t - x)
else if (z <= 1.02d-249) then
tmp = x + (y * t)
else if (z <= 0.0255d0) 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 = z * (x - t);
double tmp;
if (z <= -1.85e+77) {
tmp = t_1;
} else if (z <= -2.5e-23) {
tmp = y * (t - x);
} else if (z <= 1.02e-249) {
tmp = x + (y * t);
} else if (z <= 0.0255) {
tmp = x * (1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1.85e+77: tmp = t_1 elif z <= -2.5e-23: tmp = y * (t - x) elif z <= 1.02e-249: tmp = x + (y * t) elif z <= 0.0255: tmp = x * (1.0 - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -1.85e+77) tmp = t_1; elseif (z <= -2.5e-23) tmp = Float64(y * Float64(t - x)); elseif (z <= 1.02e-249) tmp = Float64(x + Float64(y * t)); elseif (z <= 0.0255) 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 = z * (x - t); tmp = 0.0; if (z <= -1.85e+77) tmp = t_1; elseif (z <= -2.5e-23) tmp = y * (t - x); elseif (z <= 1.02e-249) tmp = x + (y * t); elseif (z <= 0.0255) tmp = x * (1.0 - y); 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, -1.85e+77], t$95$1, If[LessEqual[z, -2.5e-23], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e-249], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0255], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-23}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-249}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 0.0255:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.84999999999999997e77 or 0.0254999999999999984 < 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--.f6480.1%
Simplified80.1%
if -1.84999999999999997e77 < z < -2.5000000000000001e-23Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6475.8%
Simplified75.8%
if -2.5000000000000001e-23 < z < 1.02e-249Initial program 100.0%
Taylor expanded in t around inf
Simplified84.0%
Taylor expanded in y around inf
Simplified77.2%
if 1.02e-249 < z < 0.0254999999999999984Initial program 100.0%
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 y around inf
Simplified83.2%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6468.5%
Simplified68.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -4.1e-37)
t_1
(if (<= y 2.9e-179) (* z (- x t)) (if (<= y 0.8) (- x (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -4.1e-37) {
tmp = t_1;
} else if (y <= 2.9e-179) {
tmp = z * (x - t);
} else if (y <= 0.8) {
tmp = x - (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 * (t - x)
if (y <= (-4.1d-37)) then
tmp = t_1
else if (y <= 2.9d-179) then
tmp = z * (x - t)
else if (y <= 0.8d0) then
tmp = x - (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 * (t - x);
double tmp;
if (y <= -4.1e-37) {
tmp = t_1;
} else if (y <= 2.9e-179) {
tmp = z * (x - t);
} else if (y <= 0.8) {
tmp = x - (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -4.1e-37: tmp = t_1 elif y <= 2.9e-179: tmp = z * (x - t) elif y <= 0.8: tmp = x - (z * 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 <= -4.1e-37) tmp = t_1; elseif (y <= 2.9e-179) tmp = Float64(z * Float64(x - t)); elseif (y <= 0.8) tmp = Float64(x - Float64(z * 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 <= -4.1e-37) tmp = t_1; elseif (y <= 2.9e-179) tmp = z * (x - t); elseif (y <= 0.8) tmp = x - (z * 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, -4.1e-37], t$95$1, If[LessEqual[y, 2.9e-179], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.8], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-179}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 0.8:\\
\;\;\;\;x - z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.0999999999999998e-37 or 0.80000000000000004 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6481.9%
Simplified81.9%
if -4.0999999999999998e-37 < y < 2.8999999999999999e-179Initial 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--.f6469.4%
Simplified69.4%
if 2.8999999999999999e-179 < y < 0.80000000000000004Initial program 100.0%
Taylor expanded in t around inf
Simplified80.3%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6467.7%
Simplified67.7%
Final simplification75.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -1.22e-34)
t_1
(if (<= y 3e-166) (* z (- x t)) (if (<= y 2500.0) (+ x (* x z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -1.22e-34) {
tmp = t_1;
} else if (y <= 3e-166) {
tmp = z * (x - t);
} else if (y <= 2500.0) {
tmp = x + (x * z);
} 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 <= (-1.22d-34)) then
tmp = t_1
else if (y <= 3d-166) then
tmp = z * (x - t)
else if (y <= 2500.0d0) then
tmp = x + (x * z)
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 <= -1.22e-34) {
tmp = t_1;
} else if (y <= 3e-166) {
tmp = z * (x - t);
} else if (y <= 2500.0) {
tmp = x + (x * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -1.22e-34: tmp = t_1 elif y <= 3e-166: tmp = z * (x - t) elif y <= 2500.0: tmp = x + (x * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -1.22e-34) tmp = t_1; elseif (y <= 3e-166) tmp = Float64(z * Float64(x - t)); elseif (y <= 2500.0) tmp = Float64(x + Float64(x * z)); 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 <= -1.22e-34) tmp = t_1; elseif (y <= 3e-166) tmp = z * (x - t); elseif (y <= 2500.0) tmp = x + (x * z); 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, -1.22e-34], t$95$1, If[LessEqual[y, 3e-166], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2500.0], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-166}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 2500:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.22e-34 or 2500 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6481.9%
Simplified81.9%
if -1.22e-34 < y < 3.0000000000000003e-166Initial 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--.f6469.3%
Simplified69.3%
if 3.0000000000000003e-166 < y < 2500Initial 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--.f6462.4%
Simplified62.4%
Taylor expanded in z around inf
*-lowering-*.f6462.4%
Simplified62.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (* x (- z y))))) (if (<= x -1.46e-80) t_1 (if (<= x 1.3e+31) (+ x (* (- y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * (z - y));
double tmp;
if (x <= -1.46e-80) {
tmp = t_1;
} else if (x <= 1.3e+31) {
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 = x + (x * (z - y))
if (x <= (-1.46d-80)) then
tmp = t_1
else if (x <= 1.3d+31) 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 = x + (x * (z - y));
double tmp;
if (x <= -1.46e-80) {
tmp = t_1;
} else if (x <= 1.3e+31) {
tmp = x + ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * (z - y)) tmp = 0 if x <= -1.46e-80: tmp = t_1 elif x <= 1.3e+31: tmp = x + ((y - z) * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * Float64(z - y))) tmp = 0.0 if (x <= -1.46e-80) tmp = t_1; elseif (x <= 1.3e+31) 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 = x + (x * (z - y)); tmp = 0.0; if (x <= -1.46e-80) tmp = t_1; elseif (x <= 1.3e+31) tmp = x + ((y - z) * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.46e-80], t$95$1, If[LessEqual[x, 1.3e+31], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot \left(z - y\right)\\
\mathbf{if}\;x \leq -1.46 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+31}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.46e-80 or 1.3e31 < x 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--.f6487.3%
Simplified87.3%
if -1.46e-80 < x < 1.3e31Initial program 100.0%
Taylor expanded in t around inf
Simplified84.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (* x (- z y))))) (if (<= x -1.8e-82) t_1 (if (<= x 9.2e+30) (* (- y z) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * (z - y));
double tmp;
if (x <= -1.8e-82) {
tmp = t_1;
} else if (x <= 9.2e+30) {
tmp = (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 = x + (x * (z - y))
if (x <= (-1.8d-82)) then
tmp = t_1
else if (x <= 9.2d+30) then
tmp = (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 = x + (x * (z - y));
double tmp;
if (x <= -1.8e-82) {
tmp = t_1;
} else if (x <= 9.2e+30) {
tmp = (y - z) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * (z - y)) tmp = 0 if x <= -1.8e-82: tmp = t_1 elif x <= 9.2e+30: tmp = (y - z) * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * Float64(z - y))) tmp = 0.0 if (x <= -1.8e-82) tmp = t_1; elseif (x <= 9.2e+30) tmp = Float64(Float64(y - z) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * (z - y)); tmp = 0.0; if (x <= -1.8e-82) tmp = t_1; elseif (x <= 9.2e+30) tmp = (y - z) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e-82], t$95$1, If[LessEqual[x, 9.2e+30], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot \left(z - y\right)\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+30}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.79999999999999999e-82 or 9.2e30 < x 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--.f6487.3%
Simplified87.3%
if -1.79999999999999999e-82 < x < 9.2e30Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6474.6%
Simplified74.6%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (- t x)))) (if (<= y -3e-35) t_1 (if (<= y 195.0) (* z (- x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -3e-35) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = z * (x - 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 <= (-3d-35)) then
tmp = t_1
else if (y <= 195.0d0) then
tmp = z * (x - 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 <= -3e-35) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = z * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -3e-35: tmp = t_1 elif y <= 195.0: tmp = z * (x - 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 <= -3e-35) tmp = t_1; elseif (y <= 195.0) tmp = Float64(z * Float64(x - 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 <= -3e-35) tmp = t_1; elseif (y <= 195.0) tmp = z * (x - 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, -3e-35], t$95$1, If[LessEqual[y, 195.0], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -3 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.99999999999999989e-35 or 195 < y Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6481.9%
Simplified81.9%
if -2.99999999999999989e-35 < y < 195Initial 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--.f6463.3%
Simplified63.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -2.25e-69) t_1 (if (<= t 5e-6) (* 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 <= -2.25e-69) {
tmp = t_1;
} else if (t <= 5e-6) {
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 <= (-2.25d-69)) then
tmp = t_1
else if (t <= 5d-6) 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 <= -2.25e-69) {
tmp = t_1;
} else if (t <= 5e-6) {
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 <= -2.25e-69: tmp = t_1 elif t <= 5e-6: 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 <= -2.25e-69) tmp = t_1; elseif (t <= 5e-6) 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 <= -2.25e-69) tmp = t_1; elseif (t <= 5e-6) 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, -2.25e-69], t$95$1, If[LessEqual[t, 5e-6], 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 -2.25 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.25000000000000005e-69 or 5.00000000000000041e-6 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6478.7%
Simplified78.7%
if -2.25000000000000005e-69 < t < 5.00000000000000041e-6Initial program 100.0%
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%
Taylor expanded in y around inf
Simplified61.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6455.8%
Simplified55.8%
Final simplification68.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) t))) (if (<= t -2.85e-100) t_1 (if (<= t 9.5e-147) (* x z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -2.85e-100) {
tmp = t_1;
} else if (t <= 9.5e-147) {
tmp = x * z;
} 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 <= (-2.85d-100)) then
tmp = t_1
else if (t <= 9.5d-147) then
tmp = x * z
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 <= -2.85e-100) {
tmp = t_1;
} else if (t <= 9.5e-147) {
tmp = x * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -2.85e-100: tmp = t_1 elif t <= 9.5e-147: tmp = x * z 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.85e-100) tmp = t_1; elseif (t <= 9.5e-147) tmp = Float64(x * z); 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 <= -2.85e-100) tmp = t_1; elseif (t <= 9.5e-147) tmp = x * z; 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, -2.85e-100], t$95$1, If[LessEqual[t, 9.5e-147], N[(x * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -2.85 \cdot 10^{-100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-147}:\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.84999999999999985e-100 or 9.49999999999999986e-147 < t Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6469.4%
Simplified69.4%
if -2.84999999999999985e-100 < t < 9.49999999999999986e-147Initial 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--.f6443.6%
Simplified43.6%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6436.1%
Simplified36.1%
Final simplification58.7%
(FPCore (x y z t) :precision binary64 (if (<= z -9.5e+52) (* x z) (if (<= z 8.8e+81) (* y t) (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.5e+52) {
tmp = x * z;
} else if (z <= 8.8e+81) {
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 <= (-9.5d+52)) then
tmp = x * z
else if (z <= 8.8d+81) 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 <= -9.5e+52) {
tmp = x * z;
} else if (z <= 8.8e+81) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.5e+52: tmp = x * z elif z <= 8.8e+81: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.5e+52) tmp = Float64(x * z); elseif (z <= 8.8e+81) 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 <= -9.5e+52) tmp = x * z; elseif (z <= 8.8e+81) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.5e+52], N[(x * z), $MachinePrecision], If[LessEqual[z, 8.8e+81], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+52}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+81}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -9.49999999999999994e52 or 8.79999999999999948e81 < 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--.f6482.9%
Simplified82.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6452.5%
Simplified52.5%
if -9.49999999999999994e52 < z < 8.79999999999999948e81Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6452.3%
Simplified52.3%
Taylor expanded in y around inf
Simplified37.8%
Final simplification43.3%
(FPCore (x y z t) :precision binary64 (if (<= y -1.35e-42) (* y t) (if (<= y 1.26e-23) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-42) {
tmp = y * t;
} else if (y <= 1.26e-23) {
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.35d-42)) then
tmp = y * t
else if (y <= 1.26d-23) 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.35e-42) {
tmp = y * t;
} else if (y <= 1.26e-23) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.35e-42: tmp = y * t elif y <= 1.26e-23: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e-42) tmp = Float64(y * t); elseif (y <= 1.26e-23) 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.35e-42) tmp = y * t; elseif (y <= 1.26e-23) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e-42], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.26e-23], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-42}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.35e-42 or 1.25999999999999996e-23 < y Initial program 100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
--lowering--.f6457.4%
Simplified57.4%
Taylor expanded in y around inf
Simplified44.8%
if -1.35e-42 < y < 1.25999999999999996e-23Initial program 100.0%
Taylor expanded in t around inf
Simplified75.3%
Taylor expanded in x around inf
Simplified34.3%
Final simplification40.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 inf
Simplified65.5%
Taylor expanded in x around inf
Simplified16.7%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024138
(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))))