
(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 16 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) (/ (- a t) (- z t)))))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -2e-258)
t_1
(if (<= t_2 0.0) (fma (- x y) (/ (- z a) t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) / ((a - t) / (z - t)));
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-258) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma((x - y), ((z - a) / t), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - x) / Float64(Float64(a - t) / Float64(z - t)))) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-258) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-258], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{\frac{a - t}{z - t}}\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-258}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.99999999999999991e-258 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 73.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6490.6
Applied rewrites90.6%
if -1.99999999999999991e-258 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 4.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 rewrites99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- z t) (- a t)) (- y x) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -2e-258)
t_1
(if (<= t_2 0.0) (fma (- x y) (/ (- z a) t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((z - t) / (a - t)), (y - x), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-258) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma((x - y), ((z - a) / t), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-258) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-258], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-258}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.99999999999999991e-258 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 73.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6490.2
Applied rewrites90.2%
if -1.99999999999999991e-258 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 4.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 rewrites99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y x))))
(if (<= t -1.7e+144)
t_1
(if (<= t -1.2e-126)
(/ (* x z) t)
(if (<= t 1.7e-158)
(/ (* y z) a)
(if (<= t 3.4e+75) (* 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 <= -1.7e+144) {
tmp = t_1;
} else if (t <= -1.2e-126) {
tmp = (x * z) / t;
} else if (t <= 1.7e-158) {
tmp = (y * z) / a;
} else if (t <= 3.4e+75) {
tmp = 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 <= (-1.7d+144)) then
tmp = t_1
else if (t <= (-1.2d-126)) then
tmp = (x * z) / t
else if (t <= 1.7d-158) then
tmp = (y * z) / a
else if (t <= 3.4d+75) 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 a) {
double t_1 = x + (y - x);
double tmp;
if (t <= -1.7e+144) {
tmp = t_1;
} else if (t <= -1.2e-126) {
tmp = (x * z) / t;
} else if (t <= 1.7e-158) {
tmp = (y * z) / a;
} else if (t <= 3.4e+75) {
tmp = 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 <= -1.7e+144: tmp = t_1 elif t <= -1.2e-126: tmp = (x * z) / t elif t <= 1.7e-158: tmp = (y * z) / a elif t <= 3.4e+75: tmp = 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 <= -1.7e+144) tmp = t_1; elseif (t <= -1.2e-126) tmp = Float64(Float64(x * z) / t); elseif (t <= 1.7e-158) tmp = Float64(Float64(y * z) / a); elseif (t <= 3.4e+75) tmp = Float64(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 <= -1.7e+144) tmp = t_1; elseif (t <= -1.2e-126) tmp = (x * z) / t; elseif (t <= 1.7e-158) tmp = (y * z) / a; elseif (t <= 3.4e+75) tmp = 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, -1.7e+144], t$95$1, If[LessEqual[t, -1.2e-126], N[(N[(x * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.7e-158], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 3.4e+75], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - x\right)\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-126}:\\
\;\;\;\;\frac{x \cdot z}{t}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-158}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+75}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7e144 or 3.40000000000000011e75 < t Initial program 28.5%
Taylor expanded in t around inf
lower--.f6449.4
Applied rewrites49.4%
if -1.7e144 < t < -1.20000000000000003e-126Initial program 74.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 rewrites50.0%
Taylor expanded in a around 0
Applied rewrites48.4%
Taylor expanded in x around inf
Applied rewrites22.4%
if -1.20000000000000003e-126 < t < 1.7e-158Initial program 97.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6479.9
Applied rewrites79.9%
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--.f6444.2
Applied rewrites44.2%
Taylor expanded in t around 0
Applied rewrites40.4%
if 1.7e-158 < t < 3.40000000000000011e75Initial program 73.4%
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 rewrites52.4%
Taylor expanded in a around 0
Applied rewrites44.6%
Taylor expanded in x around inf
Applied rewrites28.5%
Applied rewrites30.4%
Final simplification37.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y x))))
(if (<= t -1.7e+144)
t_1
(if (<= t -1.6e-124)
(/ (* x z) t)
(if (<= t 1.7e-158)
(* y (/ z a))
(if (<= t 3.4e+75) (* 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 <= -1.7e+144) {
tmp = t_1;
} else if (t <= -1.6e-124) {
tmp = (x * z) / t;
} else if (t <= 1.7e-158) {
tmp = y * (z / a);
} else if (t <= 3.4e+75) {
tmp = 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 <= (-1.7d+144)) then
tmp = t_1
else if (t <= (-1.6d-124)) then
tmp = (x * z) / t
else if (t <= 1.7d-158) then
tmp = y * (z / a)
else if (t <= 3.4d+75) 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 a) {
double t_1 = x + (y - x);
double tmp;
if (t <= -1.7e+144) {
tmp = t_1;
} else if (t <= -1.6e-124) {
tmp = (x * z) / t;
} else if (t <= 1.7e-158) {
tmp = y * (z / a);
} else if (t <= 3.4e+75) {
tmp = 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 <= -1.7e+144: tmp = t_1 elif t <= -1.6e-124: tmp = (x * z) / t elif t <= 1.7e-158: tmp = y * (z / a) elif t <= 3.4e+75: tmp = 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 <= -1.7e+144) tmp = t_1; elseif (t <= -1.6e-124) tmp = Float64(Float64(x * z) / t); elseif (t <= 1.7e-158) tmp = Float64(y * Float64(z / a)); elseif (t <= 3.4e+75) tmp = Float64(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 <= -1.7e+144) tmp = t_1; elseif (t <= -1.6e-124) tmp = (x * z) / t; elseif (t <= 1.7e-158) tmp = y * (z / a); elseif (t <= 3.4e+75) tmp = 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, -1.7e+144], t$95$1, If[LessEqual[t, -1.6e-124], N[(N[(x * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.7e-158], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+75], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - x\right)\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-124}:\\
\;\;\;\;\frac{x \cdot z}{t}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-158}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+75}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7e144 or 3.40000000000000011e75 < t Initial program 28.5%
Taylor expanded in t around inf
lower--.f6449.4
Applied rewrites49.4%
if -1.7e144 < t < -1.60000000000000002e-124Initial program 74.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 rewrites50.0%
Taylor expanded in a around 0
Applied rewrites48.4%
Taylor expanded in x around inf
Applied rewrites22.4%
if -1.60000000000000002e-124 < t < 1.7e-158Initial program 97.3%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6469.8
Applied rewrites69.8%
Taylor expanded in y around inf
Applied rewrites44.0%
Taylor expanded in a around inf
Applied rewrites40.3%
if 1.7e-158 < t < 3.40000000000000011e75Initial program 73.4%
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 rewrites52.4%
Taylor expanded in a around 0
Applied rewrites44.6%
Taylor expanded in x around inf
Applied rewrites28.5%
Applied rewrites30.4%
Final simplification37.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma z (/ (- x y) t) y)))
(if (<= t -66000.0)
t_1
(if (<= t -6.4e-229)
(- x (/ (* x z) a))
(if (<= t 1.2e-115) (/ (* (- y x) z) a) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, ((x - y) / t), y);
double tmp;
if (t <= -66000.0) {
tmp = t_1;
} else if (t <= -6.4e-229) {
tmp = x - ((x * z) / a);
} else if (t <= 1.2e-115) {
tmp = ((y - x) * z) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(Float64(x - y) / t), y) tmp = 0.0 if (t <= -66000.0) tmp = t_1; elseif (t <= -6.4e-229) tmp = Float64(x - Float64(Float64(x * z) / a)); elseif (t <= 1.2e-115) tmp = Float64(Float64(Float64(y - x) * z) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -66000.0], t$95$1, If[LessEqual[t, -6.4e-229], N[(x - N[(N[(x * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-115], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{x - y}{t}, y\right)\\
\mathbf{if}\;t \leq -66000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.4 \cdot 10^{-229}:\\
\;\;\;\;x - \frac{x \cdot z}{a}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-115}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -66000 or 1.20000000000000011e-115 < t Initial program 46.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 rewrites75.2%
Taylor expanded in a around 0
Applied rewrites69.0%
if -66000 < t < -6.4000000000000003e-229Initial program 89.3%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
lower-+.f64N/A
lower-neg.f6474.3
Applied rewrites74.3%
Taylor expanded in t around 0
Applied rewrites59.6%
if -6.4000000000000003e-229 < t < 1.20000000000000011e-115Initial program 98.4%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6469.4
Applied rewrites69.4%
Taylor expanded in a around inf
Applied rewrites65.4%
Final simplification66.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma z (/ x t) y)))
(if (<= t -6.6e+36)
t_1
(if (<= t -6.4e-229)
(- x (/ (* x z) a))
(if (<= t 7.2e-142) (/ (* (- y x) z) a) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, (x / t), y);
double tmp;
if (t <= -6.6e+36) {
tmp = t_1;
} else if (t <= -6.4e-229) {
tmp = x - ((x * z) / a);
} else if (t <= 7.2e-142) {
tmp = ((y - x) * z) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(x / t), y) tmp = 0.0 if (t <= -6.6e+36) tmp = t_1; elseif (t <= -6.4e-229) tmp = Float64(x - Float64(Float64(x * z) / a)); elseif (t <= 7.2e-142) tmp = Float64(Float64(Float64(y - x) * z) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(x / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -6.6e+36], t$95$1, If[LessEqual[t, -6.4e-229], N[(x - N[(N[(x * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-142], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{x}{t}, y\right)\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.4 \cdot 10^{-229}:\\
\;\;\;\;x - \frac{x \cdot z}{a}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-142}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.5999999999999997e36 or 7.20000000000000001e-142 < t Initial program 47.0%
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 rewrites73.9%
Taylor expanded in a around 0
Applied rewrites67.7%
Taylor expanded in x around inf
Applied rewrites61.8%
if -6.5999999999999997e36 < t < -6.4000000000000003e-229Initial program 89.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
lower-+.f64N/A
lower-neg.f6469.6
Applied rewrites69.6%
Taylor expanded in t around 0
Applied rewrites57.4%
if -6.4000000000000003e-229 < t < 7.20000000000000001e-142Initial program 98.1%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6474.6
Applied rewrites74.6%
Taylor expanded in a around inf
Applied rewrites70.1%
Final simplification62.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x y) (/ (- z a) t) y)))
(if (<= t -1.6e+34)
t_1
(if (<= t 1.4e-44) (fma (- z t) (/ (- y x) a) 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 <= -1.6e+34) {
tmp = t_1;
} else if (t <= 1.4e-44) {
tmp = fma((z - t), ((y - x) / a), 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 <= -1.6e+34) tmp = t_1; elseif (t <= 1.4e-44) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), 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, -1.6e+34], t$95$1, If[LessEqual[t, 1.4e-44], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $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.6 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-44}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5999999999999999e34 or 1.4e-44 < t Initial program 40.6%
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 rewrites79.8%
if -1.5999999999999999e34 < t < 1.4e-44Initial program 93.2%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6480.3
Applied rewrites80.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- x y) (/ (- z a) t) y))) (if (<= t -1.6e+34) t_1 (if (<= t 1.4e-44) (fma z (/ (- y x) a) 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 <= -1.6e+34) {
tmp = t_1;
} else if (t <= 1.4e-44) {
tmp = fma(z, ((y - x) / a), 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 <= -1.6e+34) tmp = t_1; elseif (t <= 1.4e-44) tmp = fma(z, Float64(Float64(y - x) / a), 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, -1.6e+34], t$95$1, If[LessEqual[t, 1.4e-44], N[(z * N[(N[(y - x), $MachinePrecision] / a), $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.6 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-44}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5999999999999999e34 or 1.4e-44 < t Initial program 40.6%
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 rewrites79.8%
if -1.5999999999999999e34 < t < 1.4e-44Initial program 93.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6477.9
Applied rewrites77.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ (- x y) t) y))) (if (<= t -1.6e+34) t_1 (if (<= t 3.6e-44) (fma z (/ (- y x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, ((x - y) / t), y);
double tmp;
if (t <= -1.6e+34) {
tmp = t_1;
} else if (t <= 3.6e-44) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(Float64(x - y) / t), y) tmp = 0.0 if (t <= -1.6e+34) tmp = t_1; elseif (t <= 3.6e-44) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.6e+34], t$95$1, If[LessEqual[t, 3.6e-44], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{x - y}{t}, y\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-44}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5999999999999999e34 or 3.5999999999999999e-44 < t Initial program 40.6%
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 rewrites79.8%
Taylor expanded in a around 0
Applied rewrites72.8%
if -1.5999999999999999e34 < t < 3.5999999999999999e-44Initial program 93.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6477.9
Applied rewrites77.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ x t) y))) (if (<= t -6.6e+36) t_1 (if (<= t 2.2e-110) (- x (/ (* x z) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, (x / t), y);
double tmp;
if (t <= -6.6e+36) {
tmp = t_1;
} else if (t <= 2.2e-110) {
tmp = x - ((x * z) / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(x / t), y) tmp = 0.0 if (t <= -6.6e+36) tmp = t_1; elseif (t <= 2.2e-110) tmp = Float64(x - Float64(Float64(x * z) / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(x / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -6.6e+36], t$95$1, If[LessEqual[t, 2.2e-110], N[(x - N[(N[(x * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{x}{t}, y\right)\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-110}:\\
\;\;\;\;x - \frac{x \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.5999999999999997e36 or 2.1999999999999999e-110 < t Initial program 43.5%
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 rewrites76.5%
Taylor expanded in a around 0
Applied rewrites69.8%
Taylor expanded in x around inf
Applied rewrites62.8%
if -6.5999999999999997e36 < t < 2.1999999999999999e-110Initial program 94.3%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
lower-+.f64N/A
lower-neg.f6459.2
Applied rewrites59.2%
Taylor expanded in t around 0
Applied rewrites54.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (/ x a) x))) (if (<= a -7200.0) t_1 (if (<= a 6.8e+19) (fma z (/ x t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (x / a), x);
double tmp;
if (a <= -7200.0) {
tmp = t_1;
} else if (a <= 6.8e+19) {
tmp = fma(z, (x / t), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(x / a), x) tmp = 0.0 if (a <= -7200.0) tmp = t_1; elseif (a <= 6.8e+19) tmp = fma(z, Float64(x / t), y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(x / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -7200.0], t$95$1, If[LessEqual[a, 6.8e+19], N[(z * N[(x / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{x}{a}, x\right)\\
\mathbf{if}\;a \leq -7200:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7200 or 6.8e19 < a Initial program 71.7%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
lower-+.f64N/A
lower-neg.f6461.5
Applied rewrites61.5%
Taylor expanded in z around 0
Applied rewrites47.4%
Taylor expanded in t around 0
Applied rewrites47.9%
if -7200 < a < 6.8e19Initial program 64.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.1%
Taylor expanded in a around 0
Applied rewrites68.4%
Taylor expanded in x around inf
Applied rewrites57.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ x t) y))) (if (<= t -7e-127) t_1 (if (<= t 5.5e-142) (/ (* y z) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, (x / t), y);
double tmp;
if (t <= -7e-127) {
tmp = t_1;
} else if (t <= 5.5e-142) {
tmp = (y * z) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(x / t), y) tmp = 0.0 if (t <= -7e-127) tmp = t_1; elseif (t <= 5.5e-142) tmp = Float64(Float64(y * z) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(x / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -7e-127], t$95$1, If[LessEqual[t, 5.5e-142], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{x}{t}, y\right)\\
\mathbf{if}\;t \leq -7 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-142}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.99999999999999979e-127 or 5.50000000000000023e-142 < t Initial program 54.1%
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 rewrites67.5%
Taylor expanded in a around 0
Applied rewrites62.4%
Taylor expanded in x around inf
Applied rewrites55.9%
if -6.99999999999999979e-127 < t < 5.50000000000000023e-142Initial program 96.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6478.7
Applied rewrites78.7%
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--.f6444.0
Applied rewrites44.0%
Taylor expanded in t around 0
Applied rewrites39.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- y x)))) (if (<= t -1.7e+144) t_1 (if (<= t 3.4e+75) (* 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 <= -1.7e+144) {
tmp = t_1;
} else if (t <= 3.4e+75) {
tmp = 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 <= (-1.7d+144)) then
tmp = t_1
else if (t <= 3.4d+75) 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 a) {
double t_1 = x + (y - x);
double tmp;
if (t <= -1.7e+144) {
tmp = t_1;
} else if (t <= 3.4e+75) {
tmp = 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 <= -1.7e+144: tmp = t_1 elif t <= 3.4e+75: tmp = 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 <= -1.7e+144) tmp = t_1; elseif (t <= 3.4e+75) tmp = Float64(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 <= -1.7e+144) tmp = t_1; elseif (t <= 3.4e+75) tmp = 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, -1.7e+144], t$95$1, If[LessEqual[t, 3.4e+75], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - x\right)\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+75}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7e144 or 3.40000000000000011e75 < t Initial program 28.5%
Taylor expanded in t around inf
lower--.f6449.4
Applied rewrites49.4%
if -1.7e144 < t < 3.40000000000000011e75Initial program 83.7%
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 rewrites39.8%
Taylor expanded in a around 0
Applied rewrites36.7%
Taylor expanded in x around inf
Applied rewrites21.2%
Applied rewrites22.1%
Final simplification30.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- y x)))) (if (<= y -3.6e+71) t_1 (if (<= y 6.8e-66) (* z (/ x t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - x);
double tmp;
if (y <= -3.6e+71) {
tmp = t_1;
} else if (y <= 6.8e-66) {
tmp = z * (x / 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 (y <= (-3.6d+71)) then
tmp = t_1
else if (y <= 6.8d-66) 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 a) {
double t_1 = x + (y - x);
double tmp;
if (y <= -3.6e+71) {
tmp = t_1;
} else if (y <= 6.8e-66) {
tmp = z * (x / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - x) tmp = 0 if y <= -3.6e+71: tmp = t_1 elif y <= 6.8e-66: tmp = z * (x / 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 (y <= -3.6e+71) tmp = t_1; elseif (y <= 6.8e-66) tmp = Float64(z * Float64(x / 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 (y <= -3.6e+71) tmp = t_1; elseif (y <= 6.8e-66) tmp = z * (x / 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[y, -3.6e+71], t$95$1, If[LessEqual[y, 6.8e-66], N[(z * N[(x / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - x\right)\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-66}:\\
\;\;\;\;z \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.6e71 or 6.79999999999999994e-66 < y Initial program 67.2%
Taylor expanded in t around inf
lower--.f6431.7
Applied rewrites31.7%
if -3.6e71 < y < 6.79999999999999994e-66Initial program 67.4%
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 rewrites52.5%
Taylor expanded in a around 0
Applied rewrites46.1%
Taylor expanded in x around inf
Applied rewrites24.3%
Applied rewrites27.2%
(FPCore (x y z t a) :precision binary64 (+ x (- y x)))
double code(double x, double y, double z, double t, double a) {
return x + (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 = x + (y - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y - x);
}
def code(x, y, z, t, a): return x + (y - x)
function code(x, y, z, t, a) return Float64(x + Float64(y - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (y - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right)
\end{array}
Initial program 67.3%
Taylor expanded in t around inf
lower--.f6420.6
Applied rewrites20.6%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 67.3%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
lower-+.f64N/A
lower-neg.f6442.0
Applied rewrites42.0%
Taylor expanded in t around inf
Applied rewrites2.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 2024225
(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))))