
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- t x) (/ (- z y) (- z a)) x))
(t_2 (- x (/ (* (- z y) (- x t)) (- z a)))))
(if (<= t_2 -5e-244)
t_1
(if (<= t_2 0.0) (- t (/ (* (- a y) (- x t)) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((z - y) / (z - a)), x);
double t_2 = x - (((z - y) * (x - t)) / (z - a));
double tmp;
if (t_2 <= -5e-244) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = t - (((a - y) * (x - t)) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(z - y) / Float64(z - a)), x) t_2 = Float64(x - Float64(Float64(Float64(z - y) * Float64(x - t)) / Float64(z - a))) tmp = 0.0 if (t_2 <= -5e-244) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(t - Float64(Float64(Float64(a - y) * Float64(x - t)) / z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(z - y), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-244], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t - N[(N[(N[(a - y), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{z - y}{z - a}, x\right)\\
t_2 := x - \frac{\left(z - y\right) \cdot \left(x - t\right)}{z - a}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t - \frac{\left(a - y\right) \cdot \left(x - t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999998e-244 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 74.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
if -4.99999999999999998e-244 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 7.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f642.5
Applied rewrites2.5%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites99.7%
Final simplification92.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (fma t -1.0 x) z) (- y a) t)))
(if (<= z -2.8e+63)
t_1
(if (<= z -2.8e-137)
(+ (* (/ t (- z a)) (- z y)) x)
(if (<= z 2.4e-54) (fma (/ (- y z) a) (- t x) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((fma(t, -1.0, x) / z), (y - a), t);
double tmp;
if (z <= -2.8e+63) {
tmp = t_1;
} else if (z <= -2.8e-137) {
tmp = ((t / (z - a)) * (z - y)) + x;
} else if (z <= 2.4e-54) {
tmp = fma(((y - z) / a), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(fma(t, -1.0, x) / z), Float64(y - a), t) tmp = 0.0 if (z <= -2.8e+63) tmp = t_1; elseif (z <= -2.8e-137) tmp = Float64(Float64(Float64(t / Float64(z - a)) * Float64(z - y)) + x); elseif (z <= 2.4e-54) tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t * -1.0 + x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.8e+63], t$95$1, If[LessEqual[z, -2.8e-137], N[(N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.4e-54], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(t, -1, x\right)}{z}, y - a, t\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-137}:\\
\;\;\;\;\frac{t}{z - a} \cdot \left(z - y\right) + x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.79999999999999987e63 or 2.40000000000000013e-54 < z Initial program 48.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites75.3%
if -2.79999999999999987e63 < z < -2.7999999999999999e-137Initial program 92.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.0
Applied rewrites77.0%
if -2.7999999999999999e-137 < z < 2.40000000000000013e-54Initial program 92.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.1
Applied rewrites86.1%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) y x)))
(if (<= a -1.45e-38)
t_1
(if (<= a 6.5e-61)
(- t (/ (* (- t x) y) z))
(if (<= a 4.5e+51) (/ (* (- z y) t) (- z a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), y, x);
double tmp;
if (a <= -1.45e-38) {
tmp = t_1;
} else if (a <= 6.5e-61) {
tmp = t - (((t - x) * y) / z);
} else if (a <= 4.5e+51) {
tmp = ((z - y) * t) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), y, x) tmp = 0.0 if (a <= -1.45e-38) tmp = t_1; elseif (a <= 6.5e-61) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); elseif (a <= 4.5e+51) tmp = Float64(Float64(Float64(z - y) * t) / Float64(z - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -1.45e-38], t$95$1, If[LessEqual[a, 6.5e-61], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e+51], N[(N[(N[(z - y), $MachinePrecision] * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-61}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+51}:\\
\;\;\;\;\frac{\left(z - y\right) \cdot t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.44999999999999997e-38 or 4.5e51 < a Initial program 63.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.3
Applied rewrites66.3%
if -1.44999999999999997e-38 < a < 6.4999999999999994e-61Initial program 71.4%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.9
Applied rewrites77.9%
if 6.4999999999999994e-61 < a < 4.5e51Initial program 85.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6469.8
Applied rewrites69.8%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6473.9
Applied rewrites73.9%
Final simplification71.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) y x)))
(if (<= a -1.02e-44)
t_1
(if (<= a -1.95e-305)
(* (/ (- z y) z) t)
(if (<= a 170000000000.0) (* (/ y (- z a)) (- x t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), y, x);
double tmp;
if (a <= -1.02e-44) {
tmp = t_1;
} else if (a <= -1.95e-305) {
tmp = ((z - y) / z) * t;
} else if (a <= 170000000000.0) {
tmp = (y / (z - a)) * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), y, x) tmp = 0.0 if (a <= -1.02e-44) tmp = t_1; elseif (a <= -1.95e-305) tmp = Float64(Float64(Float64(z - y) / z) * t); elseif (a <= 170000000000.0) tmp = Float64(Float64(y / Float64(z - a)) * Float64(x - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -1.02e-44], t$95$1, If[LessEqual[a, -1.95e-305], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[a, 170000000000.0], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{if}\;a \leq -1.02 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-305}:\\
\;\;\;\;\frac{z - y}{z} \cdot t\\
\mathbf{elif}\;a \leq 170000000000:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.0199999999999999e-44 or 1.7e11 < a Initial program 65.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6464.0
Applied rewrites64.0%
if -1.0199999999999999e-44 < a < -1.95000000000000013e-305Initial program 74.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6454.5
Applied rewrites54.5%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6460.0
Applied rewrites60.0%
Taylor expanded in a around 0
Applied rewrites65.8%
if -1.95000000000000013e-305 < a < 1.7e11Initial program 72.5%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6465.8
Applied rewrites65.8%
Final simplification64.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y (- z a)) (- x t))))
(if (<= y -1.85e+120)
t_1
(if (<= y 6.8e+91) (+ (* (/ t (- z a)) (- z y)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / (z - a)) * (x - t);
double tmp;
if (y <= -1.85e+120) {
tmp = t_1;
} else if (y <= 6.8e+91) {
tmp = ((t / (z - a)) * (z - 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 = (y / (z - a)) * (x - t)
if (y <= (-1.85d+120)) then
tmp = t_1
else if (y <= 6.8d+91) then
tmp = ((t / (z - a)) * (z - 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 = (y / (z - a)) * (x - t);
double tmp;
if (y <= -1.85e+120) {
tmp = t_1;
} else if (y <= 6.8e+91) {
tmp = ((t / (z - a)) * (z - y)) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / (z - a)) * (x - t) tmp = 0 if y <= -1.85e+120: tmp = t_1 elif y <= 6.8e+91: tmp = ((t / (z - a)) * (z - y)) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / Float64(z - a)) * Float64(x - t)) tmp = 0.0 if (y <= -1.85e+120) tmp = t_1; elseif (y <= 6.8e+91) tmp = Float64(Float64(Float64(t / Float64(z - a)) * Float64(z - y)) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / (z - a)) * (x - t); tmp = 0.0; if (y <= -1.85e+120) tmp = t_1; elseif (y <= 6.8e+91) tmp = ((t / (z - a)) * (z - y)) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+120], t$95$1, If[LessEqual[y, 6.8e+91], N[(N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z - a} \cdot \left(x - t\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+91}:\\
\;\;\;\;\frac{t}{z - a} \cdot \left(z - y\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.85000000000000012e120 or 6.8000000000000002e91 < y Initial program 67.7%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6484.0
Applied rewrites84.0%
if -1.85000000000000012e120 < y < 6.8000000000000002e91Initial program 69.6%
Taylor expanded in t around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6469.8
Applied rewrites69.8%
Final simplification75.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) a) (- t x) x)))
(if (<= a -1.06e+27)
t_1
(if (<= a 1.8e-25) (- t (/ (* (- a y) (- x t)) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -1.06e+27) {
tmp = t_1;
} else if (a <= 1.8e-25) {
tmp = t - (((a - y) * (x - t)) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -1.06e+27) tmp = t_1; elseif (a <= 1.8e-25) tmp = Float64(t - Float64(Float64(Float64(a - y) * Float64(x - t)) / z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.06e+27], t$95$1, If[LessEqual[a, 1.8e-25], N[(t - N[(N[(N[(a - y), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -1.06 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-25}:\\
\;\;\;\;t - \frac{\left(a - y\right) \cdot \left(x - t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.05999999999999994e27 or 1.8e-25 < a Initial program 67.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6470.7
Applied rewrites70.7%
if -1.05999999999999994e27 < a < 1.8e-25Initial program 70.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6455.1
Applied rewrites55.1%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites76.6%
Final simplification73.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- y z) a) (- t x) x))) (if (<= a -1.3e-38) t_1 (if (<= a 1.8e-25) (- t (/ (* (- t x) y) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -1.3e-38) {
tmp = t_1;
} else if (a <= 1.8e-25) {
tmp = t - (((t - x) * y) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -1.3e-38) tmp = t_1; elseif (a <= 1.8e-25) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.3e-38], t$95$1, If[LessEqual[a, 1.8e-25], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-25}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.30000000000000005e-38 or 1.8e-25 < a Initial program 67.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.1
Applied rewrites69.1%
if -1.30000000000000005e-38 < a < 1.8e-25Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6471.3
Applied rewrites71.3%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.5
Applied rewrites76.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) y x)))
(if (<= a -1.45e-38)
t_1
(if (<= a 3.5e+23) (- t (/ (* (- t x) y) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), y, x);
double tmp;
if (a <= -1.45e-38) {
tmp = t_1;
} else if (a <= 3.5e+23) {
tmp = t - (((t - x) * y) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), y, x) tmp = 0.0 if (a <= -1.45e-38) tmp = t_1; elseif (a <= 3.5e+23) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -1.45e-38], t$95$1, If[LessEqual[a, 3.5e+23], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+23}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.44999999999999997e-38 or 3.5000000000000002e23 < a Initial program 64.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.4
Applied rewrites66.4%
if -1.44999999999999997e-38 < a < 3.5000000000000002e23Initial program 73.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6473.5
Applied rewrites73.5%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6473.7
Applied rewrites73.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ t (- z a)) (- z y)))) (if (<= t -1.6e-10) t_1 (if (<= t 4.8e-54) (fma (/ (- t x) a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t / (z - a)) * (z - y);
double tmp;
if (t <= -1.6e-10) {
tmp = t_1;
} else if (t <= 4.8e-54) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t / Float64(z - a)) * Float64(z - y)) tmp = 0.0 if (t <= -1.6e-10) tmp = t_1; elseif (t <= 4.8e-54) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e-10], t$95$1, If[LessEqual[t, 4.8e-54], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5999999999999999e-10 or 4.80000000000000026e-54 < t Initial program 68.4%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.2
Applied rewrites72.2%
if -1.5999999999999999e-10 < t < 4.80000000000000026e-54Initial program 69.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6452.5
Applied rewrites52.5%
Final simplification63.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.35e+57) (* (/ (- z y) z) t) (if (<= z 5.5e+81) (fma (/ (- t x) a) y x) (* (/ z (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+57) {
tmp = ((z - y) / z) * t;
} else if (z <= 5.5e+81) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = (z / (z - a)) * t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+57) tmp = Float64(Float64(Float64(z - y) / z) * t); elseif (z <= 5.5e+81) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = Float64(Float64(z / Float64(z - a)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+57], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 5.5e+81], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+57}:\\
\;\;\;\;\frac{z - y}{z} \cdot t\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{z - a} \cdot t\\
\end{array}
\end{array}
if z < -1.3499999999999999e57Initial program 34.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6419.7
Applied rewrites19.7%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
Applied rewrites50.1%
if -1.3499999999999999e57 < z < 5.5000000000000003e81Initial program 89.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6468.5
Applied rewrites68.5%
if 5.5000000000000003e81 < z Initial program 45.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f649.1
Applied rewrites9.1%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6444.1
Applied rewrites44.1%
Taylor expanded in y around 0
Applied rewrites52.4%
Final simplification61.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ z (- z a)) t))) (if (<= z -9e+172) t_1 (if (<= z 5.5e+81) (fma (/ (- t x) a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z / (z - a)) * t;
double tmp;
if (z <= -9e+172) {
tmp = t_1;
} else if (z <= 5.5e+81) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z / Float64(z - a)) * t) tmp = 0.0 if (z <= -9e+172) tmp = t_1; elseif (z <= 5.5e+81) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -9e+172], t$95$1, If[LessEqual[z, 5.5e+81], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{z - a} \cdot t\\
\mathbf{if}\;z \leq -9 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.0000000000000004e172 or 5.5000000000000003e81 < z Initial program 37.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f645.4
Applied rewrites5.4%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6436.6
Applied rewrites36.6%
Taylor expanded in y around 0
Applied rewrites54.7%
if -9.0000000000000004e172 < z < 5.5000000000000003e81Initial program 82.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.9
Applied rewrites63.9%
Final simplification61.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -1.7e+173) t_1 (if (<= z 4.8e+197) (fma (/ (- t x) a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -1.7e+173) {
tmp = t_1;
} else if (z <= 4.8e+197) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -1.7e+173) tmp = t_1; elseif (z <= 4.8e+197) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.7e+173], t$95$1, If[LessEqual[z, 4.8e+197], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+197}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.70000000000000011e173 or 4.7999999999999998e197 < z Initial program 28.6%
Taylor expanded in z around inf
lower--.f6455.4
Applied rewrites55.4%
if -1.70000000000000011e173 < z < 4.7999999999999998e197Initial program 79.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6459.5
Applied rewrites59.5%
Final simplification58.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -1.7e+173) t_1 (if (<= z 4.5e+210) (fma y (/ t a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -1.7e+173) {
tmp = t_1;
} else if (z <= 4.5e+210) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -1.7e+173) tmp = t_1; elseif (z <= 4.5e+210) tmp = fma(y, Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.7e+173], t$95$1, If[LessEqual[z, 4.5e+210], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+210}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.70000000000000011e173 or 4.50000000000000004e210 < z Initial program 29.4%
Taylor expanded in z around inf
lower--.f6457.4
Applied rewrites57.4%
if -1.70000000000000011e173 < z < 4.50000000000000004e210Initial program 78.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6463.5
Applied rewrites63.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6459.0
Applied rewrites59.0%
Taylor expanded in t around inf
Applied rewrites46.8%
Final simplification49.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y z) x))) (if (<= y -6.2e+82) t_1 (if (<= y 3.5e+75) (+ (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * x;
double tmp;
if (y <= -6.2e+82) {
tmp = t_1;
} else if (y <= 3.5e+75) {
tmp = (t - x) + 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 = (y / z) * x
if (y <= (-6.2d+82)) then
tmp = t_1
else if (y <= 3.5d+75) then
tmp = (t - x) + 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 = (y / z) * x;
double tmp;
if (y <= -6.2e+82) {
tmp = t_1;
} else if (y <= 3.5e+75) {
tmp = (t - x) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / z) * x tmp = 0 if y <= -6.2e+82: tmp = t_1 elif y <= 3.5e+75: tmp = (t - x) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / z) * x) tmp = 0.0 if (y <= -6.2e+82) tmp = t_1; elseif (y <= 3.5e+75) tmp = Float64(Float64(t - x) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / z) * x; tmp = 0.0; if (y <= -6.2e+82) tmp = t_1; elseif (y <= 3.5e+75) tmp = (t - x) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -6.2e+82], t$95$1, If[LessEqual[y, 3.5e+75], N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+75}:\\
\;\;\;\;\left(t - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.20000000000000065e82 or 3.4999999999999998e75 < y Initial program 69.2%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6450.6
Applied rewrites50.6%
Taylor expanded in y around inf
Applied rewrites50.4%
Taylor expanded in a around 0
Applied rewrites26.8%
Applied rewrites36.3%
if -6.20000000000000065e82 < y < 3.4999999999999998e75Initial program 68.6%
Taylor expanded in z around inf
lower--.f6431.0
Applied rewrites31.0%
Final simplification33.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ x z) y))) (if (<= x -5.8e-98) t_1 (if (<= x 8.5e+131) (+ (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x / z) * y;
double tmp;
if (x <= -5.8e-98) {
tmp = t_1;
} else if (x <= 8.5e+131) {
tmp = (t - x) + 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 / z) * y
if (x <= (-5.8d-98)) then
tmp = t_1
else if (x <= 8.5d+131) then
tmp = (t - x) + 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 / z) * y;
double tmp;
if (x <= -5.8e-98) {
tmp = t_1;
} else if (x <= 8.5e+131) {
tmp = (t - x) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x / z) * y tmp = 0 if x <= -5.8e-98: tmp = t_1 elif x <= 8.5e+131: tmp = (t - x) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x / z) * y) tmp = 0.0 if (x <= -5.8e-98) tmp = t_1; elseif (x <= 8.5e+131) tmp = Float64(Float64(t - x) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x / z) * y; tmp = 0.0; if (x <= -5.8e-98) tmp = t_1; elseif (x <= 8.5e+131) tmp = (t - x) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[x, -5.8e-98], t$95$1, If[LessEqual[x, 8.5e+131], N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot y\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+131}:\\
\;\;\;\;\left(t - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.8e-98 or 8.50000000000000063e131 < x Initial program 63.5%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6455.9
Applied rewrites55.9%
Taylor expanded in y around inf
Applied rewrites42.4%
Taylor expanded in a around 0
Applied rewrites27.4%
Applied rewrites34.9%
if -5.8e-98 < x < 8.50000000000000063e131Initial program 73.3%
Taylor expanded in z around inf
lower--.f6430.4
Applied rewrites30.4%
Final simplification32.5%
(FPCore (x y z t a) :precision binary64 (+ (- t x) x))
double code(double x, double y, double z, double t, double a) {
return (t - 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 = (t - x) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (t - x) + x;
}
def code(x, y, z, t, a): return (t - x) + x
function code(x, y, z, t, a) return Float64(Float64(t - x) + x) end
function tmp = code(x, y, z, t, a) tmp = (t - x) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(t - x\right) + x
\end{array}
Initial program 68.8%
Taylor expanded in z around inf
lower--.f6421.6
Applied rewrites21.6%
Final simplification21.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 68.8%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6440.7
Applied rewrites40.7%
Taylor expanded in z around inf
Applied rewrites2.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - 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 = t - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - x)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024263
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))