
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y x))))
(if (<= t -2.22e+167)
t_1
(if (<= t 3.4e+121) (+ x (/ (* (- y x) (- z t)) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - x);
double tmp;
if (t <= -2.22e+167) {
tmp = t_1;
} else if (t <= 3.4e+121) {
tmp = x + (((y - x) * (z - t)) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y - x)
if (t <= (-2.22d+167)) then
tmp = t_1
else if (t <= 3.4d+121) then
tmp = x + (((y - x) * (z - t)) / (a - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - x);
double tmp;
if (t <= -2.22e+167) {
tmp = t_1;
} else if (t <= 3.4e+121) {
tmp = x + (((y - x) * (z - t)) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - x) tmp = 0 if t <= -2.22e+167: tmp = t_1 elif t <= 3.4e+121: tmp = x + (((y - x) * (z - t)) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - x)) tmp = 0.0 if (t <= -2.22e+167) tmp = t_1; elseif (t <= 3.4e+121) tmp = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - x); tmp = 0.0; if (t <= -2.22e+167) tmp = t_1; elseif (t <= 3.4e+121) tmp = x + (((y - x) * (z - t)) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.22e+167], t$95$1, If[LessEqual[t, 3.4e+121], N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - x\right)\\
\mathbf{if}\;t \leq -2.22 \cdot 10^{+167}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+121}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.22e167 or 3.4000000000000001e121 < t Initial program 13.4%
Taylor expanded in x around 0
Applied rewrites2.1%
Taylor expanded in x around 0
Applied rewrites38.1%
if -2.22e167 < t < 3.4000000000000001e121Initial program 80.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (- y x) (- a t)))))
(if (<= a -5.5e+146)
t_1
(if (<= a 3.5e+224) (/ (* (- y x) (- z t)) (- a t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) / (a - t));
double tmp;
if (a <= -5.5e+146) {
tmp = t_1;
} else if (a <= 3.5e+224) {
tmp = ((y - x) * (z - t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - x) / (a - t))
if (a <= (-5.5d+146)) then
tmp = t_1
else if (a <= 3.5d+224) then
tmp = ((y - x) * (z - t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) / (a - t));
double tmp;
if (a <= -5.5e+146) {
tmp = t_1;
} else if (a <= 3.5e+224) {
tmp = ((y - x) * (z - t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - x) / (a - t)) tmp = 0 if a <= -5.5e+146: tmp = t_1 elif a <= 3.5e+224: tmp = ((y - x) * (z - t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - x) / Float64(a - t))) tmp = 0.0 if (a <= -5.5e+146) tmp = t_1; elseif (a <= 3.5e+224) tmp = Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - x) / (a - t)); tmp = 0.0; if (a <= -5.5e+146) tmp = t_1; elseif (a <= 3.5e+224) tmp = ((y - x) * (z - t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.5e+146], t$95$1, If[LessEqual[a, 3.5e+224], N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{a - t}\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+224}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.5000000000000004e146 or 3.5e224 < a Initial program 60.9%
Taylor expanded in x around 0
Applied rewrites58.4%
if -5.5000000000000004e146 < a < 3.5e224Initial program 61.3%
Taylor expanded in x around 0
Applied rewrites50.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ (- y x) (- a t))))) (if (<= a -1.7e-70) t_1 (if (<= a 1.68e+72) (+ x (- y x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) / (a - t));
double tmp;
if (a <= -1.7e-70) {
tmp = t_1;
} else if (a <= 1.68e+72) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - x) / (a - t))
if (a <= (-1.7d-70)) then
tmp = t_1
else if (a <= 1.68d+72) then
tmp = x + (y - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) / (a - t));
double tmp;
if (a <= -1.7e-70) {
tmp = t_1;
} else if (a <= 1.68e+72) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - x) / (a - t)) tmp = 0 if a <= -1.7e-70: tmp = t_1 elif a <= 1.68e+72: tmp = x + (y - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - x) / Float64(a - t))) tmp = 0.0 if (a <= -1.7e-70) tmp = t_1; elseif (a <= 1.68e+72) tmp = Float64(x + Float64(y - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - x) / (a - t)); tmp = 0.0; if (a <= -1.7e-70) tmp = t_1; elseif (a <= 1.68e+72) tmp = x + (y - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e-70], t$95$1, If[LessEqual[a, 1.68e+72], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{a - t}\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.68 \cdot 10^{+72}:\\
\;\;\;\;x + \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.69999999999999998e-70 or 1.67999999999999991e72 < a Initial program 59.7%
Taylor expanded in x around 0
Applied rewrites39.5%
if -1.69999999999999998e-70 < a < 1.67999999999999991e72Initial program 62.5%
Taylor expanded in x around 0
Applied rewrites11.9%
Taylor expanded in x around 0
Applied rewrites31.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ (- a t) (- a t))))) (if (<= x -1.9e+39) t_1 (if (<= x 2.15e+30) (+ x (- y x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a - t) / (a - t));
double tmp;
if (x <= -1.9e+39) {
tmp = t_1;
} else if (x <= 2.15e+30) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((a - t) / (a - t))
if (x <= (-1.9d+39)) then
tmp = t_1
else if (x <= 2.15d+30) then
tmp = x + (y - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a - t) / (a - t));
double tmp;
if (x <= -1.9e+39) {
tmp = t_1;
} else if (x <= 2.15e+30) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((a - t) / (a - t)) tmp = 0 if x <= -1.9e+39: tmp = t_1 elif x <= 2.15e+30: tmp = x + (y - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(a - t) / Float64(a - t))) tmp = 0.0 if (x <= -1.9e+39) tmp = t_1; elseif (x <= 2.15e+30) tmp = Float64(x + Float64(y - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((a - t) / (a - t)); tmp = 0.0; if (x <= -1.9e+39) tmp = t_1; elseif (x <= 2.15e+30) tmp = x + (y - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(a - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.9e+39], t$95$1, If[LessEqual[x, 2.15e+30], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a - t}{a - t}\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{+30}:\\
\;\;\;\;x + \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.8999999999999999e39 or 2.15e30 < x Initial program 47.4%
Taylor expanded in x around 0
Applied rewrites30.0%
if -1.8999999999999999e39 < x < 2.15e30Initial program 74.6%
Taylor expanded in x around 0
Applied rewrites8.5%
Taylor expanded in x around 0
Applied rewrites32.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- y x)))) (if (<= t -7.8e+15) t_1 (if (<= t 3.8e-7) (+ x (* (- y x) (- z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - x);
double tmp;
if (t <= -7.8e+15) {
tmp = t_1;
} else if (t <= 3.8e-7) {
tmp = x + ((y - x) * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y - x)
if (t <= (-7.8d+15)) then
tmp = t_1
else if (t <= 3.8d-7) then
tmp = x + ((y - 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 a) {
double t_1 = x + (y - x);
double tmp;
if (t <= -7.8e+15) {
tmp = t_1;
} else if (t <= 3.8e-7) {
tmp = x + ((y - x) * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - x) tmp = 0 if t <= -7.8e+15: tmp = t_1 elif t <= 3.8e-7: tmp = x + ((y - x) * (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - x)) tmp = 0.0 if (t <= -7.8e+15) tmp = t_1; elseif (t <= 3.8e-7) tmp = Float64(x + Float64(Float64(y - x) * Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - x); tmp = 0.0; if (t <= -7.8e+15) tmp = t_1; elseif (t <= 3.8e-7) tmp = x + ((y - x) * (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.8e+15], t$95$1, If[LessEqual[t, 3.8e-7], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - x\right)\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-7}:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.8e15 or 3.80000000000000015e-7 < t Initial program 38.7%
Taylor expanded in x around 0
Applied rewrites2.6%
Taylor expanded in x around 0
Applied rewrites33.2%
if -7.8e15 < t < 3.80000000000000015e-7Initial program 86.7%
Taylor expanded in x around 0
Applied rewrites25.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- a t)))) (if (<= x -2.9e+144) t_1 (if (<= x 6.5e+151) (+ x (- y x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a - t);
double tmp;
if (x <= -2.9e+144) {
tmp = t_1;
} else if (x <= 6.5e+151) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (a - t)
if (x <= (-2.9d+144)) then
tmp = t_1
else if (x <= 6.5d+151) then
tmp = x + (y - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a - t);
double tmp;
if (x <= -2.9e+144) {
tmp = t_1;
} else if (x <= 6.5e+151) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a - t) tmp = 0 if x <= -2.9e+144: tmp = t_1 elif x <= 6.5e+151: tmp = x + (y - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a - t)) tmp = 0.0 if (x <= -2.9e+144) tmp = t_1; elseif (x <= 6.5e+151) tmp = Float64(x + Float64(y - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a - t); tmp = 0.0; if (x <= -2.9e+144) tmp = t_1; elseif (x <= 6.5e+151) tmp = x + (y - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+144], t$95$1, If[LessEqual[x, 6.5e+151], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a - t\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+151}:\\
\;\;\;\;x + \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.89999999999999998e144 or 6.5000000000000002e151 < x Initial program 52.1%
Taylor expanded in x around 0
Applied rewrites19.1%
Taylor expanded in x around 0
Applied rewrites5.0%
Taylor expanded in x around inf
Applied rewrites18.8%
if -2.89999999999999998e144 < x < 6.5000000000000002e151Initial program 64.6%
Taylor expanded in x around 0
Applied rewrites11.3%
Taylor expanded in x around 0
Applied rewrites26.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- a t)))) (if (<= x -3e+144) t_1 (if (<= x 4e+150) (- y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a - t);
double tmp;
if (x <= -3e+144) {
tmp = t_1;
} else if (x <= 4e+150) {
tmp = y - x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (a - t)
if (x <= (-3d+144)) then
tmp = t_1
else if (x <= 4d+150) then
tmp = y - x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a - t);
double tmp;
if (x <= -3e+144) {
tmp = t_1;
} else if (x <= 4e+150) {
tmp = y - x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a - t) tmp = 0 if x <= -3e+144: tmp = t_1 elif x <= 4e+150: tmp = y - x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a - t)) tmp = 0.0 if (x <= -3e+144) tmp = t_1; elseif (x <= 4e+150) tmp = Float64(y - x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a - t); tmp = 0.0; if (x <= -3e+144) tmp = t_1; elseif (x <= 4e+150) tmp = y - x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+144], t$95$1, If[LessEqual[x, 4e+150], N[(y - x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a - t\right)\\
\mathbf{if}\;x \leq -3 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+150}:\\
\;\;\;\;y - x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.9999999999999999e144 or 3.99999999999999992e150 < x Initial program 52.1%
Taylor expanded in x around 0
Applied rewrites19.1%
Taylor expanded in x around 0
Applied rewrites5.0%
Taylor expanded in x around inf
Applied rewrites18.8%
if -2.9999999999999999e144 < x < 3.99999999999999992e150Initial program 64.6%
Taylor expanded in x around 0
Applied rewrites11.3%
Taylor expanded in x around 0
Applied rewrites26.4%
Taylor expanded in x around 0
Applied rewrites26.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e+275) (* (- y x) (- z t)) (+ x (- y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+275) {
tmp = (y - x) * (z - t);
} else {
tmp = x + (y - x);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8d+275)) then
tmp = (y - x) * (z - t)
else
tmp = x + (y - x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+275) {
tmp = (y - x) * (z - t);
} else {
tmp = x + (y - x);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e+275: tmp = (y - x) * (z - t) else: tmp = x + (y - x) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e+275) tmp = Float64(Float64(y - x) * Float64(z - t)); else tmp = Float64(x + Float64(y - x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e+275) tmp = (y - x) * (z - t); else tmp = x + (y - x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e+275], N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+275}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right)\\
\end{array}
\end{array}
if z < -7.99999999999999968e275Initial program 89.5%
Taylor expanded in x around 0
Applied rewrites89.5%
Taylor expanded in x around 0
Applied rewrites66.7%
if -7.99999999999999968e275 < z Initial program 60.2%
Taylor expanded in x around 0
Applied rewrites11.5%
Taylor expanded in x around 0
Applied rewrites21.2%
(FPCore (x y z t a) :precision binary64 (- y x))
double code(double x, double y, double z, double t, double a) {
return y - x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y - x
end function
public static double code(double x, double y, double z, double t, double a) {
return y - x;
}
def code(x, y, z, t, a): return y - x
function code(x, y, z, t, a) return Float64(y - x) end
function tmp = code(x, y, z, t, a) tmp = y - x; end
code[x_, y_, z_, t_, a_] := N[(y - x), $MachinePrecision]
\begin{array}{l}
\\
y - x
\end{array}
Initial program 61.2%
Taylor expanded in x around 0
Applied rewrites13.5%
Taylor expanded in x around 0
Applied rewrites20.5%
Taylor expanded in x around 0
Applied rewrites20.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(if (< a -1.6153062845442575e-142)
t_1
(if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
if (a < (-1.6153062845442575d-142)) then
tmp = t_1
else if (a < 3.774403170083174d-182) then
tmp = y - ((z / t) * (y - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))) tmp = 0 if a < -1.6153062845442575e-142: tmp = t_1 elif a < 3.774403170083174e-182: tmp = y - ((z / t) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))); tmp = 0.0; if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = y - ((z / t) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024321
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:pre (TRUE)
:alt
(! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))