
(FPCore (x y z t a) :precision binary64 :pre TRUE (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = x - ((y - z) / (((t - z) + (1)) / a)) END code
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 :pre TRUE (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = x - ((y - z) / (((t - z) + (1)) / a)) END code
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
(FPCore (x y z t a) :precision binary64 :pre TRUE (fma a (/ (- z y) (+ 1.0 (- t z))) x))
double code(double x, double y, double z, double t, double a) {
return fma(a, ((z - y) / (1.0 + (t - z))), x);
}
function code(x, y, z, t, a) return fma(a, Float64(Float64(z - y) / Float64(1.0 + Float64(t - z))), x) end
code[x_, y_, z_, t_, a_] := N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 + N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = (a * ((z - y) / ((1) + (t - z)))) + x END code
\mathsf{fma}\left(a, \frac{z - y}{1 + \left(t - z\right)}, x\right)
Initial program 96.9%
Applied rewrites99.6%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -9.209060127716842e+100)
(fma a (/ (- z y) t) x)
(if (<= t 1.588974140430518e+72)
(fma a (/ (- z y) (- 1.0 z)) x)
(- x (/ (- y z) (/ t a))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.209060127716842e+100) {
tmp = fma(a, ((z - y) / t), x);
} else if (t <= 1.588974140430518e+72) {
tmp = fma(a, ((z - y) / (1.0 - z)), x);
} else {
tmp = x - ((y - z) / (t / a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.209060127716842e+100) tmp = fma(a, Float64(Float64(z - y) / t), x); elseif (t <= 1.588974140430518e+72) tmp = fma(a, Float64(Float64(z - y) / Float64(1.0 - z)), x); else tmp = Float64(x - Float64(Float64(y - z) / Float64(t / a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.209060127716842e+100], N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.588974140430518e+72], N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (1588974140430517904977279078016891919585776927988155899991536063735660544)) THEN ((a * ((z - y) / ((1) - z))) + x) ELSE (x - ((y - z) / (t / a))) ENDIF IN LET tmp = IF (t <= (-92090601277168424412061736530652869730985372047551950660329594233465220283737972226271163357119643648)) THEN ((a * ((z - y) / t)) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -9.209060127716842 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z - y}{t}, x\right)\\
\mathbf{elif}\;t \leq 1.588974140430518 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z - y}{1 - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\
\end{array}
if t < -9.2090601277168424e100Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in t around inf
Applied rewrites53.8%
if -9.2090601277168424e100 < t < 1.5889741404305179e72Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in t around 0
Applied rewrites79.8%
if 1.5889741404305179e72 < t Initial program 96.9%
Taylor expanded in t around inf
Applied rewrites54.3%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (fma (- y z) (/ a z) x)))
(if (<= z -429393245428857860.0)
t_1
(if (<= z 2.9669578702788e-8) (- x (/ (* a y) (+ 1.0 t))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (a / z), x);
double tmp;
if (z <= -429393245428857860.0) {
tmp = t_1;
} else if (z <= 2.9669578702788e-8) {
tmp = x - ((a * y) / (1.0 + t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(a / z), x) tmp = 0.0 if (z <= -429393245428857860.0) tmp = t_1; elseif (z <= 2.9669578702788e-8) tmp = Float64(x - Float64(Float64(a * y) / Float64(1.0 + t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -429393245428857860.0], t$95$1, If[LessEqual[z, 2.9669578702788e-8], N[(x - N[(N[(a * y), $MachinePrecision] / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = (((y - z) * (a / z)) + x) IN LET tmp_1 = IF (z <= (2966957870278799904431975427952783430640693040913902223110198974609375e-77)) THEN (x - ((a * y) / ((1) + t))) ELSE t_1 ENDIF IN LET tmp = IF (z <= (-429393245428857856)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{a}{z}, x\right)\\
\mathbf{if}\;z \leq -429393245428857860:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9669578702788 \cdot 10^{-8}:\\
\;\;\;\;x - \frac{a \cdot y}{1 + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -429393245428857860 or 2.9669578702787999e-8 < z Initial program 96.9%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites57.1%
if -429393245428857860 < z < 2.9669578702787999e-8Initial program 96.9%
Taylor expanded in z around 0
Applied rewrites68.8%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -8.743689116393911e+100)
(fma a (/ (- z y) t) x)
(if (<= t -8.48977571085483e-164)
(fma a (/ z (- 1.0 z)) x)
(if (<= t 1.588974140430518e+72)
(- x (* a (/ y (- 1.0 z))))
(- x (* a (/ y t)))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.743689116393911e+100) {
tmp = fma(a, ((z - y) / t), x);
} else if (t <= -8.48977571085483e-164) {
tmp = fma(a, (z / (1.0 - z)), x);
} else if (t <= 1.588974140430518e+72) {
tmp = x - (a * (y / (1.0 - z)));
} else {
tmp = x - (a * (y / t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.743689116393911e+100) tmp = fma(a, Float64(Float64(z - y) / t), x); elseif (t <= -8.48977571085483e-164) tmp = fma(a, Float64(z / Float64(1.0 - z)), x); elseif (t <= 1.588974140430518e+72) tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 - z)))); else tmp = Float64(x - Float64(a * Float64(y / t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.743689116393911e+100], N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, -8.48977571085483e-164], N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.588974140430518e+72], N[(x - N[(a * N[(y / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_2 = IF (t <= (1588974140430517904977279078016891919585776927988155899991536063735660544)) THEN (x - (a * (y / ((1) - z)))) ELSE (x - (a * (y / t))) ENDIF IN LET tmp_1 = IF (t <= (-848977571085482954365607604259322329905206278806212609486785644141778936815181015554688261768445364966165597293041854026566030599358464187466693859079982044539480619304055445241599751228790727372864694252566680182456945199224774707318769082811469138592612369872451032475711589319712134597267186857973982053174639508356301721526938855810399541857152049987851877725345773930485010594468482658658814443697337992489337921142578125e-589)) THEN ((a * (z / ((1) - z))) + x) ELSE tmp_2 ENDIF IN LET tmp = IF (t <= (-87436891163939109535450069906425861963793904862902628923866482999012006214380180979616755430698516480)) THEN ((a * ((z - y) / t)) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -8.743689116393911 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z - y}{t}, x\right)\\
\mathbf{elif}\;t \leq -8.48977571085483 \cdot 10^{-164}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 - z}, x\right)\\
\mathbf{elif}\;t \leq 1.588974140430518 \cdot 10^{+72}:\\
\;\;\;\;x - a \cdot \frac{y}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\end{array}
if t < -8.743689116393911e100Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in t around inf
Applied rewrites53.8%
if -8.743689116393911e100 < t < -8.4897757108548295e-164Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites73.5%
Taylor expanded in t around 0
Applied rewrites66.1%
if -8.4897757108548295e-164 < t < 1.5889741404305179e72Initial program 96.9%
Taylor expanded in y around inf
Applied rewrites73.7%
Taylor expanded in t around 0
Applied rewrites62.7%
Applied rewrites64.5%
if 1.5889741404305179e72 < t Initial program 96.9%
Taylor expanded in t around inf
Applied rewrites51.1%
Taylor expanded in y around inf
Applied rewrites54.0%
Applied rewrites55.7%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (fma (- y z) (/ a z) x)))
(if (<= z -261491804051375550.0)
t_1
(if (<= z 1.1689062569814557e-136)
(- x (/ (* a y) 1.0))
(if (<= z 7.89290889567554e-12)
(fma a (/ z (+ 1.0 t)) x)
t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (a / z), x);
double tmp;
if (z <= -261491804051375550.0) {
tmp = t_1;
} else if (z <= 1.1689062569814557e-136) {
tmp = x - ((a * y) / 1.0);
} else if (z <= 7.89290889567554e-12) {
tmp = fma(a, (z / (1.0 + t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(a / z), x) tmp = 0.0 if (z <= -261491804051375550.0) tmp = t_1; elseif (z <= 1.1689062569814557e-136) tmp = Float64(x - Float64(Float64(a * y) / 1.0)); elseif (z <= 7.89290889567554e-12) tmp = fma(a, Float64(z / Float64(1.0 + t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -261491804051375550.0], t$95$1, If[LessEqual[z, 1.1689062569814557e-136], N[(x - N[(N[(a * y), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.89290889567554e-12], N[(a * N[(z / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = (((y - z) * (a / z)) + x) IN LET tmp_2 = IF (z <= (789290889567554046096926610693745988457659112924602595739997923374176025390625e-89)) THEN ((a * (z / ((1) + t))) + x) ELSE t_1 ENDIF IN LET tmp_1 = IF (z <= (11689062569814557456504976687070482409168411299026905829703030298874197016597937994529717240947662636646126623515081481690239314632902078667122720135730772354784079318280137075426975073255251841757348857709604822537724875013433797741375912953717502583566997403752518111418666854064383539062009774271516212773705533754777790710240037430622805914026685059070587158203125e-503)) THEN (x - ((a * y) / (1))) ELSE tmp_2 ENDIF IN LET tmp = IF (z <= (-261491804051375552)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{a}{z}, x\right)\\
\mathbf{if}\;z \leq -261491804051375550:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1689062569814557 \cdot 10^{-136}:\\
\;\;\;\;x - \frac{a \cdot y}{1}\\
\mathbf{elif}\;z \leq 7.89290889567554 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 + t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -261491804051375550 or 7.8929088956755405e-12 < z Initial program 96.9%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites57.1%
if -261491804051375550 < z < 1.1689062569814557e-136Initial program 96.9%
Taylor expanded in y around inf
Applied rewrites73.7%
Taylor expanded in t around 0
Applied rewrites62.7%
Taylor expanded in z around 0
Applied rewrites56.7%
if 1.1689062569814557e-136 < z < 7.8929088956755405e-12Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites73.5%
Taylor expanded in z around 0
Applied rewrites53.0%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -8.743689116393911e+100)
(fma a (/ (- z y) t) x)
(if (<= t 1.9958465885143322e-46)
(fma a (/ z (- 1.0 z)) x)
(- x (* a (/ y t))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.743689116393911e+100) {
tmp = fma(a, ((z - y) / t), x);
} else if (t <= 1.9958465885143322e-46) {
tmp = fma(a, (z / (1.0 - z)), x);
} else {
tmp = x - (a * (y / t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.743689116393911e+100) tmp = fma(a, Float64(Float64(z - y) / t), x); elseif (t <= 1.9958465885143322e-46) tmp = fma(a, Float64(z / Float64(1.0 - z)), x); else tmp = Float64(x - Float64(a * Float64(y / t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.743689116393911e+100], N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.9958465885143322e-46], N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (19958465885143322253071183511186748514139706798809594708584493125509105130665800245771396699095847904254686631353682239875535486817170749418437480926513671875e-203)) THEN ((a * (z / ((1) - z))) + x) ELSE (x - (a * (y / t))) ENDIF IN LET tmp = IF (t <= (-87436891163939109535450069906425861963793904862902628923866482999012006214380180979616755430698516480)) THEN ((a * ((z - y) / t)) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -8.743689116393911 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z - y}{t}, x\right)\\
\mathbf{elif}\;t \leq 1.9958465885143322 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\end{array}
if t < -8.743689116393911e100Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in t around inf
Applied rewrites53.8%
if -8.743689116393911e100 < t < 1.9958465885143322e-46Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites73.5%
Taylor expanded in t around 0
Applied rewrites66.1%
if 1.9958465885143322e-46 < t Initial program 96.9%
Taylor expanded in t around inf
Applied rewrites51.1%
Taylor expanded in y around inf
Applied rewrites54.0%
Applied rewrites55.7%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= z -5.2401274959286454e+69)
(- x a)
(if (<= z 1.3771913992391488e-136)
(- x (/ (* a y) 1.0))
(if (<= z 51415045947863040.0) (fma a (/ z 1.0) x) (- x a)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2401274959286454e+69) {
tmp = x - a;
} else if (z <= 1.3771913992391488e-136) {
tmp = x - ((a * y) / 1.0);
} else if (z <= 51415045947863040.0) {
tmp = fma(a, (z / 1.0), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2401274959286454e+69) tmp = Float64(x - a); elseif (z <= 1.3771913992391488e-136) tmp = Float64(x - Float64(Float64(a * y) / 1.0)); elseif (z <= 51415045947863040.0) tmp = fma(a, Float64(z / 1.0), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2401274959286454e+69], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.3771913992391488e-136], N[(x - N[(N[(a * y), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 51415045947863040.0], N[(a * N[(z / 1.0), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_2 = IF (z <= (51415045947863040)) THEN ((a * (z / (1))) + x) ELSE (x - a) ENDIF IN LET tmp_1 = IF (z <= (137719139923914883681944525330971478511046996123033030587505701586521985420841293423718472004529110964270902096520263061753749232379440214459689109088594308037818205638525007326136094654167066970417654116480605388773610279843571087779173264007168996963436338110461591300116299672566806084041454815907436380935623330127370446776015333600895473864511586725711822509765625e-504)) THEN (x - ((a * y) / (1))) ELSE tmp_2 ENDIF IN LET tmp = IF (z <= (-5240127495928645404650702366282045090084663310735805993680651404967936)) THEN (x - a) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;z \leq -5.2401274959286454 \cdot 10^{+69}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.3771913992391488 \cdot 10^{-136}:\\
\;\;\;\;x - \frac{a \cdot y}{1}\\
\mathbf{elif}\;z \leq 51415045947863040:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -5.2401274959286454e69 or 51415045947863040 < z Initial program 96.9%
Taylor expanded in z around inf
Applied rewrites58.9%
if -5.2401274959286454e69 < z < 1.3771913992391488e-136Initial program 96.9%
Taylor expanded in y around inf
Applied rewrites73.7%
Taylor expanded in t around 0
Applied rewrites62.7%
Taylor expanded in z around 0
Applied rewrites56.7%
if 1.3771913992391488e-136 < z < 51415045947863040Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites73.5%
Taylor expanded in t around 0
Applied rewrites66.1%
Taylor expanded in z around 0
Applied rewrites43.2%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= z -7.100329979148691e+82) (- x a) (if (<= z 5.096755374494824e-12) (- x (* a (/ y t))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.100329979148691e+82) {
tmp = x - a;
} else if (z <= 5.096755374494824e-12) {
tmp = x - (a * (y / t));
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.100329979148691d+82)) then
tmp = x - a
else if (z <= 5.096755374494824d-12) then
tmp = x - (a * (y / t))
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.100329979148691e+82) {
tmp = x - a;
} else if (z <= 5.096755374494824e-12) {
tmp = x - (a * (y / t));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.100329979148691e+82: tmp = x - a elif z <= 5.096755374494824e-12: tmp = x - (a * (y / t)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.100329979148691e+82) tmp = Float64(x - a); elseif (z <= 5.096755374494824e-12) tmp = Float64(x - Float64(a * Float64(y / t))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.100329979148691e+82) tmp = x - a; elseif (z <= 5.096755374494824e-12) tmp = x - (a * (y / t)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.100329979148691e+82], N[(x - a), $MachinePrecision], If[LessEqual[z, 5.096755374494824e-12], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (z <= (5096755374494823614096771616268003574599931848609912776737473905086517333984375e-90)) THEN (x - (a * (y / t))) ELSE (x - a) ENDIF IN LET tmp = IF (z <= (-71003299791486909743695491055666916355018625220269571925477465805918605213993795584)) THEN (x - a) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;z \leq -7.100329979148691 \cdot 10^{+82}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 5.096755374494824 \cdot 10^{-12}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -7.100329979148691e82 or 5.0967553744948236e-12 < z Initial program 96.9%
Taylor expanded in z around inf
Applied rewrites58.9%
if -7.100329979148691e82 < z < 5.0967553744948236e-12Initial program 96.9%
Taylor expanded in t around inf
Applied rewrites51.1%
Taylor expanded in y around inf
Applied rewrites54.0%
Applied rewrites55.7%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= z -8089.580774177239) (- x a) (if (<= z 51415045947863040.0) (fma a (/ z 1.0) x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8089.580774177239) {
tmp = x - a;
} else if (z <= 51415045947863040.0) {
tmp = fma(a, (z / 1.0), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8089.580774177239) tmp = Float64(x - a); elseif (z <= 51415045947863040.0) tmp = fma(a, Float64(z / 1.0), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8089.580774177239], N[(x - a), $MachinePrecision], If[LessEqual[z, 51415045947863040.0], N[(a * N[(z / 1.0), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (z <= (51415045947863040)) THEN ((a * (z / (1))) + x) ELSE (x - a) ENDIF IN LET tmp = IF (z <= (-8089580774177238708944059908390045166015625e-39)) THEN (x - a) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;z \leq -8089.580774177239:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 51415045947863040:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
if z < -8089.5807741772387 or 51415045947863040 < z Initial program 96.9%
Taylor expanded in z around inf
Applied rewrites58.9%
if -8089.5807741772387 < z < 51415045947863040Initial program 96.9%
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites73.5%
Taylor expanded in t around 0
Applied rewrites66.1%
Taylor expanded in z around 0
Applied rewrites43.2%
(FPCore (x y z t a) :precision binary64 :pre TRUE (let* ((t_1 (/ (* a y) -1.0)) (t_2 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 2e+250) (- x a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * y) / -1.0;
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 2e+250) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a * y) / -1.0;
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 2e+250) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * y) / -1.0 t_2 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 2e+250: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * y) / -1.0) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 2e+250) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * y) / -1.0; t_2 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 2e+250) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * y), $MachinePrecision] / -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 2e+250], N[(x - a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{a \cdot y}{-1}\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+250}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -inf.0 or 1.9999999999999998e250 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 96.9%
Applied rewrites97.2%
Taylor expanded in y around inf
Applied rewrites24.6%
Taylor expanded in t around 0
Applied rewrites18.0%
Taylor expanded in z around 0
Applied rewrites14.9%
if -inf.0 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 1.9999999999999998e250Initial program 96.9%
Taylor expanded in z around inf
Applied rewrites58.9%
(FPCore (x y z t a) :precision binary64 :pre TRUE (let* ((t_1 (* a (/ y z))) (t_2 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_2 -5e+284) t_1 (if (<= t_2 2e+250) (- x a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * (y / z);
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -5e+284) {
tmp = t_1;
} else if (t_2 <= 2e+250) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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) :: t_2
real(8) :: tmp
t_1 = a * (y / z)
t_2 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_2 <= (-5d+284)) then
tmp = t_1
else if (t_2 <= 2d+250) then
tmp = x - a
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 = a * (y / z);
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -5e+284) {
tmp = t_1;
} else if (t_2 <= 2e+250) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * (y / z) t_2 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_2 <= -5e+284: tmp = t_1 elif t_2 <= 2e+250: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * Float64(y / z)) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= -5e+284) tmp = t_1; elseif (t_2 <= 2e+250) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * (y / z); t_2 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_2 <= -5e+284) tmp = t_1; elseif (t_2 <= 2e+250) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+284], t$95$1, If[LessEqual[t$95$2, 2e+250], N[(x - a), $MachinePrecision], t$95$1]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = (a * (y / z)) IN LET t_2 = ((y - z) / (((t - z) + (1)) / a)) IN LET tmp_1 = IF (t_2 <= (19999999999999998421936661664294053151080855387504444745733035393436825233278672005560948283410708288220728162236284648020809571429082630568562515505514583247285006834145935719548240949300738322281106670384019261349564171109391944306795105153030553600)) THEN (x - a) ELSE t_1 ENDIF IN LET tmp = IF (t_2 <= (-499999999999999990079578960260221425096554759926423605900012855280825179991269042612044308093073246922143074698610725186309660447719446848973826083227612667029686373206874073603221710445876270310293765181110136931503450775547995353849221420762954771236422294344040540188066309300289536)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := a \cdot \frac{y}{z}\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+284}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+250}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -4.9999999999999999e284 or 1.9999999999999998e250 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 96.9%
Applied rewrites97.2%
Taylor expanded in y around inf
Applied rewrites24.6%
Taylor expanded in z around inf
Applied rewrites8.9%
Applied rewrites10.1%
if -4.9999999999999999e284 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 1.9999999999999998e250Initial program 96.9%
Taylor expanded in z around inf
Applied rewrites58.9%
(FPCore (x y z t a) :precision binary64 :pre TRUE (- x a))
double code(double x, double y, double z, double t, double a) {
return x - a;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 - a
end function
public static double code(double x, double y, double z, double t, double a) {
return x - a;
}
def code(x, y, z, t, a): return x - a
function code(x, y, z, t, a) return Float64(x - a) end
function tmp = code(x, y, z, t, a) tmp = x - a; end
code[x_, y_, z_, t_, a_] := N[(x - a), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = x - a END code
x - a
Initial program 96.9%
Taylor expanded in z around inf
Applied rewrites58.9%
herbie shell --seed 2026092
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))