
(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 13 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
(if (<= t -6.2e+231)
(fma (- x y) (/ (- z a) t) y)
(if (<= t 2.15e+99)
(- x (/ (- x y) (/ (- t a) (- t z))))
(- y (* (/ (- y x) t) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e+231) {
tmp = fma((x - y), ((z - a) / t), y);
} else if (t <= 2.15e+99) {
tmp = x - ((x - y) / ((t - a) / (t - z)));
} else {
tmp = y - (((y - x) / t) * (z - a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.2e+231) tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); elseif (t <= 2.15e+99) tmp = Float64(x - Float64(Float64(x - y) / Float64(Float64(t - a) / Float64(t - z)))); else tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.2e+231], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t, 2.15e+99], N[(x - N[(N[(x - y), $MachinePrecision] / N[(N[(t - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+231}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+99}:\\
\;\;\;\;x - \frac{x - y}{\frac{t - a}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\end{array}
\end{array}
if t < -6.1999999999999998e231Initial program 10.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites89.5%
if -6.1999999999999998e231 < t < 2.1500000000000001e99Initial program 75.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
if 2.1500000000000001e99 < t Initial program 26.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6455.7
Applied rewrites55.7%
Taylor expanded in t around inf
mul-1-negN/A
unsub-negN/A
associate--l-N/A
mul-1-negN/A
sub-negN/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.1
Applied rewrites88.1%
Final simplification89.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.2e+231)
(fma (- x y) (/ (- z a) t) y)
(if (<= t 1.06e+99)
(fma (- z t) (/ (- x y) (- t a)) x)
(- y (* (/ (- y x) t) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+231) {
tmp = fma((x - y), ((z - a) / t), y);
} else if (t <= 1.06e+99) {
tmp = fma((z - t), ((x - y) / (t - a)), x);
} else {
tmp = y - (((y - x) / t) * (z - a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+231) tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); elseif (t <= 1.06e+99) tmp = fma(Float64(z - t), Float64(Float64(x - y) / Float64(t - a)), x); else tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+231], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t, 1.06e+99], N[(N[(z - t), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+231}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{+99}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{x - y}{t - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\end{array}
\end{array}
if t < -4.19999999999999969e231Initial program 10.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites89.5%
if -4.19999999999999969e231 < t < 1.05999999999999999e99Initial program 75.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6487.8
Applied rewrites87.8%
if 1.05999999999999999e99 < t Initial program 26.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6455.7
Applied rewrites55.7%
Taylor expanded in t around inf
mul-1-negN/A
unsub-negN/A
associate--l-N/A
mul-1-negN/A
sub-negN/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.1
Applied rewrites88.1%
Final simplification87.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1e-78)
(fma (- x y) (/ (- z a) t) y)
(if (<= t 4.4e-17)
(fma (/ z a) (- y x) x)
(- y (* (/ (- y x) t) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e-78) {
tmp = fma((x - y), ((z - a) / t), y);
} else if (t <= 4.4e-17) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = y - (((y - x) / t) * (z - a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1e-78) tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); elseif (t <= 4.4e-17) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1e-78], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t, 4.4e-17], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\end{array}
\end{array}
if t < -9.99999999999999999e-79Initial program 51.2%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites69.4%
if -9.99999999999999999e-79 < t < 4.4e-17Initial program 87.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6485.6
Applied rewrites85.6%
Applied rewrites87.1%
if 4.4e-17 < t Initial program 32.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6461.0
Applied rewrites61.0%
Taylor expanded in t around inf
mul-1-negN/A
unsub-negN/A
associate--l-N/A
mul-1-negN/A
sub-negN/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.5
Applied rewrites82.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- x y) (/ (- z a) t) y))) (if (<= t -1e-78) t_1 (if (<= t 4.4e-17) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - y), ((z - a) / t), y);
double tmp;
if (t <= -1e-78) {
tmp = t_1;
} else if (t <= 4.4e-17) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - y), Float64(Float64(z - a) / t), y) tmp = 0.0 if (t <= -1e-78) tmp = t_1; elseif (t <= 4.4e-17) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1e-78], t$95$1, If[LessEqual[t, 4.4e-17], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{if}\;t \leq -1 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.99999999999999999e-79 or 4.4e-17 < t Initial program 43.3%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites74.4%
if -9.99999999999999999e-79 < t < 4.4e-17Initial program 87.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6485.6
Applied rewrites85.6%
Applied rewrites87.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- t z) (- t a)) y))) (if (<= t -4e-86) t_1 (if (<= t 1.8e-87) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - z) / (t - a)) * y;
double tmp;
if (t <= -4e-86) {
tmp = t_1;
} else if (t <= 1.8e-87) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - z) / Float64(t - a)) * y) tmp = 0.0 if (t <= -4e-86) tmp = t_1; elseif (t <= 1.8e-87) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -4e-86], t$95$1, If[LessEqual[t, 1.8e-87], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a} \cdot y\\
\mathbf{if}\;t \leq -4 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-87}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.00000000000000034e-86 or 1.79999999999999996e-87 < t Initial program 45.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6472.6
Applied rewrites72.6%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6443.5
Applied rewrites43.5%
Applied rewrites64.1%
if -4.00000000000000034e-86 < t < 1.79999999999999996e-87Initial program 89.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6490.5
Applied rewrites90.5%
Applied rewrites92.2%
Final simplification75.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y (- a t)) (- z t)))) (if (<= t -4e-86) t_1 (if (<= t 1.8e-87) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (a - t)) * (z - t);
double tmp;
if (t <= -4e-86) {
tmp = t_1;
} else if (t <= 1.8e-87) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(a - t)) * Float64(z - t)) tmp = 0.0 if (t <= -4e-86) tmp = t_1; elseif (t <= 1.8e-87) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e-86], t$95$1, If[LessEqual[t, 1.8e-87], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - t} \cdot \left(z - t\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-87}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.00000000000000034e-86 or 1.79999999999999996e-87 < t Initial program 45.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6458.8
Applied rewrites58.8%
if -4.00000000000000034e-86 < t < 1.79999999999999996e-87Initial program 89.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6490.5
Applied rewrites90.5%
Applied rewrites92.2%
Final simplification72.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- t z) t) y))) (if (<= t -3.2e+60) t_1 (if (<= t 1.15e-23) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - z) / t) * y;
double tmp;
if (t <= -3.2e+60) {
tmp = t_1;
} else if (t <= 1.15e-23) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - z) / t) * y) tmp = 0.0 if (t <= -3.2e+60) tmp = t_1; elseif (t <= 1.15e-23) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -3.2e+60], t$95$1, If[LessEqual[t, 1.15e-23], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t} \cdot y\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.19999999999999991e60 or 1.15000000000000005e-23 < t Initial program 34.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6467.1
Applied rewrites67.1%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.0
Applied rewrites39.0%
Taylor expanded in a around 0
Applied rewrites54.2%
if -3.19999999999999991e60 < t < 1.15000000000000005e-23Initial program 84.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.3
Applied rewrites76.3%
Applied rewrites78.0%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y (- t a)) t))) (if (<= t -3.2e+60) t_1 (if (<= t 1.4e-13) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (t - a)) * t;
double tmp;
if (t <= -3.2e+60) {
tmp = t_1;
} else if (t <= 1.4e-13) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(t - a)) * t) tmp = 0.0 if (t <= -3.2e+60) tmp = t_1; elseif (t <= 1.4e-13) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.2e+60], t$95$1, If[LessEqual[t, 1.4e-13], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t - a} \cdot t\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.19999999999999991e60 or 1.4000000000000001e-13 < t Initial program 34.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.8
Applied rewrites38.8%
Taylor expanded in z around 0
Applied rewrites49.4%
if -3.19999999999999991e60 < t < 1.4000000000000001e-13Initial program 83.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.9
Applied rewrites75.9%
Applied rewrites77.7%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- y x) x))) (if (<= t -3.4e+161) t_1 (if (<= t 4.4e+88) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - x) + x;
double tmp;
if (t <= -3.4e+161) {
tmp = t_1;
} else if (t <= 4.4e+88) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - x) + x) tmp = 0.0 if (t <= -3.4e+161) tmp = t_1; elseif (t <= 4.4e+88) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -3.4e+161], t$95$1, If[LessEqual[t, 4.4e+88], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - x\right) + x\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.39999999999999993e161 or 4.40000000000000017e88 < t Initial program 29.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6462.6
Applied rewrites62.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
associate-*l/N/A
lift--.f64N/A
lift--.f64N/A
clear-numN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6462.3
Applied rewrites62.3%
Taylor expanded in t around inf
lower--.f6432.5
Applied rewrites32.5%
if -3.39999999999999993e161 < t < 4.40000000000000017e88Initial program 76.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.8
Applied rewrites66.8%
Applied rewrites68.2%
Final simplification57.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- y x) x)))
(if (<= t -3.4e+161)
t_1
(if (<= t 48000000000000.0) (fma (/ y a) z x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - x) + x;
double tmp;
if (t <= -3.4e+161) {
tmp = t_1;
} else if (t <= 48000000000000.0) {
tmp = fma((y / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - x) + x) tmp = 0.0 if (t <= -3.4e+161) tmp = t_1; elseif (t <= 48000000000000.0) tmp = fma(Float64(y / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -3.4e+161], t$95$1, If[LessEqual[t, 48000000000000.0], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - x\right) + x\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 48000000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.39999999999999993e161 or 4.8e13 < t Initial program 30.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6464.3
Applied rewrites64.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
associate-*l/N/A
lift--.f64N/A
lift--.f64N/A
clear-numN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6464.0
Applied rewrites64.0%
Taylor expanded in t around inf
lower--.f6431.6
Applied rewrites31.6%
if -3.39999999999999993e161 < t < 4.8e13Initial program 79.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6469.0
Applied rewrites69.0%
Taylor expanded in x around 0
Applied rewrites57.3%
Final simplification48.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- y x) x))) (if (<= t -1.9e-12) t_1 (if (<= t 3000.0) (* (/ z a) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - x) + x;
double tmp;
if (t <= -1.9e-12) {
tmp = t_1;
} else if (t <= 3000.0) {
tmp = (z / a) * y;
} 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 = (y - x) + x
if (t <= (-1.9d-12)) then
tmp = t_1
else if (t <= 3000.0d0) then
tmp = (z / a) * y
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 = (y - x) + x;
double tmp;
if (t <= -1.9e-12) {
tmp = t_1;
} else if (t <= 3000.0) {
tmp = (z / a) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - x) + x tmp = 0 if t <= -1.9e-12: tmp = t_1 elif t <= 3000.0: tmp = (z / a) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - x) + x) tmp = 0.0 if (t <= -1.9e-12) tmp = t_1; elseif (t <= 3000.0) tmp = Float64(Float64(z / a) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - x) + x; tmp = 0.0; if (t <= -1.9e-12) tmp = t_1; elseif (t <= 3000.0) tmp = (z / a) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -1.9e-12], t$95$1, If[LessEqual[t, 3000.0], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - x\right) + x\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3000:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.89999999999999998e-12 or 3e3 < t Initial program 38.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6469.0
Applied rewrites69.0%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
associate-*l/N/A
lift--.f64N/A
lift--.f64N/A
clear-numN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6468.8
Applied rewrites68.8%
Taylor expanded in t around inf
lower--.f6429.2
Applied rewrites29.2%
if -1.89999999999999998e-12 < t < 3e3Initial program 86.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6480.7
Applied rewrites80.7%
Taylor expanded in x around 0
Applied rewrites28.6%
Applied rewrites36.9%
Final simplification33.1%
(FPCore (x y z t a) :precision binary64 (+ (- y x) x))
double code(double x, double y, double z, double t, double a) {
return (y - x) + 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) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y - x) + x;
}
def code(x, y, z, t, a): return (y - x) + x
function code(x, y, z, t, a) return Float64(Float64(y - x) + x) end
function tmp = code(x, y, z, t, a) tmp = (y - x) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(y - x\right) + x
\end{array}
Initial program 63.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
associate-*l/N/A
lift--.f64N/A
lift--.f64N/A
clear-numN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6481.7
Applied rewrites81.7%
Taylor expanded in t around inf
lower--.f6416.7
Applied rewrites16.7%
Final simplification16.7%
(FPCore (x y z t a) :precision binary64 (+ (- x) x))
double code(double x, double y, double z, double t, double a) {
return -x + 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 = -x + x
end function
public static double code(double x, double y, double z, double t, double a) {
return -x + x;
}
def code(x, y, z, t, a): return -x + x
function code(x, y, z, t, a) return Float64(Float64(-x) + x) end
function tmp = code(x, y, z, t, a) tmp = -x + x; end
code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) + x
\end{array}
Initial program 63.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
associate-*l/N/A
lift--.f64N/A
lift--.f64N/A
clear-numN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6481.7
Applied rewrites81.7%
Taylor expanded in t around inf
lower--.f6416.7
Applied rewrites16.7%
Taylor expanded in x around inf
Applied rewrites2.8%
Final simplification2.8%
(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 2024298
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
: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))))