From 1e25068cd805b7201ae26a11c181fd73c5eb6e72 Mon Sep 17 00:00:00 2001 From: zane <39070793+zaneenders@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:29:35 -0600 Subject: [PATCH 1/2] Add new benchmark for log transform. --- bench/graphics/log-transform.fpcore | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 bench/graphics/log-transform.fpcore diff --git a/bench/graphics/log-transform.fpcore b/bench/graphics/log-transform.fpcore new file mode 100644 index 000000000..b7e39f9b1 --- /dev/null +++ b/bench/graphics/log-transform.fpcore @@ -0,0 +1,13 @@ +; This example is taken from the Image Processing domain and referred to +; as "Logarithmic Transform". This in it's basic form is used to bring out +; details in dark parts of an image. This instantiation of the idea is for 1D +; as opposed to 2D images. + +(FPCore (c x y) + :name "Logarithmic Transform" + :precision binary64 + :pre (and (and (and (<= -1.79e+308 c) (<= c 1.79e+308)) (and (<= -1.79e+308 x) (<= x 1.79e+308))) (and (<= -1.79e+308 y) (<= y 1.79e+308))) + :alt + (* c (log1p (* (expm1 x) y))) + + (* c (log (+ 1.0 (* (- (pow E x) 1.0) y))))) \ No newline at end of file From 3132a80efe466c071b41f9699fdc4b3c49488faa Mon Sep 17 00:00:00 2001 From: zane <39070793+zaneenders@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:19:30 -0600 Subject: [PATCH 2/2] Clean up suggestions from PR. --- bench/graphics/log-transform.fpcore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bench/graphics/log-transform.fpcore b/bench/graphics/log-transform.fpcore index b7e39f9b1..fe36e9097 100644 --- a/bench/graphics/log-transform.fpcore +++ b/bench/graphics/log-transform.fpcore @@ -1,12 +1,10 @@ ; This example is taken from the Image Processing domain and referred to -; as "Logarithmic Transform". This in it's basic form is used to bring out +; as "Logarithmic Transform". This in its basic form is used to bring out ; details in dark parts of an image. This instantiation of the idea is for 1D ; as opposed to 2D images. (FPCore (c x y) :name "Logarithmic Transform" - :precision binary64 - :pre (and (and (and (<= -1.79e+308 c) (<= c 1.79e+308)) (and (<= -1.79e+308 x) (<= x 1.79e+308))) (and (<= -1.79e+308 y) (<= y 1.79e+308))) :alt (* c (log1p (* (expm1 x) y)))