
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (- a z)) t x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (a - z)), t, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(a - z)), t, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)
\end{array}
Initial program 86.3%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.0
Applied egg-rr97.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.6e+58)
(+ t x)
(if (<= z 7e-55)
(fma y (/ t a) x)
(if (<= z 4.4e+167) (fma (/ y (- z)) t x) (fma t (/ x t) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e+58) {
tmp = t + x;
} else if (z <= 7e-55) {
tmp = fma(y, (t / a), x);
} else if (z <= 4.4e+167) {
tmp = fma((y / -z), t, x);
} else {
tmp = fma(t, (x / t), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e+58) tmp = Float64(t + x); elseif (z <= 7e-55) tmp = fma(y, Float64(t / a), x); elseif (z <= 4.4e+167) tmp = fma(Float64(y / Float64(-z)), t, x); else tmp = fma(t, Float64(x / t), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e+58], N[(t + x), $MachinePrecision], If[LessEqual[z, 7e-55], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4.4e+167], N[(N[(y / (-z)), $MachinePrecision] * t + x), $MachinePrecision], N[(t * N[(x / t), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+58}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+167}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-z}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{t}, t\right)\\
\end{array}
\end{array}
if z < -3.59999999999999996e58Initial program 69.3%
Taylor expanded in z around inf
Simplified86.3%
if -3.59999999999999996e58 < z < 7.00000000000000051e-55Initial program 94.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6478.5
Simplified78.5%
if 7.00000000000000051e-55 < z < 4.40000000000000007e167Initial program 92.8%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.3
Applied egg-rr96.3%
Taylor expanded in y around inf
Simplified80.2%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f6472.3
Simplified72.3%
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6474.1
Applied egg-rr74.1%
if 4.40000000000000007e167 < z Initial program 67.4%
Taylor expanded in z around inf
Simplified96.6%
Taylor expanded in t around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6496.6
Simplified96.6%
Final simplification81.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8e+58)
(+ t x)
(if (<= z 2.35e-56)
(fma y (/ t a) x)
(if (<= z 3.1e+167) (- x (/ (* y t) z)) (fma t (/ x t) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+58) {
tmp = t + x;
} else if (z <= 2.35e-56) {
tmp = fma(y, (t / a), x);
} else if (z <= 3.1e+167) {
tmp = x - ((y * t) / z);
} else {
tmp = fma(t, (x / t), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e+58) tmp = Float64(t + x); elseif (z <= 2.35e-56) tmp = fma(y, Float64(t / a), x); elseif (z <= 3.1e+167) tmp = Float64(x - Float64(Float64(y * t) / z)); else tmp = fma(t, Float64(x / t), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e+58], N[(t + x), $MachinePrecision], If[LessEqual[z, 2.35e-56], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 3.1e+167], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / t), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+58}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-56}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+167}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{x}{t}, t\right)\\
\end{array}
\end{array}
if z < -7.99999999999999955e58Initial program 69.3%
Taylor expanded in z around inf
Simplified86.3%
if -7.99999999999999955e58 < z < 2.35e-56Initial program 94.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6478.5
Simplified78.5%
if 2.35e-56 < z < 3.1e167Initial program 92.8%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.3
Applied egg-rr96.3%
Taylor expanded in y around inf
Simplified80.2%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6472.5
Simplified72.5%
if 3.1e167 < z Initial program 67.4%
Taylor expanded in z around inf
Simplified96.6%
Taylor expanded in t around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6496.6
Simplified96.6%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (- 1.0 (/ y z)) x))) (if (<= z -9e+83) t_1 (if (<= z 2.7e+56) (fma (/ t (- a z)) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (1.0 - (y / z)), x);
double tmp;
if (z <= -9e+83) {
tmp = t_1;
} else if (z <= 2.7e+56) {
tmp = fma((t / (a - z)), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(1.0 - Float64(y / z)), x) tmp = 0.0 if (z <= -9e+83) tmp = t_1; elseif (z <= 2.7e+56) tmp = fma(Float64(t / Float64(a - z)), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -9e+83], t$95$1, If[LessEqual[z, 2.7e+56], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, 1 - \frac{y}{z}, x\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.9999999999999999e83 or 2.7000000000000001e56 < z Initial program 74.6%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6493.9
Simplified93.9%
if -8.9999999999999999e83 < z < 2.7000000000000001e56Initial program 93.8%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.1
Applied egg-rr97.1%
Taylor expanded in y around inf
Simplified90.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (- 1.0 (/ y z)) x))) (if (<= z -5.2e-87) t_1 (if (<= z 8e-29) (fma (/ t a) (- y z) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (1.0 - (y / z)), x);
double tmp;
if (z <= -5.2e-87) {
tmp = t_1;
} else if (z <= 8e-29) {
tmp = fma((t / a), (y - z), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(1.0 - Float64(y / z)), x) tmp = 0.0 if (z <= -5.2e-87) tmp = t_1; elseif (z <= 8e-29) tmp = fma(Float64(t / a), Float64(y - z), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -5.2e-87], t$95$1, If[LessEqual[z, 8e-29], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, 1 - \frac{y}{z}, x\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.20000000000000005e-87 or 7.99999999999999955e-29 < z Initial program 79.5%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6484.1
Simplified84.1%
if -5.20000000000000005e-87 < z < 7.99999999999999955e-29Initial program 97.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.6
Simplified85.6%
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6488.4
Applied egg-rr88.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (- 1.0 (/ y z)) x))) (if (<= z -6e-87) t_1 (if (<= z 1.8e-55) (fma y (/ t a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (1.0 - (y / z)), x);
double tmp;
if (z <= -6e-87) {
tmp = t_1;
} else if (z <= 1.8e-55) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(1.0 - Float64(y / z)), x) tmp = 0.0 if (z <= -6e-87) tmp = t_1; elseif (z <= 1.8e-55) 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[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -6e-87], t$95$1, If[LessEqual[z, 1.8e-55], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, 1 - \frac{y}{z}, x\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.00000000000000033e-87 or 1.8e-55 < z Initial program 80.4%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6482.5
Simplified82.5%
if -6.00000000000000033e-87 < z < 1.8e-55Initial program 96.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6489.0
Simplified89.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.1e+58) (+ t x) (if (<= z 2.5e+56) (fma y (/ t a) x) (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+58) {
tmp = t + x;
} else if (z <= 2.5e+56) {
tmp = fma(y, (t / a), x);
} else {
tmp = t + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+58) tmp = Float64(t + x); elseif (z <= 2.5e+56) tmp = fma(y, Float64(t / a), x); else tmp = Float64(t + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+58], N[(t + x), $MachinePrecision], If[LessEqual[z, 2.5e+56], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+58}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -3.0999999999999999e58 or 2.50000000000000012e56 < z Initial program 75.8%
Taylor expanded in z around inf
Simplified84.0%
if -3.0999999999999999e58 < z < 2.50000000000000012e56Initial program 93.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6474.4
Simplified74.4%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (fma (/ t (- a z)) (- y z) x))
double code(double x, double y, double z, double t, double a) {
return fma((t / (a - z)), (y - z), x);
}
function code(x, y, z, t, a) return fma(Float64(t / Float64(a - z)), Float64(y - z), x) end
code[x_, y_, z_, t_, a_] := N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{t}{a - z}, y - z, x\right)
\end{array}
Initial program 86.3%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.2
Applied egg-rr95.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.8e-143) x (if (<= x 2.4e-122) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.8e-143) {
tmp = x;
} else if (x <= 2.4e-122) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-6.8d-143)) then
tmp = x
else if (x <= 2.4d-122) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.8e-143) {
tmp = x;
} else if (x <= 2.4e-122) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.8e-143: tmp = x elif x <= 2.4e-122: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.8e-143) tmp = x; elseif (x <= 2.4e-122) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6.8e-143) tmp = x; elseif (x <= 2.4e-122) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.8e-143], x, If[LessEqual[x, 2.4e-122], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-143}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-122}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.79999999999999966e-143 or 2.39999999999999987e-122 < x Initial program 85.7%
Taylor expanded in x around inf
Simplified64.3%
if -6.79999999999999966e-143 < x < 2.39999999999999987e-122Initial program 87.8%
Taylor expanded in z around inf
Simplified41.2%
Taylor expanded in x around 0
Simplified34.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.7e+178) x (+ t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e+178) {
tmp = x;
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.7d+178)) then
tmp = x
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e+178) {
tmp = x;
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.7e+178: tmp = x else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.7e+178) tmp = x; else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.7e+178) tmp = x; else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.7e+178], x, N[(t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+178}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if a < -2.70000000000000018e178Initial program 85.6%
Taylor expanded in x around inf
Simplified68.0%
if -2.70000000000000018e178 < a Initial program 86.4%
Taylor expanded in z around inf
Simplified63.9%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 86.3%
Taylor expanded in z around inf
Simplified61.7%
Taylor expanded in x around 0
Simplified19.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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 - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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 - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); 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 - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024199
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))